Backed out changeset b56f9bccea92 (bug 1017257)

This commit is contained in:
Adam Roach [:abr] 2014-10-06 16:36:49 -05:00
Родитель da98617c0c
Коммит 0e53fbc62d
4 изменённых файлов: 0 добавлений и 45 удалений

Просмотреть файл

@ -1616,7 +1616,6 @@ pref("loop.debug.loglevel", "Error");
pref("loop.debug.dispatcher", false);
pref("loop.debug.websocket", false);
pref("loop.debug.sdk", false);
pref("loop.CSP", "default-src 'self' about: file: chrome:; img-src 'self' data: http://www.gravatar.com/ about: file: chrome:; font-src 'none'; connect-src wss://*.tokbox.com https://*.opentok.com https://*.tokbox.com wss://*.mozilla.com wss://*.mozaws.net");
pref("loop.oauth.google.redirect_uri", "urn:ietf:wg:oauth:2.0:oob:auto");
pref("loop.oauth.google.scope", "https://www.google.com/m8/feeds");

Просмотреть файл

@ -2752,33 +2752,6 @@ AppendCSPFromHeader(nsIContentSecurityPolicy* csp,
return NS_OK;
}
bool
nsDocument::IsLoopDocument(nsIChannel *aChannel)
{
nsCOMPtr<nsIURI> chanURI;
nsresult rv = aChannel->GetOriginalURI(getter_AddRefs(chanURI));
NS_ENSURE_SUCCESS(rv, false);
bool isAbout = false;
bool isLoop = false;
rv = chanURI->SchemeIs("about", &isAbout);
NS_ENSURE_SUCCESS(rv, false);
if (isAbout) {
nsCOMPtr<nsIURI> loopURI;
rv = NS_NewURI(getter_AddRefs(loopURI), "about:loopconversation");
NS_ENSURE_SUCCESS(rv, false);
rv = chanURI->EqualsExceptRef(loopURI, &isLoop);
NS_ENSURE_SUCCESS(rv, false);
if (!isLoop) {
rv = NS_NewURI(getter_AddRefs(loopURI), "about:looppanel");
NS_ENSURE_SUCCESS(rv, false);
rv = chanURI->EqualsExceptRef(loopURI, &isLoop);
NS_ENSURE_SUCCESS(rv, false);
}
}
return isLoop;
}
nsresult
nsDocument::InitCSP(nsIChannel* aChannel)
{
@ -2832,13 +2805,9 @@ nsDocument::InitCSP(nsIChannel* aChannel)
}
}
// Check if this is part of the Loop/Hello service
bool applyLoopCSP = IsLoopDocument(aChannel);
// If there's no CSP to apply, go ahead and return early
if (!applyAppDefaultCSP &&
!applyAppManifestCSP &&
!applyLoopCSP &&
cspHeaderValue.IsEmpty() &&
cspROHeaderValue.IsEmpty()) {
#ifdef PR_LOGGING
@ -2911,17 +2880,6 @@ nsDocument::InitCSP(nsIChannel* aChannel)
csp->AppendPolicy(appManifestCSP, false);
}
// ----- if the doc is part of Loop, apply the loop CSP
if (applyLoopCSP) {
nsAdoptingString loopCSP;
loopCSP = Preferences::GetString("loop.CSP");
NS_ASSERTION(loopCSP, "Missing loop.CSP preference");
// If the pref has been removed, we continue without setting a CSP
if (loopCSP) {
csp->AppendPolicy(loopCSP, false);
}
}
// ----- if there's a full-strength CSP header, apply it.
if (!cspHeaderValue.IsEmpty()) {
rv = AppendCSPFromHeader(csp, cspHeaderValue, false);

Просмотреть файл

@ -1662,7 +1662,6 @@ private:
void DoUnblockOnload();
nsresult CheckFrameOptions();
bool IsLoopDocument(nsIChannel* aChannel);
nsresult InitCSP(nsIChannel* aChannel);
void FlushCSPWebConsoleErrorQueue()

Просмотреть файл

@ -254,7 +254,6 @@ user_pref("loop.enabled", true);
user_pref("loop.throttled", false);
user_pref("loop.oauth.google.URL", "http://%(server)s/browser/browser/components/loop/test/mochitest/google_service.sjs?action=");
user_pref("loop.oauth.google.getContactsURL", "http://%(server)s/browser/browser/components/loop/test/mochitest/google_service.sjs?action=contacts");
user_pref("loop.CSP","default-src 'self' about: file: chrome: data: wss://* http://* https://*");
// Ensure UITour won't hit the network
user_pref("browser.uitour.pinnedTabUrl", "http://%(server)s/uitour-dummy/pinnedTab");