Bug 1356514 - remove the usage of nsContentUtils::IsInPrivateBrowsing() in HTMLMediaElement.cpp. r=Ehsan
authorJW Wang <jwwang@mozilla.com>
Tue, 18 Apr 2017 14:26:32 +0800
changeset 566723 68798c23a30d97b4fd5c98c15b407c1f71720a41
parent 566722 184dc928df689bea8008becd8fe6ea2058c028e6
child 566724 fb7deea90ec83b3a6cfa37d83998b6c7b1b037ac
push id55308
push userbmo:rajesh.kathiriya507@gmail.com
push dateSat, 22 Apr 2017 10:15:05 +0000
reviewersEhsan
bugs1356514, 1194891
milestone55.0a1
Bug 1356514 - remove the usage of nsContentUtils::IsInPrivateBrowsing() in HTMLMediaElement.cpp. r=Ehsan Per bug 1194891 comment 35, use |NodePrincipal()->GetPrivateBrowsingId() > 0| instead. MozReview-Commit-ID: Cu6geuTWhGz
dom/html/HTMLMediaElement.cpp
--- a/dom/html/HTMLMediaElement.cpp
+++ b/dom/html/HTMLMediaElement.cpp
@@ -4682,17 +4682,17 @@ nsresult HTMLMediaElement::InitializeDec
     NS_ConvertUTF8toUTF16 mimeUTF16(mimeType);
     const char16_t* params[] = { mimeUTF16.get(), src.get() };
     ReportLoadError("MediaLoadUnsupportedMimeType", params, ArrayLength(params));
     return NS_ERROR_FAILURE;
   }
 
   LOG(LogLevel::Debug, ("%p Created decoder %p for type %s", this, decoder.get(), mimeType.get()));
 
-  bool isPrivateBrowsing = nsContentUtils::IsInPrivateBrowsing(OwnerDoc());
+  bool isPrivateBrowsing = NodePrincipal()->GetPrivateBrowsingId() > 0;
   RefPtr<MediaResource> resource = MediaResource::Create(
     decoder->GetResourceCallback(), aChannel, isPrivateBrowsing);
 
   if (!resource) {
     decoder->Shutdown();
     return NS_ERROR_OUT_OF_MEMORY;
   }