From ce928e90ee6f45454d44e37ac45bdb8fe48914dd Mon Sep 17 00:00:00 2001 From: Garrett Robinson Date: Tue, 21 May 2013 14:50:26 -0400 Subject: [PATCH] Bug 791284 - Add debugging code to nsDocument::StartDocumentLoad and fix and re-enable test. r=sicking --- browser/components/tabview/test/Makefile.in | 1 + content/base/src/nsDocument.cpp | 10 ++++++++++ services/sync/Weave.js | 2 +- 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/browser/components/tabview/test/Makefile.in b/browser/components/tabview/test/Makefile.in index 50e52b6ec4fd..6eeaae4162e0 100644 --- a/browser/components/tabview/test/Makefile.in +++ b/browser/components/tabview/test/Makefile.in @@ -148,6 +148,7 @@ _BROWSER_FILES = \ browser_tabview_snapping.js \ browser_tabview_startup_transitions.js \ browser_tabview_undo_group.js \ + browser_tabview_bug610242.js \ dummy_page.html \ head.js \ search1.html \ diff --git a/content/base/src/nsDocument.cpp b/content/base/src/nsDocument.cpp index 0c27d8733881..34c945de0855 100644 --- a/content/base/src/nsDocument.cpp +++ b/content/base/src/nsDocument.cpp @@ -2346,6 +2346,16 @@ nsDocument::StartDocumentLoad(const char* aCommand, nsIChannel* aChannel, } #endif +#ifdef DEBUG + { + uint32_t appId; + nsresult rv = NodePrincipal()->GetAppId(&appId); + NS_ENSURE_SUCCESS(rv, rv); + MOZ_ASSERT(appId != nsIScriptSecurityManager::UNKNOWN_APP_ID, + "Document should never have UNKNOWN_APP_ID"); + } +#endif + MOZ_ASSERT(GetReadyStateEnum() == nsIDocument::READYSTATE_UNINITIALIZED, "Bad readyState"); SetReadyStateInternal(READYSTATE_LOADING); diff --git a/services/sync/Weave.js b/services/sync/Weave.js index cd7cd5baf392..f39eb12f5134 100644 --- a/services/sync/Weave.js +++ b/services/sync/Weave.js @@ -121,7 +121,7 @@ AboutWeaveLog.prototype = { // view. That way links to files can be opened. let ssm = Cc["@mozilla.org/scriptsecuritymanager;1"] .getService(Ci.nsIScriptSecurityManager); - let principal = ssm.getSimpleCodebasePrincipal(uri); + let principal = ssm.getNoAppCodebasePrincipal(uri); channel.owner = principal; return channel; }