mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-27 23:02:20 +00:00
Bug 1244340 - Part 1: Use origin attributes as cstor arg for LoadContext r=sicking
This commit is contained in:
parent
0028508811
commit
8ace8c51a5
@ -93,14 +93,14 @@ public:
|
||||
MOZ_ASSERT(aUsePrivateBrowsing == (aAttrs.mPrivateBrowsingId != 0));
|
||||
}
|
||||
|
||||
// Constructor taking reserved appId for the safebrowsing cookie.
|
||||
explicit LoadContext(uint32_t aAppId)
|
||||
// Constructor taking reserved origin attributes.
|
||||
explicit LoadContext(DocShellOriginAttributes& aAttrs)
|
||||
: mTopFrameElement(nullptr)
|
||||
, mNestedFrameId(0)
|
||||
, mIsContent(false)
|
||||
, mUsePrivateBrowsing(false)
|
||||
, mUsePrivateBrowsing(aAttrs.mPrivateBrowsingId != 0)
|
||||
, mUseRemoteTabs(false)
|
||||
, mOriginAttributes(aAppId, false)
|
||||
, mOriginAttributes(aAttrs)
|
||||
#ifdef DEBUG
|
||||
, mIsNotNull(true)
|
||||
#endif
|
||||
|
@ -52,6 +52,7 @@
|
||||
#include "nsContentUtils.h"
|
||||
|
||||
using mozilla::BasePrincipal;
|
||||
using mozilla::DocShellOriginAttributes;
|
||||
using mozilla::PrincipalOriginAttributes;
|
||||
using mozilla::Preferences;
|
||||
using mozilla::TimeStamp;
|
||||
@ -1282,8 +1283,9 @@ PendingLookup::SendRemoteQueryInternal()
|
||||
|
||||
// Set the Safebrowsing cookie jar, so that the regular Google cookie is not
|
||||
// sent with this request. See bug 897516.
|
||||
nsCOMPtr<nsIInterfaceRequestor> loadContext =
|
||||
new mozilla::LoadContext(NECKO_SAFEBROWSING_APP_ID);
|
||||
DocShellOriginAttributes attrs;
|
||||
attrs.mAppId = NECKO_SAFEBROWSING_APP_ID;
|
||||
nsCOMPtr<nsIInterfaceRequestor> loadContext = new mozilla::LoadContext(attrs);
|
||||
rv = mChannel->SetNotificationCallbacks(loadContext);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
|
@ -24,6 +24,8 @@
|
||||
#include "nsContentUtils.h"
|
||||
#include "nsIURLFormatter.h"
|
||||
|
||||
using mozilla::DocShellOriginAttributes;
|
||||
|
||||
static const char* gQuitApplicationMessage = "quit-application";
|
||||
|
||||
// Limit the list file size to 32mb
|
||||
@ -178,8 +180,9 @@ nsUrlClassifierStreamUpdater::FetchUpdate(nsIURI *aUpdateUrl,
|
||||
// Create a custom LoadContext for SafeBrowsing, so we can use callbacks on
|
||||
// the channel to query the appId which allows separation of safebrowsing
|
||||
// cookies in a separate jar.
|
||||
nsCOMPtr<nsIInterfaceRequestor> sbContext =
|
||||
new mozilla::LoadContext(NECKO_SAFEBROWSING_APP_ID);
|
||||
DocShellOriginAttributes attrs;
|
||||
attrs.mAppId = NECKO_SAFEBROWSING_APP_ID;
|
||||
nsCOMPtr<nsIInterfaceRequestor> sbContext = new mozilla::LoadContext(attrs);
|
||||
rv = mChannel->SetNotificationCallbacks(sbContext);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user