Bug 1210617 - [e10s] Implement PrivateBrowsingChannel for ExternalHelperAppParent. r=jduell
authorFelipe Gomes <felipc@gmail.com>
Mon, 23 Nov 2015 12:20:50 -0200
changeset 273785 bfd81e42d1ddc7071c7fab2598f3099aab30ca92
parent 273784 5052c7b0634f91e50ee9fbf4d1c741c7eff074ae
child 273786 29f87d064607ef5683b5aec9eb7d0b732b101c08
push id29714
push usercbook@mozilla.com
push dateTue, 24 Nov 2015 10:58:39 +0000
treeherdermozilla-central@45273bbed8ef [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjduell
bugs1210617
milestone45.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 1210617 - [e10s] Implement PrivateBrowsingChannel for ExternalHelperAppParent. r=jduell
uriloader/exthandler/ExternalHelperAppParent.cpp
uriloader/exthandler/ExternalHelperAppParent.h
--- a/uriloader/exthandler/ExternalHelperAppParent.cpp
+++ b/uriloader/exthandler/ExternalHelperAppParent.cpp
@@ -27,16 +27,17 @@ using namespace mozilla::ipc;
 namespace mozilla {
 namespace dom {
 
 NS_IMPL_ISUPPORTS_INHERITED(ExternalHelperAppParent,
                             nsHashPropertyBag,
                             nsIRequest,
                             nsIChannel,
                             nsIMultiPartChannel,
+                            nsIPrivateBrowsingChannel,
                             nsIResumableChannel,
                             nsIStreamListener)
 
 ExternalHelperAppParent::ExternalHelperAppParent(
     const OptionalURIParams& uri,
     const int64_t& aContentLength)
   : mURI(DeserializeURI(uri))
   , mPending(false)
@@ -79,16 +80,21 @@ ExternalHelperAppParent::Init(ContentPar
     mContentDispositionFilename = aContentDispositionFilename;
   }
 
   nsCOMPtr<nsIInterfaceRequestor> window;
   if (aBrowser) {
     TabParent* tabParent = TabParent::GetFrom(aBrowser);
     if (tabParent->GetOwnerElement())
       window = do_QueryInterface(tabParent->GetOwnerElement()->OwnerDoc()->GetWindow());
+
+    bool isPrivate = false;
+    nsCOMPtr<nsILoadContext> loadContext = tabParent->GetLoadContext();
+    loadContext->GetUsePrivateBrowsing(&isPrivate);
+    SetPrivate(isPrivate);
   }
 
   helperAppService->DoContent(aMimeContentType, this, window,
                               aForceSave, nullptr,
                               getter_AddRefs(mListener));
 }
 
 void
--- a/uriloader/exthandler/ExternalHelperAppParent.h
+++ b/uriloader/exthandler/ExternalHelperAppParent.h
@@ -5,16 +5,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "mozilla/dom/PExternalHelperAppParent.h"
 #include "nsIChannel.h"
 #include "nsIMultiPartChannel.h"
 #include "nsIResumableChannel.h"
 #include "nsIStreamListener.h"
 #include "nsHashPropertyBag.h"
+#include "PrivateBrowsingChannel.h"
 
 namespace IPC {
 class URI;
 } // namespace IPC
 
 namespace mozilla {
 
 namespace ipc {
@@ -31,16 +32,17 @@ class ContentParent;
 class PBrowserParent;
 
 class ExternalHelperAppParent : public PExternalHelperAppParent
                               , public nsHashPropertyBag
                               , public nsIChannel
                               , public nsIMultiPartChannel
                               , public nsIResumableChannel
                               , public nsIStreamListener
+                              , public net::PrivateBrowsingChannel<ExternalHelperAppParent>
 {
     typedef mozilla::ipc::OptionalURIParams OptionalURIParams;
 
 public:
     NS_DECL_ISUPPORTS_INHERITED
     NS_DECL_NSIREQUEST
     NS_DECL_NSICHANNEL
     NS_DECL_NSIMULTIPARTCHANNEL