Bug 897516 - Implement a separate cookie jar for safebrowsing - cookie separation part. r=mmc
This commit is contained in:
@@ -15,9 +15,13 @@
|
||||
#include "nsToolkitCompsCID.h"
|
||||
#include "nsUrlClassifierStreamUpdater.h"
|
||||
#include "prlog.h"
|
||||
#include "nsIInterfaceRequestor.h"
|
||||
#include "mozilla/LoadContext.h"
|
||||
|
||||
static const char* gQuitApplicationMessage = "quit-application";
|
||||
|
||||
#undef LOG
|
||||
|
||||
// NSPR_LOG_MODULES=UrlClassifierStreamUpdater:5
|
||||
#if defined(PR_LOGGING)
|
||||
static const PRLogModuleInfo *gUrlClassifierStreamUpdaterLog = nullptr;
|
||||
@@ -124,6 +128,14 @@ nsUrlClassifierStreamUpdater::FetchUpdate(nsIURI *aUpdateUrl,
|
||||
mChannel->SetContentType(NS_LITERAL_CSTRING("application/vnd.google.safebrowsing-update"));
|
||||
}
|
||||
|
||||
// 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);
|
||||
rv = mChannel->SetNotificationCallbacks(sbContext);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
// Make the request
|
||||
rv = mChannel->AsyncOpen(this, nullptr);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
Reference in New Issue
Block a user