1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
9 A pushed stream is put into a memory buffer (The SpdyPushTransactionBuffer)
10 and spooled there until a GET is made that can be matched up with it. At
11 that time we have two spdy streams - the GET (aka the sink) and the PUSH
12 (aka the source). Data is copied between those two streams for the lifetime
13 of the transaction. This is true even if the transaction buffer is empty,
14 partly complete, or totally loaded at the time the GET correspondence is made.
16 correspondence is done through a hash table of the full url, the spdy session,
17 and the load group. The load group is implicit because that's where the
18 hash is stored, the other items comprise the hash key.
20 Pushed streams are subject to aggressive flow control before they are matched
21 with a GET at which point flow control is effectively disabled to match the
25 #ifndef mozilla_net_SpdyPush_Public_h
26 #define mozilla_net_SpdyPush_Public_h
28 #include "nsTHashMap.h"
29 #include "nsISupports.h"
30 #include "nsStringFwd.h"
35 class Http2PushedStream
;
37 // One cache per load group
40 // The cache holds only weak pointers - no references
41 SpdyPushCache() = default;
42 virtual ~SpdyPushCache();
43 [[nodiscard
]] bool RegisterPushedStreamHttp2(const nsCString
& key
,
44 Http2PushedStream
* stream
);
45 Http2PushedStream
* RemovePushedStreamHttp2(const nsCString
& key
);
46 Http2PushedStream
* RemovePushedStreamHttp2ByID(const nsCString
& key
,
47 const uint32_t& streamID
);
50 nsTHashMap
<nsCStringHashKey
, Http2PushedStream
*> mHashHttp2
;
54 } // namespace mozilla
56 #endif // mozilla_net_SpdyPush_Public_h