Stop sharing DOM object wrappers between content and chrome, specifically reporter wallet mail pki browser communicator global b=281988 r=bsmedberg sr=bz a=asa

This commit is contained in:
neil%parkwaycc.co.uk 2005-05-23 08:34:02 +00:00
Родитель 3a2f3785c4
Коммит f5ac06642d
9 изменённых файлов: 51 добавлений и 22 удалений

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

@ -11,7 +11,8 @@
chrome:authorURL="http://reporter.mozilla.org/"
chrome:extension="true"
chrome:description="Broken Web Site Reporting Tool"
chrome:name="reporter">
chrome:name="reporter"
chrome:xpcNativeWrappers="true">
</RDF:Description>
<!-- overlay information -->
<RDF:Seq about="urn:mozilla:overlays">

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

@ -12,6 +12,7 @@
chrome:displayName="Form Manager"
chrome:author="mozilla.org"
chrome:name="wallet"
chrome:xpcNativeWrappers="true"
#expand chrome:localeVersion="__MOZILLA_LOCALE_VERSION__">
</RDF:Description>

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

@ -13,6 +13,7 @@
chrome:displayName="Messenger"
chrome:author="mozilla.org"
chrome:name="messenger"
chrome:xpcNativeWrappers="true"
#expand chrome:localeVersion="__MOZILLA_LOCALE_VERSION__"
#expand chrome:skinVersion="__MOZILLA_SKIN_VERSION__">
</RDF:Description>

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

@ -95,6 +95,7 @@
#include "nsNetCID.h"
#include "nsIJARURI.h"
#include "nsIFileURL.h"
#include "nsIXPConnect.h"
static char kChromePrefix[] = "chrome://";
nsIAtom* nsChromeRegistry::sCPrefix; // atom for "c"
@ -129,6 +130,7 @@ DEFINE_RDF_VOCAB(CHROME_URI, CHROME, skinVersion);
DEFINE_RDF_VOCAB(CHROME_URI, CHROME, localeVersion);
DEFINE_RDF_VOCAB(CHROME_URI, CHROME, packageVersion);
DEFINE_RDF_VOCAB(CHROME_URI, CHROME, disabled);
DEFINE_RDF_VOCAB(CHROME_URI, CHROME, xpcNativeWrappers);
////////////////////////////////////////////////////////////////////////////////
@ -216,6 +218,7 @@ nsChromeRegistry::Init()
{ "selectedLocale", nsnull },
{ "selectedSkin", nsnull },
{ "hasOverlays", nsnull },
{ "xpcNativeWrappers", nsnull },
{ "previewURL", nsnull },
};
@ -290,6 +293,10 @@ nsChromeRegistry::Init()
getter_AddRefs(mDisabled));
NS_ASSERTION(NS_SUCCEEDED(rv), "unable to get RDF resource");
rv = mRDFService->GetResource(nsDependentCString(kURICHROME_xpcNativeWrappers),
getter_AddRefs(mXPCNativeWrappers));
NS_ASSERTION(NS_SUCCEEDED(rv), "unable to get RDF resource");
nsCOMPtr<nsIObserverService> observerService =
do_GetService("@mozilla.org/observer-service;1", &rv);
if (observerService) {
@ -2920,7 +2927,42 @@ nsChromeRegistry::AddToCompositeDataSource(PRBool aUseProfile)
// Always load the install dir datasources
LoadDataSource(kChromeFileName, getter_AddRefs(mInstallDirChromeDataSource), PR_FALSE, nsnull);
mChromeDataSource->AddDataSource(mInstallDirChromeDataSource);
// List all packages that want XPC native wrappers
nsCOMPtr<nsIXPConnect> xpc(do_GetService("@mozilla.org/js/xpc/XPConnect;1", &rv));
NS_ENSURE_SUCCESS(rv, rv);
nsCOMPtr<nsISimpleEnumerator> arcs;
nsCOMPtr<nsIRDFLiteral> trueLiteral;
mRDFService->GetLiteral(NS_LITERAL_STRING("true").get(), getter_AddRefs(trueLiteral));
rv = mChromeDataSource->GetSources(mXPCNativeWrappers, trueLiteral, PR_TRUE,
getter_AddRefs(arcs));
if (NS_FAILED(rv)) return rv;
nsCAutoString uri;
PRBool more;
rv = arcs->HasMoreElements(&more);
if (NS_FAILED(rv)) return rv;
while (more) {
nsCOMPtr<nsISupports> supp;
rv = arcs->GetNext(getter_AddRefs(supp));
if (NS_FAILED(rv)) return rv;
nsCOMPtr<nsIRDFResource> package(do_QueryInterface(supp));
if (package) {
const char urn[] = "urn:mozilla:package:";
const char* source;
package->GetValueConst(&source);
if (!memcmp(source, urn, sizeof urn - 1)) {
uri.AssignLiteral("chrome://");
uri.Append(source + sizeof urn - 1);
uri.Append('/');
rv = xpc->FlagSystemFilenamePrefix(uri.get());
NS_ENSURE_SUCCESS(rv, rv);
}
}
rv = arcs->HasMoreElements(&more);
if (NS_FAILED(rv)) return rv;
}
return NS_OK;
}

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

@ -255,6 +255,7 @@ protected:
nsCOMPtr<nsIRDFResource> mLocaleVersion;
nsCOMPtr<nsIRDFResource> mPackageVersion;
nsCOMPtr<nsIRDFResource> mDisabled;
nsCOMPtr<nsIRDFResource> mXPCNativeWrappers;
nsCOMPtr<nsIZipReader> mOverrideJAR;
nsCString mOverrideJARURL;

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

@ -49,6 +49,7 @@
chrome:displayName="pippki"
chrome:author="PSM Team"
chrome:name="pippki"
chrome:xpcNativeWrappers="true"
#expand chrome:localeVersion="__MOZILLA_LOCALE_VERSION__">
</RDF:Description>

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

@ -1,20 +0,0 @@
<?xml version="1.0"?>
<RDF:RDF xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:chrome="http://www.mozilla.org/rdf/chrome#">
<!-- list all the packages being supplied by this jar -->
<RDF:Seq about="urn:mozilla:package:root">
<RDF:li resource="urn:mozilla:package:navigator"/>
</RDF:Seq>
<!-- package information -->
<RDF:Description about="urn:mozilla:package:navigator"
chrome:displayName="Navigator"
chrome:author="mozilla.org"
chrome:name="navigator"
#expand chrome:localeVersion="__MOZILLA_LOCALE_VERSION__"
#expand chrome:skinVersion="__MOZILLA_SKIN_VERSION__">
</RDF:Description>
</RDF:RDF>

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

@ -12,6 +12,7 @@
chrome:displayName="Communicator Shared"
chrome:author="mozilla.org"
chrome:name="communicator"
chrome:xpcNativeWrappers="true"
#expand chrome:localeVersion="__MOZILLA_LOCALE_VERSION__"
#expand chrome:skinVersion="__MOZILLA_SKIN_VERSION__">
</RDF:Description>

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

@ -12,6 +12,7 @@
chrome:displayName="Toolkit"
chrome:author="mozilla.org"
chrome:name="global"
chrome:xpcNativeWrappers="true"
#expand chrome:localeVersion="__MOZILLA_LOCALE_VERSION__"
#expand chrome:skinVersion="__MOZILLA_SKIN_VERSION__">
</RDF:Description>