Bug 533592, part 1 - Remove uses of and support for xpcnativewrappers=no/yes in manifests. (The default has been yes for some time and we will now only have that behavior.) r=mrbkap.

This commit is contained in:
Jason Orendorff
2010-05-27 12:33:54 -07:00
parent 9b0f7b2149
commit 0499a9ce66
23 changed files with 27 additions and 46 deletions

View File

@@ -1,5 +1,5 @@
browser.jar:
% content browser %content/browser/ xpcnativewrappers=yes contentaccessible=yes
% content browser %content/browser/ contentaccessible=yes
#ifdef XP_MACOSX
% overlay chrome://mozapps/content/downloads/downloads.xul chrome://browser/content/downloadManagerOverlay.xul
% overlay chrome://mozapps/content/extensions/extensions.xul chrome://browser/content/extensionsManagerOverlay.xul

View File

@@ -1,5 +1,5 @@
browser.jar:
% content branding %content/branding/ xpcnativewrappers=yes
% content branding %content/branding/
content/branding/about.png (about.png)
content/branding/aboutCredits.png (aboutCredits.png)
content/branding/aboutFooter.png (aboutFooter.png)

View File

@@ -1,5 +1,5 @@
browser.jar:
% content branding %content/branding/ xpcnativewrappers=yes
% content branding %content/branding/
content/branding/about.png (about.png)
content/branding/aboutCredits.png (aboutCredits.png)
content/branding/aboutFooter.png (aboutFooter.png)

View File

@@ -1267,8 +1267,7 @@ nsChromeRegistry::WrappersEnabled(nsIURI *aURI)
& (nsACString&) package,
PL_DHASH_LOOKUP));
return PL_DHASH_ENTRY_IS_LIVE(entry) &&
entry->flags & PackageEntry::XPCNATIVEWRAPPERS;
return PL_DHASH_ENTRY_IS_LIVE(entry);
}
nsresult
@@ -1611,7 +1610,6 @@ nsChromeRegistry::ProcessManifestBuffer(char *buf, PRInt32 length,
nsresult rv;
NS_NAMED_LITERAL_STRING(kPlatform, "platform");
NS_NAMED_LITERAL_STRING(kXPCNativeWrappers, "xpcnativewrappers");
NS_NAMED_LITERAL_STRING(kContentAccessible, "contentaccessible");
NS_NAMED_LITERAL_STRING(kApplication, "application");
NS_NAMED_LITERAL_STRING(kAppVersion, "appversion");
@@ -1712,11 +1710,10 @@ nsChromeRegistry::ProcessManifestBuffer(char *buf, PRInt32 length,
EnsureLowerCase(package);
// NOTE: We check for platform and xpcnativewrappers modifiers on
// content packages, but they are *applied* to content|skin|locale.
// NOTE: We check for platform modifiers on content packages, but they
// are *applied* to content|skin|locale.
PRBool platform = PR_FALSE;
PRBool xpcNativeWrappers = PR_TRUE;
PRBool contentAccessible = PR_FALSE;
TriState stAppVersion = eUnspecified;
TriState stApp = eUnspecified;
@@ -1731,7 +1728,6 @@ nsChromeRegistry::ProcessManifestBuffer(char *buf, PRInt32 length,
ToLowerCase(wtoken);
if (CheckFlag(kPlatform, wtoken, platform) ||
CheckFlag(kXPCNativeWrappers, wtoken, xpcNativeWrappers) ||
CheckFlag(kContentAccessible, wtoken, contentAccessible) ||
CheckStringFlag(kApplication, wtoken, appID, stApp) ||
CheckStringFlag(kOs, wtoken, osTarget, stOs) ||
@@ -1773,8 +1769,6 @@ nsChromeRegistry::ProcessManifestBuffer(char *buf, PRInt32 length,
if (platform)
entry->flags |= PackageEntry::PLATFORM_PACKAGE;
if (xpcNativeWrappers)
entry->flags |= PackageEntry::XPCNATIVEWRAPPERS;
if (contentAccessible)
entry->flags |= PackageEntry::CONTENT_ACCESSIBLE;
if (xpc) {
@@ -1782,7 +1776,7 @@ nsChromeRegistry::ProcessManifestBuffer(char *buf, PRInt32 length,
urlp.Append(package);
urlp.Append('/');
rv = xpc->FlagSystemFilenamePrefix(urlp.get(), xpcNativeWrappers);
rv = xpc->FlagSystemFilenamePrefix(urlp.get(), true);
NS_ENSURE_SUCCESS(rv, rv);
}
}

View File

@@ -185,13 +185,8 @@ public:
// Appends one of win/ unix/ mac/ to the base URI.
PLATFORM_PACKAGE = 1 << 0,
// This package should use the new XPCNativeWrappers to separate
// content from chrome. This flag is currently unused (because we call
// into xpconnect at registration time).
XPCNATIVEWRAPPERS = 1 << 1,
// Content script may access files in this package
CONTENT_ACCESSIBLE = 1 << 2
CONTENT_ACCESSIBLE = 1 << 1
};
nsCString package;

View File

@@ -1,4 +1,4 @@
content test chrome/test/one xpcnativewrappers=no
content test chrome/test/one
locale ab-X-stuff chrome/test/three
overlay chrome://one/file.xml chrome://two/otherfile.xml
skin test classic chrome/test/one

View File

@@ -2,7 +2,7 @@
test.jar:
# test chrome with flags and path expansion
% content test %one xpcnativewrappers=no
% content test %one
# test locale with variable substitution and path expansion
% locale @AB_CD@ %three
# test overlays

View File

@@ -1,4 +1,4 @@
content test test/one xpcnativewrappers=no
content test test/one
locale ab-X-stuff test/three
overlay chrome://one/file.xml chrome://two/otherfile.xml
skin test classic test/one

View File

@@ -1,4 +1,4 @@
content test jar:test.jar!/one xpcnativewrappers=no
content test jar:test.jar!/one
locale ab-X-stuff jar:test.jar!/three
overlay chrome://one/file.xml chrome://two/otherfile.xml
skin test classic jar:test.jar!/one

View File

@@ -1,4 +1,4 @@
content test test/one xpcnativewrappers=no
content test test/one
locale ab-X-stuff test/three
overlay chrome://one/file.xml chrome://two/otherfile.xml
skin test classic test/one

View File

@@ -1,5 +1,5 @@
metrics.jar:
% content metrics %content/ xpcnativewrappers=no
% content metrics %content/
% skin metrics classic/1.0 %skin/
% locale metrics en-US %locale/en-US/
content/prefs.xul (content/prefs.xul)

View File

@@ -1,5 +1,5 @@
toolkit.jar:
% content reporter %content/reporter/ xpcnativewrappers=yes
% content reporter %content/reporter/
% overlay chrome://browser/content/browser.xul chrome://reporter/content/reporterOverlay.xul
% overlay chrome://navigator/content/navigator.xul chrome://reporter/content/reporterOverlay.xul
% overlay chrome://global/content/customizeToolbar.xul chrome://reporter/content/reporterOverlay.xul

View File

@@ -274,14 +274,6 @@ CanAccessWrapper(JSContext *cx, JSObject *outerObj, JSObject *wrappedObj,
*privilegeEnabled = JS_FALSE;
}
// If we somehow end up being called from chrome, just allow full access.
// This can happen from components with xpcnativewrappers=no.
// Note that this is just an optimization to avoid getting the
// object principal in this case, since Subsumes() would return true.
if (isSystem) {
return NS_OK;
}
nsCOMPtr<nsIPrincipal> objectPrin;
rv = ssm->GetObjectPrincipal(cx, wrappedObj, getter_AddRefs(objectPrin));
if (NS_FAILED(rv)) {

View File

@@ -1,4 +1,4 @@
toolkit.jar:
% content xbl-marquee %content/xbl-marquee/ xpcnativewrappers=yes
% content xbl-marquee %content/xbl-marquee/
content/xbl-marquee/xbl-marquee.xml
content/xbl-marquee/xbl-marquee.css

View File

@@ -1,5 +1,5 @@
browser.jar:
% content branding %content/branding/ xpcnativewrappers=yes
% content branding %content/branding/
content/branding/about.png (about.png)
content/branding/aboutCredits.png (aboutCredits.png)
content/branding/aboutFooter.png (aboutFooter.png)

View File

@@ -1,5 +1,5 @@
pippki.jar:
% content pippki %content/pippki/ xpcnativewrappers=yes
% content pippki %content/pippki/
content/pippki/changepassword.xul (content/changepassword.xul)
content/pippki/getpassword.xul (content/getpassword.xul)
content/pippki/password.js (content/password.js)

View File

@@ -1,4 +1,4 @@
toolkit.jar:
% content cookie %content/cookie/ xpcnativewrappers=yes
% content cookie %content/cookie/
content/cookie/cookieAcceptDialog.xul (content/cookieAcceptDialog.xul)
* content/cookie/cookieAcceptDialog.js (content/cookieAcceptDialog.js)

View File

@@ -1,5 +1,5 @@
toolkit.jar:
% content help %content/help/ xpcnativewrappers=yes
% content help %content/help/
* content/help/help.xul (content/help.xul)
* content/help/contextHelp.js (content/contextHelp.js)
* content/help/help.js (content/help.js)

View File

@@ -1,5 +1,5 @@
toolkit.jar:
% content passwordmgr %content/passwordmgr/ xpcnativewrappers=yes
% content passwordmgr %content/passwordmgr/
* content/passwordmgr/passwordManager.xul (content/passwordManager.xul)
* content/passwordmgr/passwordManager.js (content/passwordManager.js)
* content/passwordmgr/passwordManagerExceptions.js (content/passwordManagerExceptions.js)

View File

@@ -1,7 +1,7 @@
toolkit.jar:
% content global %content/global/ xpcnativewrappers=yes contentaccessible=yes
% content global-platform %content/global-platform/ platform xpcnativewrappers=yes
% content global-region %content/global-region/ xpcnativewrappers=yes
% content global %content/global/ contentaccessible=yes
% content global-platform %content/global-platform/ platform
% content global-region %content/global-region/
# provide the nsTransferable in nsDragAndDrop.js to extensions that have to
# work with Geckos from before 1.9, when there was a separate file
% override chrome://global/content/nsTransferable.js chrome://global/content/nsDragAndDrop.js

View File

@@ -1,5 +1,5 @@
toolkit.jar:
% content mozapps %content/mozapps/ xpcnativewrappers=yes
% content mozapps %content/mozapps/
content/mozapps/extensions/extensions.xul (content/extensions.xul)
content/mozapps/extensions/extensions.css (content/extensions.css)
content/mozapps/extensions/extensions.js (content/extensions.js)

View File

@@ -1,5 +1,5 @@
toolkit.jar:
% content mozapps %content/mozapps/ xpcnativewrappers=yes
% content mozapps %content/mozapps/
* content/mozapps/downloads/helperApps.js (downloads/content/helperApps.js)
* content/mozapps/downloads/unknownContentType.xul (downloads/content/unknownContentType.xul)
* content/mozapps/downloads/downloads.xul (downloads/content/downloads.xul)

View File

@@ -1,5 +1,5 @@
toolkit.jar:
% content mozapps %content/mozapps/ xpcnativewrappers=yes
% content mozapps %content/mozapps/
* content/mozapps/update/history.xul (content/history.xul)
* content/mozapps/update/history.js (content/history.js)
content/mozapps/update/updates.css (content/updates.css)