Bug 1175685 - Add special appId for SAFEBROWSING_APP_ID. r=ckerschb

This commit is contained in:
Dragana Damjanovic 2015-10-21 13:43:00 +02:00
parent 97db461f92
commit 4433e7ff59
3 changed files with 8 additions and 0 deletions

View File

@ -77,6 +77,7 @@ function setupChannel(path, loadContext) {
null, // aTriggeringPrincipal
Ci.nsILoadInfo.SEC_NORMAL,
Ci.nsIContentPolicy.TYPE_OTHER);
channel.loadInfo.originAttributes = loadContext.originAttributes;
channel.notificationCallbacks = loadContext;
channel.QueryInterface(Ci.nsIHttpChannel);
return channel;

View File

@ -65,6 +65,9 @@ PROT_XMLFetcher.prototype = {
this._request = PROT_NewXMLHttpRequest();
this._callback = callback;
var asynchronous = true;
this._request.loadInfo.originAttributes = { appId: this.appId,
inBrowser: this.isInBrowserElement
}
this._request.open("GET", page, asynchronous);
this._request.channel.notificationCallbacks = this;

View File

@ -15,6 +15,7 @@
#include "nsStringStream.h"
#include "nsToolkitCompsCID.h"
#include "nsUrlClassifierStreamUpdater.h"
#include "mozilla/BasePrincipal.h"
#include "mozilla/ErrorNames.h"
#include "mozilla/Logging.h"
#include "nsIInterfaceRequestor.h"
@ -100,6 +101,9 @@ nsUrlClassifierStreamUpdater::FetchUpdate(nsIURI *aUpdateUrl,
NS_ENSURE_SUCCESS(rv, rv);
nsCOMPtr<nsILoadInfo> loadInfo = mChannel->GetLoadInfo();
loadInfo->SetOriginAttributes(mozilla::OriginAttributes(NECKO_SAFEBROWSING_APP_ID, false));
mBeganStream = false;
// If aRequestBody is empty, construct it for the test.