Loading netwerk/ipc/NeckoChild.cpp +11 −0 Original line number Diff line number Diff line Loading @@ -391,6 +391,17 @@ NeckoChild::RecvAppOfflineStatus(const uint32_t& aId, const bool& aOffline) return true; } bool NeckoChild::RecvSpeculativeConnectRequest(const nsCString& aNotificationData) { nsCOMPtr<nsIObserverService> obsService = services::GetObserverService(); if (obsService) { obsService->NotifyObservers(nullptr, "speculative-connect-request", NS_ConvertUTF8toUTF16(aNotificationData).get()); } return true; } } // namespace net } // namespace mozilla netwerk/ipc/NeckoChild.h +2 −0 Original line number Diff line number Diff line Loading @@ -87,6 +87,8 @@ protected: /* Predictor Messsages */ virtual bool RecvPredOnPredictPreconnect(const URIParams& aURI) override; virtual bool RecvPredOnPredictDNS(const URIParams& aURI) override; virtual bool RecvSpeculativeConnectRequest(const nsCString& aNotificationData) override; }; /** Loading netwerk/ipc/NeckoParent.cpp +1 −0 Original line number Diff line number Diff line Loading @@ -94,6 +94,7 @@ NeckoParent::NeckoParent() NeckoParent::~NeckoParent() { gNeckoParent = nullptr; if (mObserver) { mObserver->RemoveObserver(); } Loading netwerk/ipc/PNecko.ipdl +2 −0 Original line number Diff line number Diff line Loading @@ -129,6 +129,8 @@ child: async PredOnPredictPreconnect(URIParams uri); async PredOnPredictDNS(URIParams uri); async SpeculativeConnectRequest(nsCString notificationData); both: // Actually we need PTCPSocket() for parent. But ipdl disallows us having different // signatures on parent and child. So when constructing the parent side object, we just Loading netwerk/protocol/http/nsHttpHandler.cpp +5 −0 Original line number Diff line number Diff line Loading @@ -56,8 +56,10 @@ #include "nsIOService.h" #include "mozilla/net/NeckoChild.h" #include "mozilla/net/NeckoParent.h" #include "mozilla/ipc/URIUtils.h" #include "mozilla/Telemetry.h" #include "mozilla/unused.h" #if defined(XP_UNIX) #include <sys/utsname.h> Loading Loading @@ -2175,6 +2177,9 @@ nsHttpHandler::SpeculativeConnectInternal(nsIURI *aURI, obsService->NotifyObservers(nullptr, "speculative-connect-request", NS_ConvertUTF8toUTF16(spec).get()); if (!IsNeckoChild() && gNeckoParent) { Unused << gNeckoParent->SendSpeculativeConnectRequest(spec); } } nsISiteSecurityService* sss = gHttpHandler->GetSSService(); Loading Loading
netwerk/ipc/NeckoChild.cpp +11 −0 Original line number Diff line number Diff line Loading @@ -391,6 +391,17 @@ NeckoChild::RecvAppOfflineStatus(const uint32_t& aId, const bool& aOffline) return true; } bool NeckoChild::RecvSpeculativeConnectRequest(const nsCString& aNotificationData) { nsCOMPtr<nsIObserverService> obsService = services::GetObserverService(); if (obsService) { obsService->NotifyObservers(nullptr, "speculative-connect-request", NS_ConvertUTF8toUTF16(aNotificationData).get()); } return true; } } // namespace net } // namespace mozilla
netwerk/ipc/NeckoChild.h +2 −0 Original line number Diff line number Diff line Loading @@ -87,6 +87,8 @@ protected: /* Predictor Messsages */ virtual bool RecvPredOnPredictPreconnect(const URIParams& aURI) override; virtual bool RecvPredOnPredictDNS(const URIParams& aURI) override; virtual bool RecvSpeculativeConnectRequest(const nsCString& aNotificationData) override; }; /** Loading
netwerk/ipc/NeckoParent.cpp +1 −0 Original line number Diff line number Diff line Loading @@ -94,6 +94,7 @@ NeckoParent::NeckoParent() NeckoParent::~NeckoParent() { gNeckoParent = nullptr; if (mObserver) { mObserver->RemoveObserver(); } Loading
netwerk/ipc/PNecko.ipdl +2 −0 Original line number Diff line number Diff line Loading @@ -129,6 +129,8 @@ child: async PredOnPredictPreconnect(URIParams uri); async PredOnPredictDNS(URIParams uri); async SpeculativeConnectRequest(nsCString notificationData); both: // Actually we need PTCPSocket() for parent. But ipdl disallows us having different // signatures on parent and child. So when constructing the parent side object, we just Loading
netwerk/protocol/http/nsHttpHandler.cpp +5 −0 Original line number Diff line number Diff line Loading @@ -56,8 +56,10 @@ #include "nsIOService.h" #include "mozilla/net/NeckoChild.h" #include "mozilla/net/NeckoParent.h" #include "mozilla/ipc/URIUtils.h" #include "mozilla/Telemetry.h" #include "mozilla/unused.h" #if defined(XP_UNIX) #include <sys/utsname.h> Loading Loading @@ -2175,6 +2177,9 @@ nsHttpHandler::SpeculativeConnectInternal(nsIURI *aURI, obsService->NotifyObservers(nullptr, "speculative-connect-request", NS_ConvertUTF8toUTF16(spec).get()); if (!IsNeckoChild() && gNeckoParent) { Unused << gNeckoParent->SendSpeculativeConnectRequest(spec); } } nsISiteSecurityService* sss = gHttpHandler->GetSSService(); Loading