Bug 1505844 - nullcheck of non-ClassOfService channel in FetchDriver to avoid crash r=mayhemer
authorJunior Hsu <juhsu@mozilla.com>
Wed, 28 Nov 2018 22:32:32 +0000
changeset 508097 2b8cf5fe84e5d21c678131290d06da9cf3fa6aae
parent 508096 305c06df7740f4b2393c53dae175f0d199f3e30b
child 508098 49b56d4d7fafc0a8bdabc00ce6b956564d9690a9
push id1905
push userffxbld-merge
push dateMon, 21 Jan 2019 12:33:13 +0000
treeherdermozilla-release@c2fca1944d8c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmayhemer
bugs1505844
milestone65.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1505844 - nullcheck of non-ClassOfService channel in FetchDriver to avoid crash r=mayhemer Differential Revision: https://phabricator.services.mozilla.com/D12363
dom/fetch/FetchDriver.cpp
--- a/dom/fetch/FetchDriver.cpp
+++ b/dom/fetch/FetchDriver.cpp
@@ -721,17 +721,17 @@ FetchDriver::HttpFetch(const nsACString&
     AutoTArray<nsCString, 5> unsafeHeaders;
     mRequest->Headers()->GetUnsafeHeaders(unsafeHeaders);
     nsCOMPtr<nsILoadInfo> loadInfo = chan->GetLoadInfo();
     if (loadInfo) {
       loadInfo->SetCorsPreflightInfo(unsafeHeaders, false);
     }
   }
 
-  if (mIsTrackingFetch && nsContentUtils::IsTailingEnabled()) {
+  if (mIsTrackingFetch && nsContentUtils::IsTailingEnabled() && cos) {
     cos->AddClassFlags(nsIClassOfService::Throttleable |
                        nsIClassOfService::Tail);
   }
 
   if (mIsTrackingFetch && nsContentUtils::IsLowerNetworkPriority()) {
     nsCOMPtr<nsISupportsPriority> p = do_QueryInterface(chan);
     if (p) {
       p->SetPriority(nsISupportsPriority::PRIORITY_LOWEST);