diff --git a/netwerk/protocol/http/Http2Push.cpp b/netwerk/protocol/http/Http2Push.cpp index 2b1356ba8bb8..30555b9e30b2 100644 --- a/netwerk/protocol/http/Http2Push.cpp +++ b/netwerk/protocol/http/Http2Push.cpp @@ -185,14 +185,12 @@ Http2PushedStream::ReadSegments(nsAHttpSegmentReader *reader, nsresult rv = NS_OK; *count = 0; - mozilla::OriginAttributes originAttributes; switch (mUpstreamState) { case GENERATING_HEADERS: // The request headers for this has been processed, so we need to verify // that :authority, :scheme, and :path MUST be present. :method MUST NOT be // present - mSocketTransport->GetOriginAttributes(&originAttributes); - CreatePushHashKey(mHeaderScheme, mHeaderHost, originAttributes, + CreatePushHashKey(mHeaderScheme, mHeaderHost, mSession->Serial(), mHeaderPath, mOrigin, mHashKey); diff --git a/netwerk/protocol/http/Http2Stream.cpp b/netwerk/protocol/http/Http2Stream.cpp index 6b3278753f9c..9d129d81424d 100644 --- a/netwerk/protocol/http/Http2Stream.cpp +++ b/netwerk/protocol/http/Http2Stream.cpp @@ -21,7 +21,6 @@ #include "Http2Push.h" #include "TunnelUtils.h" -#include "mozilla/BasePrincipal.h" #include "mozilla/Telemetry.h" #include "nsAlgorithm.h" #include "nsHttp.h" @@ -347,7 +346,6 @@ Http2Stream::MakeOriginURL(const nsACString &scheme, const nsACString &origin, void Http2Stream::CreatePushHashKey(const nsCString &scheme, const nsCString &hostHeader, - const mozilla::OriginAttributes &originAttributes, uint64_t serial, const nsCSubstring &pathInfo, nsCString &outOrigin, @@ -371,11 +369,6 @@ Http2Stream::CreatePushHashKey(const nsCString &scheme, } outKey = outOrigin; - outKey.AppendLiteral("/["); - nsAutoCString suffix; - originAttributes.CreateSuffix(suffix); - outKey.Append(suffix); - outKey.Append(']'); outKey.AppendLiteral("/[http2."); outKey.AppendInt(serial); outKey.Append(']'); @@ -431,11 +424,8 @@ Http2Stream::ParseHttpRequestHeaders(const char *buf, nsAutoCString requestURI; head->RequestURI(requestURI); - - mozilla::OriginAttributes originAttributes; - mSocketTransport->GetOriginAttributes(&originAttributes), CreatePushHashKey(nsDependentCString(head->IsHTTPS() ? "https" : "http"), - authorityHeader, originAttributes, mSession->Serial(), + authorityHeader, mSession->Serial(), requestURI, mOrigin, hashkey); diff --git a/netwerk/protocol/http/Http2Stream.h b/netwerk/protocol/http/Http2Stream.h index 1ad1fe20c698..7b49ed36f92a 100644 --- a/netwerk/protocol/http/Http2Stream.h +++ b/netwerk/protocol/http/Http2Stream.h @@ -18,10 +18,6 @@ class nsIInputStream; class nsIOutputStream; -namespace mozilla{ -class OriginAttributes; -} - namespace mozilla { namespace net { @@ -169,7 +165,6 @@ public: protected: static void CreatePushHashKey(const nsCString &scheme, const nsCString &hostHeader, - const mozilla::OriginAttributes &originAttributes, uint64_t serial, const nsCSubstring &pathInfo, nsCString &outOrigin, @@ -226,9 +221,6 @@ protected: virtual void AdjustInitialWindow(); MOZ_MUST_USE nsresult TransmitFrame(const char *, uint32_t *, bool forceCommitment); - // The underlying socket transport object is needed to propogate some events - nsISocketTransport *mSocketTransport; - private: friend class nsAutoPtr; @@ -246,6 +238,9 @@ private: // (i.e. don't change it or release it after it is set in the ctor). RefPtr mTransaction; + // The underlying socket transport object is needed to propogate some events + nsISocketTransport *mSocketTransport; + // The quanta upstream data frames are chopped into uint32_t mChunkSize; diff --git a/netwerk/protocol/http/nsHttpConnectionMgr.cpp b/netwerk/protocol/http/nsHttpConnectionMgr.cpp index 67298babb9d3..0c9ecf66961a 100644 --- a/netwerk/protocol/http/nsHttpConnectionMgr.cpp +++ b/netwerk/protocol/http/nsHttpConnectionMgr.cpp @@ -3159,11 +3159,6 @@ nsHttpConnectionMgr::nsHalfOpenSocket::OnTransportStatus(nsITransport *trans, newKey->AppendLiteral("~.:"); } newKey->AppendInt(mEnt->mConnInfo->OriginPort()); - newKey->AppendLiteral("/["); - nsAutoCString suffix; - mEnt->mConnInfo->GetOriginAttributes().CreateSuffix(suffix); - newKey->Append(suffix); - newKey->Append(']'); LOG(("nsHttpConnectionMgr::nsHalfOpenSocket::OnTransportStatus " "STATUS_CONNECTING_TO Established New Coalescing Key # %d for host " "%s [%s]", i, mEnt->mConnInfo->Origin(), newKey->get())); diff --git a/netwerk/test/unit/test_http2.js b/netwerk/test/unit/test_http2.js index 6ce6ea9e19b6..4a57deed08c9 100644 --- a/netwerk/test/unit/test_http2.js +++ b/netwerk/test/unit/test_http2.js @@ -148,9 +148,7 @@ Http2HeaderListener.prototype.onDataAvailable = function(request, ctx, stream, o read_stream(stream, cnt); }; -var Http2PushListener = function(shouldBePushed) { - this.shouldBePushed = shouldBePushed; -}; +var Http2PushListener = function() {}; Http2PushListener.prototype = new Http2CheckListener(); @@ -160,7 +158,7 @@ Http2PushListener.prototype.onDataAvailable = function(request, ctx, stream, off if (request.originalURI.spec == "https://localhost:" + serverPort + "/push.js" || request.originalURI.spec == "https://localhost:" + serverPort + "/push2.js" || request.originalURI.spec == "https://localhost:" + serverPort + "/push5.js") { - do_check_eq(request.getResponseHeader("pushed"), this.shouldBePushed ? "yes" : "no"); + do_check_eq(request.getResponseHeader("pushed"), "yes"); } read_stream(stream, cnt); }; @@ -494,42 +492,42 @@ function test_http2_cookie_crumbling() { function test_http2_push1() { var chan = makeChan("https://localhost:" + serverPort + "/push"); chan.loadGroup = loadGroup; - var listener = new Http2PushListener(true); + var listener = new Http2PushListener(); chan.asyncOpen2(listener); } function test_http2_push2() { var chan = makeChan("https://localhost:" + serverPort + "/push.js"); chan.loadGroup = loadGroup; - var listener = new Http2PushListener(true); + var listener = new Http2PushListener(); chan.asyncOpen2(listener); } function test_http2_push3() { var chan = makeChan("https://localhost:" + serverPort + "/push2"); chan.loadGroup = loadGroup; - var listener = new Http2PushListener(true); + var listener = new Http2PushListener(); chan.asyncOpen2(listener); } function test_http2_push4() { var chan = makeChan("https://localhost:" + serverPort + "/push2.js"); chan.loadGroup = loadGroup; - var listener = new Http2PushListener(true); + var listener = new Http2PushListener(); chan.asyncOpen2(listener); } function test_http2_push5() { var chan = makeChan("https://localhost:" + serverPort + "/push5"); chan.loadGroup = loadGroup; - var listener = new Http2PushListener(true); + var listener = new Http2PushListener(); chan.asyncOpen2(listener); } function test_http2_push6() { var chan = makeChan("https://localhost:" + serverPort + "/push5.js"); chan.loadGroup = loadGroup; - var listener = new Http2PushListener(true); + var listener = new Http2PushListener(); chan.asyncOpen2(listener); } @@ -901,54 +899,6 @@ function test_http2_empty_data() { chan.asyncOpen2(listener); } -function test_http2_push_firstparty1() { - var chan = makeChan("https://localhost:" + serverPort + "/push"); - chan.loadGroup = loadGroup; - chan.loadInfo.originAttributes = { firstPartyDomain: "foo.com" }; - var listener = new Http2PushListener(true); - chan.asyncOpen2(listener); -} - -function test_http2_push_firstparty2() { - var chan = makeChan("https://localhost:" + serverPort + "/push.js"); - chan.loadGroup = loadGroup; - chan.loadInfo.originAttributes = { firstPartyDomain: "bar.com" }; - var listener = new Http2PushListener(false); - chan.asyncOpen2(listener); -} - -function test_http2_push_firstparty3() { - var chan = makeChan("https://localhost:" + serverPort + "/push.js"); - chan.loadGroup = loadGroup; - chan.loadInfo.originAttributes = { firstPartyDomain: "foo.com" }; - var listener = new Http2PushListener(true); - chan.asyncOpen2(listener); -} - -function test_http2_push_userContext1() { - var chan = makeChan("https://localhost:" + serverPort + "/push"); - chan.loadGroup = loadGroup; - chan.loadInfo.originAttributes = { userContextId: 1 }; - var listener = new Http2PushListener(true); - chan.asyncOpen2(listener); -} - -function test_http2_push_userContext2() { - var chan = makeChan("https://localhost:" + serverPort + "/push.js"); - chan.loadGroup = loadGroup; - chan.loadInfo.originAttributes = { userContextId: 2 }; - var listener = new Http2PushListener(false); - chan.asyncOpen2(listener); -} - -function test_http2_push_userContext3() { - var chan = makeChan("https://localhost:" + serverPort + "/push.js"); - chan.loadGroup = loadGroup; - chan.loadInfo.originAttributes = { userContextId: 1 }; - var listener = new Http2PushListener(true); - chan.asyncOpen2(listener); -} - function test_complete() { resetPrefs(); do_test_pending(); @@ -1001,12 +951,6 @@ var tests = [ test_http2_post_big , test_http2_h11required_session , test_http2_retry_rst , test_http2_wrongsuite - , test_http2_push_firstparty1 - , test_http2_push_firstparty2 - , test_http2_push_firstparty3 - , test_http2_push_userContext1 - , test_http2_push_userContext2 - , test_http2_push_userContext3 // cleanup , test_complete diff --git a/testing/xpcshell/moz-http2/moz-http2.js b/testing/xpcshell/moz-http2/moz-http2.js index 2759560836ff..760fef1ef37c 100644 --- a/testing/xpcshell/moz-http2/moz-http2.js +++ b/testing/xpcshell/moz-http2/moz-http2.js @@ -277,11 +277,6 @@ function handleRequest(req, res) { content = '