[xulrunner/f15] Update to 5.0
Martin Stransky
stransky at fedoraproject.org
Tue Jun 21 13:40:56 UTC 2011
commit eb1d55c5818402ddf5c0629be551c82733af8c63
Author: Martin Stransky <stransky at redhat.com>
Date: Tue Jun 21 15:40:38 2011 +0200
Update to 5.0
.gitignore | 1 +
sources | 2 +-
xulrunner-2.0-64bit-big-endian.patch | 13 -
xulrunner-2.0-network-link-service.patch | 171 +---
xulrunner-mozconfig | 2 +
...nner-omnijar.patch => xulrunner-omnijar-5.patch | 1097 ++++++--------------
xulrunner.spec | 31 +-
7 files changed, 388 insertions(+), 929 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index 4408487..f3b6562 100644
--- a/.gitignore
+++ b/.gitignore
@@ -13,3 +13,4 @@ xulrunner-1.9.3.0b3.source.tar.bz2
/xulrunner-2.0rc2.source.tar.bz2
/xulrunner-2.0.source.tar.bz2
/xulrunner-2.0.1.source.tar.bz2
+/xulrunner-5.0.source.tar.bz2
diff --git a/sources b/sources
index 17631ad..8dd1d26 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-9abda7d23151e97913c8555a64c13f34 xulrunner-2.0.1.source.tar.bz2
+9f64a01e86a5d424e12a8e3305c5debe xulrunner-5.0.source.tar.bz2
diff --git a/xulrunner-2.0-network-link-service.patch b/xulrunner-2.0-network-link-service.patch
index bdd1e2f..2199d83 100644
--- a/xulrunner-2.0-network-link-service.patch
+++ b/xulrunner-2.0-network-link-service.patch
@@ -1,14 +1,7 @@
-https://bugzilla.mozilla.org/show_bug.cgi?id=627672
-
-diff -p -U8 mozilla-2.0/netwerk/base/src/nsIOService.cpp.network-link-service mozilla-2.0/netwerk/base/src/nsIOService.cpp
---- mozilla-2.0/netwerk/base/src/nsIOService.cpp.network-link-service 2011-03-18 16:34:03.000000000 -0700
-+++ mozilla-2.0/netwerk/base/src/nsIOService.cpp 2011-04-03 21:40:34.787142329 -0700
-@@ -160,31 +160,33 @@ PRInt16 gBadPortList[] = {
- 2049, // nfs
- 4045, // lockd
- 6000, // x11
- 0, // This MUST be zero so that we can populating the array
- };
+diff -up xulrunner-5.0/mozilla-release/netwerk/base/src/nsIOService.cpp.network-link-service xulrunner-5.0/mozilla-release/netwerk/base/src/nsIOService.cpp
+--- xulrunner-5.0/mozilla-release/netwerk/base/src/nsIOService.cpp.network-link-service 2011-06-15 23:57:41.000000000 +0200
++++ xulrunner-5.0/mozilla-release/netwerk/base/src/nsIOService.cpp 2011-06-21 14:04:16.798060709 +0200
+@@ -165,6 +165,7 @@ PRInt16 gBadPortList[] = {
static const char kProfileChangeNetTeardownTopic[] = "profile-change-net-teardown";
static const char kProfileChangeNetRestoreTopic[] = "profile-change-net-restore";
@@ -16,15 +9,7 @@ diff -p -U8 mozilla-2.0/netwerk/base/src/nsIOService.cpp.network-link-service mo
// Necko buffer cache
nsIMemory* nsIOService::gBufferCache = nsnull;
- PRUint32 nsIOService::gDefaultSegmentSize = 4096;
- PRUint32 nsIOService::gDefaultSegmentCount = 24;
-
- ////////////////////////////////////////////////////////////////////////////////
-
- nsIOService::nsIOService()
- : mOffline(PR_TRUE)
- , mOfflineForProfileChange(PR_FALSE)
- , mManageOfflineStatus(PR_TRUE)
+@@ -180,6 +181,7 @@ nsIOService::nsIOService()
, mSettingOffline(PR_FALSE)
, mSetOfflineValue(PR_FALSE)
, mShutdown(PR_FALSE)
@@ -32,17 +17,7 @@ diff -p -U8 mozilla-2.0/netwerk/base/src/nsIOService.cpp.network-link-service mo
, mChannelEventSinks(NS_CHANNEL_EVENT_SINK_CATEGORY)
, mContentSniffers(NS_CONTENT_SNIFFER_CATEGORY)
{
- }
-
- nsresult
- nsIOService::Init()
- {
-@@ -229,16 +231,17 @@ nsIOService::Init()
- }
-
- // Register for profile change notifications
- nsCOMPtr<nsIObserverService> observerService =
- mozilla::services::GetObserverService();
+@@ -234,6 +236,7 @@ nsIOService::Init()
if (observerService) {
observerService->AddObserver(this, kProfileChangeNetTeardownTopic, PR_TRUE);
observerService->AddObserver(this, kProfileChangeNetRestoreTopic, PR_TRUE);
@@ -50,29 +25,14 @@ diff -p -U8 mozilla-2.0/netwerk/base/src/nsIOService.cpp.network-link-service mo
observerService->AddObserver(this, NS_XPCOM_SHUTDOWN_OBSERVER_ID, PR_TRUE);
observerService->AddObserver(this, NS_NETWORK_LINK_TOPIC, PR_TRUE);
}
- else
- NS_WARNING("failed to get observer service");
-
- NS_TIME_FUNCTION_MARK("Registered observers");
-
-@@ -257,32 +260,20 @@ nsIOService::Init()
- NS_WARN_IF_FALSE(NS_SUCCEEDED(rv), "Was unable to allocate. No gBufferCache.");
- CallQueryInterface(recyclingAllocator, &gBufferCache);
- }
-
- NS_TIME_FUNCTION_MARK("Set up the recycling allocator");
+@@ -262,19 +265,9 @@ nsIOService::Init()
gIOService = this;
--#ifdef MOZ_IPC
- // go into managed mode if we can, and chrome process
- if (XRE_GetProcessType() == GeckoProcessType_Default)
--#endif
- mNetworkLinkService = do_GetService(NS_NETWORK_LINK_SERVICE_CONTRACTID);
-+ // We can't really determine if the machine has a usable network connection,
-+ // (mNetworkLinkService will be initialized later) so let's cross our fingers!
-+ SetOffline(PR_FALSE);
-
+-
- if (!mNetworkLinkService)
- // We can't really determine if the machine has a usable network connection,
- // so let's cross our fingers!
@@ -82,21 +42,13 @@ diff -p -U8 mozilla-2.0/netwerk/base/src/nsIOService.cpp.network-link-service mo
- TrackNetworkLinkStatusForOffline();
- else
- SetOffline(PR_FALSE);
--
++ // We can't really determine if the machine has a usable network connection,
++ // (mNetworkLinkService will be initialized later) so let's cross our fingers!
++ SetOffline(PR_FALSE);
+
NS_TIME_FUNCTION_MARK("Set up network link service");
- return NS_OK;
- }
-
-
- nsIOService::~nsIOService()
- {
-@@ -306,16 +293,54 @@ nsIOService::InitializeSocketTransportSe
- if (mSocketTransportService) {
- rv = mSocketTransportService->Init();
- NS_ASSERTION(NS_SUCCEEDED(rv), "socket transport service init failed");
- }
-
+@@ -309,6 +302,47 @@ nsIOService::InitializeSocketTransportSe
return rv;
}
@@ -110,10 +62,12 @@ diff -p -U8 mozilla-2.0/netwerk/base/src/nsIOService.cpp.network-link-service mo
+ if (mNetworkLinkServiceInitialized)
+ return rv;
+
-+#ifdef MOZ_IPC
++#if defined(MOZ_PLATFORM_MAEMO)
++ // libdbusservice fails to initialize on Maemo platform, see Bug 627672
++ mNetworkLinkService = NULL;
++#else
+ // go into managed mode if we can, and chrome process
+ if (XRE_GetProcessType() == GeckoProcessType_Default)
-+#endif
+ {
+ mNetworkLinkService = do_GetService(NS_NETWORK_LINK_SERVICE_CONTRACTID, &rv);
+ if (NS_FAILED(rv)) {
@@ -121,7 +75,8 @@ diff -p -U8 mozilla-2.0/netwerk/base/src/nsIOService.cpp.network-link-service mo
+ return rv;
+ }
+ }
-+
++#endif
++
+ mNetworkLinkServiceInitialized = PR_TRUE;
+
+ if (!mNetworkLinkService) {
@@ -141,17 +96,7 @@ diff -p -U8 mozilla-2.0/netwerk/base/src/nsIOService.cpp.network-link-service mo
nsIOService*
nsIOService::GetInstance() {
if (!gIOService) {
- gIOService = new nsIOService();
- if (!gIOService)
- return nsnull;
- NS_ADDREF(gIOService);
-
-@@ -658,16 +683,19 @@ nsIOService::NewChannel(const nsACString
- if (NS_FAILED(rv)) return rv;
-
- return NewChannelFromURI(uri, result);
- }
-
+@@ -682,6 +716,9 @@ nsIOService::NewChannel(const nsACString
PRBool
nsIOService::IsLinkUp()
{
@@ -161,17 +106,7 @@ diff -p -U8 mozilla-2.0/netwerk/base/src/nsIOService.cpp.network-link-service mo
if (!mNetworkLinkService) {
// We cannot decide, assume the link is up
return PR_TRUE;
- }
-
- PRBool isLinkUp;
- nsresult rv;
- rv = mNetworkLinkService->GetIsLinkUp(&isLinkUp);
-@@ -938,16 +966,20 @@ nsIOService::Observe(nsISupports *subjec
- if (mOfflineForProfileChange) {
- mOfflineForProfileChange = PR_FALSE;
- if (!mManageOfflineStatus ||
- NS_FAILED(TrackNetworkLinkStatusForOffline())) {
- SetOffline(PR_FALSE);
+@@ -960,6 +997,10 @@ nsIOService::Observe(nsISupports *subjec
}
}
}
@@ -182,40 +117,19 @@ diff -p -U8 mozilla-2.0/netwerk/base/src/nsIOService.cpp.network-link-service mo
else if (!strcmp(topic, NS_XPCOM_SHUTDOWN_OBSERVER_ID)) {
// Remember we passed XPCOM shutdown notification to prevent any
// changes of the offline status from now. We must not allow going
- // online after this point.
- mShutdown = PR_TRUE;
-
- SetOffline(PR_TRUE);
-
-@@ -1055,32 +1087,42 @@ nsIOService::NewSimpleNestedURI(nsIURI*
- NS_IF_ADDREF(*aResult = new nsSimpleNestedURI(safeURI));
- return *aResult ? NS_OK : NS_ERROR_OUT_OF_MEMORY;
- }
-
- NS_IMETHODIMP
+@@ -1077,6 +1118,11 @@ NS_IMETHODIMP
nsIOService::SetManageOfflineStatus(PRBool aManage) {
PRBool wasManaged = mManageOfflineStatus;
mManageOfflineStatus = aManage;
+
+ if (!mNetworkLinkServiceInitialized) {
-+ nsresult rv = InitializeNetworkLinkService();
-+ if (NS_FAILED(rv))
-+ return rv;
++ InitializeNetworkLinkService();
+ }
-+
++
if (mManageOfflineStatus && !wasManaged)
return TrackNetworkLinkStatusForOffline();
return NS_OK;
- }
-
- NS_IMETHODIMP
- nsIOService::GetManageOfflineStatus(PRBool* aManage) {
- *aManage = mManageOfflineStatus;
- return NS_OK;
- }
-
- nsresult
- nsIOService::TrackNetworkLinkStatusForOffline()
+@@ -1093,6 +1139,9 @@ nsIOService::TrackNetworkLinkStatusForOf
{
NS_ASSERTION(mManageOfflineStatus,
"Don't call this unless we're managing the offline status");
@@ -225,20 +139,10 @@ diff -p -U8 mozilla-2.0/netwerk/base/src/nsIOService.cpp.network-link-service mo
if (!mNetworkLinkService)
return NS_ERROR_FAILURE;
- if (mShutdown)
- return NS_ERROR_NOT_AVAILABLE;
-
- // check to make sure this won't collide with Autodial
- if (mSocketTransportService) {
-diff -p -U8 mozilla-2.0/netwerk/base/src/nsIOService.h.network-link-service mozilla-2.0/netwerk/base/src/nsIOService.h
---- mozilla-2.0/netwerk/base/src/nsIOService.h.network-link-service 2011-03-18 16:34:03.000000000 -0700
-+++ mozilla-2.0/netwerk/base/src/nsIOService.h 2011-04-03 21:34:34.608645179 -0700
-@@ -129,16 +129,17 @@ private:
- nsIProtocolHandler* hdlr);
-
- // Prefs wrangling
- NS_HIDDEN_(void) PrefsChanged(nsIPrefBranch *prefs, const char *pref = nsnull);
- NS_HIDDEN_(void) GetPrefBranch(nsIPrefBranch2 **);
+diff -up xulrunner-5.0/mozilla-release/netwerk/base/src/nsIOService.h.network-link-service xulrunner-5.0/mozilla-release/netwerk/base/src/nsIOService.h
+--- xulrunner-5.0/mozilla-release/netwerk/base/src/nsIOService.h.network-link-service 2011-06-15 23:57:41.000000000 +0200
++++ xulrunner-5.0/mozilla-release/netwerk/base/src/nsIOService.h 2011-06-21 13:59:23.147215108 +0200
+@@ -134,6 +134,7 @@ private:
NS_HIDDEN_(void) ParsePortList(nsIPrefBranch *prefBranch, const char *pref, PRBool remove);
nsresult InitializeSocketTransportService();
@@ -246,17 +150,7 @@ diff -p -U8 mozilla-2.0/netwerk/base/src/nsIOService.h.network-link-service mozi
private:
PRPackedBool mOffline;
- PRPackedBool mOfflineForProfileChange;
- PRPackedBool mManageOfflineStatus;
-
- // Used to handle SetOffline() reentrancy. See the comment in
- // SetOffline() for more details.
-@@ -146,16 +147,17 @@ private:
- PRPackedBool mSetOfflineValue;
-
- PRPackedBool mShutdown;
-
- nsCOMPtr<nsPISocketTransportService> mSocketTransportService;
+@@ -151,6 +152,7 @@ private:
nsCOMPtr<nsPIDNSService> mDNSService;
nsCOMPtr<nsIProtocolProxyService2> mProxyService;
nsCOMPtr<nsINetworkLinkService> mNetworkLinkService;
@@ -264,8 +158,3 @@ diff -p -U8 mozilla-2.0/netwerk/base/src/nsIOService.h.network-link-service mozi
// Cached protocol handlers
nsWeakPtr mWeakHandler[NS_N(gScheme)];
-
- // cached categories
- nsCategoryCache<nsIChannelEventSink> mChannelEventSinks;
- nsCategoryCache<nsIContentSniffer> mContentSniffers;
-
diff --git a/xulrunner-mozconfig b/xulrunner-mozconfig
index 073dabd..9391b82 100644
--- a/xulrunner-mozconfig
+++ b/xulrunner-mozconfig
@@ -37,6 +37,8 @@ ac_add_options --enable-shared-js
ac_add_options --enable-url-classifier
ac_add_options --enable-gio
ac_add_options --disable-gnomevfs
+ac_add_options --disable-updater
+ac_add_options --enable-chrome-format=omni
export BUILD_OFFICIAL=1
export MOZILLA_OFFICIAL=1
diff --git a/xulrunner-omnijar.patch b/xulrunner-omnijar-5.patch
similarity index 67%
rename from xulrunner-omnijar.patch
rename to xulrunner-omnijar-5.patch
index 66ec520..f214e8d 100644
--- a/xulrunner-omnijar.patch
+++ b/xulrunner-omnijar-5.patch
@@ -1,107 +1,7 @@
-# HG changeset patch
-# Parent a7dea879b4b445a23186f438900562155bb39e99
-Bug 620931 part 1 - Use chrome manifest to register resource://gre-resources/
-
-diff --git a/layout/style/jar.mn b/layout/style/jar.mn
---- a/layout/style/jar.mn
-+++ b/layout/style/jar.mn
-@@ -1,8 +1,10 @@
- toolkit.jar:
- * res/ua.css (ua.css)
- res/html.css (html.css)
- res/quirk.css (quirk.css)
- res/viewsource.css (viewsource.css)
- * res/forms.css (forms.css)
- res/arrow.gif (arrow.gif)
- res/arrowd.gif (arrowd.gif)
-+
-+% resource gre-resources %res/
-diff --git a/netwerk/protocol/res/nsResProtocolHandler.cpp b/netwerk/protocol/res/nsResProtocolHandler.cpp
---- a/netwerk/protocol/res/nsResProtocolHandler.cpp
-+++ b/netwerk/protocol/res/nsResProtocolHandler.cpp
-@@ -75,17 +75,16 @@ static nsResProtocolHandler *gResHandler
- //
- // this enables PR_LOG_ALWAYS level information and places all output in
- // the file log.txt
- //
- static PRLogModuleInfo *gResLog;
- #endif
-
- #define kGRE NS_LITERAL_CSTRING("gre")
--#define kGRE_RESOURCES NS_LITERAL_CSTRING("gre-resources")
-
- //----------------------------------------------------------------------------
- // nsResURL : overrides nsStandardURL::GetFile to provide nsIFile resolution
- //----------------------------------------------------------------------------
-
- nsresult
- nsResURL::EnsureFile()
- {
-@@ -197,28 +196,16 @@ nsResProtocolHandler::Init()
- NS_ENSURE_SUCCESS(rv, rv);
-
- //
- // make resource://gre/ point to the GRE directory
- //
- rv = AddSpecialDir(NS_GRE_DIR, kGRE);
- NS_ENSURE_SUCCESS(rv, rv);
-
-- // make resource://gre-resources/ point to gre toolkit[.jar]/res
-- nsCOMPtr<nsIURI> greURI;
-- nsCOMPtr<nsIURI> greResURI;
-- GetSubstitution(kGRE, getter_AddRefs(greURI));
--#ifdef MOZ_CHROME_FILE_FORMAT_JAR
-- NS_NAMED_LITERAL_CSTRING(strGRE_RES_URL, "jar:chrome/toolkit.jar!/res/");
--#else
-- NS_NAMED_LITERAL_CSTRING(strGRE_RES_URL, "chrome/toolkit/res/");
--#endif
-- rv = mIOService->NewURI(strGRE_RES_URL, nsnull, greURI,
-- getter_AddRefs(greResURI));
-- SetSubstitution(kGRE_RESOURCES, greResURI);
- //XXXbsmedberg Neil wants a resource://pchrome/ for the profile chrome dir...
- // but once I finish multiple chrome registration I'm not sure that it is needed
-
- // XXX dveditz: resource://pchrome/ defeats profile directory salting
- // if web content can load it. Tread carefully.
-
- return rv;
- }
-@@ -242,22 +229,16 @@ nsResProtocolHandler::Init(nsIFile *aOmn
- // these entries should be kept in sync with the normal Init function
-
- // resource:/// points to jar:omni.jar!/
- SetSubstitution(EmptyCString(), uri);
-
- // resource://gre/ points to jar:omni.jar!/
- SetSubstitution(kGRE, uri);
-
-- urlStr += "chrome/toolkit/res/";
-- rv = mIOService->NewURI(urlStr, nsnull, nsnull, getter_AddRefs(uri));
-- NS_ENSURE_SUCCESS(rv, rv);
--
-- // resource://gre-resources/ points to jar:omni.jar!/chrome/toolkit/res/
-- SetSubstitution(kGRE_RESOURCES, uri);
- return NS_OK;
- }
- #endif
-
- #ifdef MOZ_IPC
- static PLDHashOperator
- EnumerateSubstitution(const nsACString& aKey,
- nsIURI* aURI,
-# HG changeset patch
-# Parent 3038cccba1a071d6b418e15442d0f2d9f3dcb11d
-Bug 620931 part 2 - When building --with-libxul-sdk, use the right preferences directory
-
-diff --git a/browser/locales/Makefile.in b/browser/locales/Makefile.in
---- a/browser/locales/Makefile.in
-+++ b/browser/locales/Makefile.in
-@@ -183,17 +183,17 @@ install:: $(addsuffix .xml,$(SEARCH_PLUG
- $(SYSINSTALL) $(IFLAGS1) $^ $(DESTDIR)$(mozappdir)/searchplugins
-
-
- libs-%:
- $(NSINSTALL) -D $(DIST)/install
+diff -up xulrunner-5.0/mozilla-release/browser/locales/Makefile.in.omnijar xulrunner-5.0/mozilla-release/browser/locales/Makefile.in
+--- xulrunner-5.0/mozilla-release/browser/locales/Makefile.in.omnijar 2011-06-15 23:57:18.000000000 +0200
++++ xulrunner-5.0/mozilla-release/browser/locales/Makefile.in 2011-06-21 13:16:56.434904620 +0200
+@@ -186,7 +186,7 @@ libs-%:
@$(MAKE) -C ../../toolkit/locales libs-$* BOTH_MANIFESTS=1
@$(MAKE) -C ../../services/sync/locales AB_CD=$* XPI_NAME=locale-$* BOTH_MANIFESTS=1
@$(MAKE) -C ../../extensions/spellcheck/locales AB_CD=$* XPI_NAME=locale-$* BOTH_MANIFESTS=1
@@ -110,65 +10,10 @@ diff --git a/browser/locales/Makefile.in b/browser/locales/Makefile.in
@$(MAKE) -C $(DEPTH)/$(MOZ_BRANDING_DIRECTORY)/locales AB_CD=$* XPI_NAME=locale-$* BOTH_MANIFESTS=1
- repackage-win32-installer: WIN32_INSTALLER_OUT="$(_ABS_DIST)/$(PKG_INST_PATH)$(PKG_INST_BASENAME).exe"
- repackage-win32-installer: $(WIN32_INSTALLER_IN) $(SUBMAKEFILES)
- @echo "Repackaging $(WIN32_INSTALLER_IN) into $(WIN32_INSTALLER_OUT)."
- $(MAKE) -C $(DEPTH)/$(MOZ_BRANDING_DIRECTORY) export
- $(MAKE) -C ../installer/windows CONFIG_DIR=l10ngen l10ngen/setup.exe l10ngen/7zSD.sfx
-diff --git a/toolkit/mozapps/installer/packager.mk b/toolkit/mozapps/installer/packager.mk
---- a/toolkit/mozapps/installer/packager.mk
-+++ b/toolkit/mozapps/installer/packager.mk
-@@ -307,17 +307,17 @@ OMNIJAR_FILES = \
- res \
- defaults \
- greprefs.js \
- jsloader \
- $(NULL)
-
- NON_OMNIJAR_FILES += \
- chrome/icons/\* \
-- defaults/pref/channel-prefs.js \
-+ $(PREF_DIR)/channel-prefs.js \
- res/cursors/\* \
- res/MainMenu.nib/\* \
- $(NULL)
-
- PACK_OMNIJAR = \
- rm -f omni.jar components/binary.manifest && \
- grep -h '^binary-component' components/*.manifest > binary.manifest ; \
- sed -e 's/^binary-component/\#binary-component/' components/components.manifest > components.manifest && \
-# HG changeset patch
-# Parent cd8df8030f7ad7530692bd7c4391a8009df56a02
-Bug 620931 part 3 - Allow GRE and XUL application to use omni.jar independently
-
-We now store two independent locations for an omni.jar, allowing GRE/XRE and
-XUL application to each have their own omni.jar. And since xulrunner setups
-are very independent from the XUL applications, we implement support for both
-omni.jar and non omni.jar cases in the same runtime, with the side effect of
-allowing to switch from one to the other manually without rebuilding the
-binaries.
-
-We let the mozilla::Omnijar API handle both cases, so that callers don't need
-too much work to support them.
-
-We also make the preferences service load the same set of preferences in all
-the various cases (unified vs. separate, omni.jar vs. no omni.jar).
-
-The child process launcher for IPC is modified to pass the base directories
-needed for the mozilla::Omnijar API initialization in the child process.
-
-Finally, the startupcache file name canonicalization is modified to separate
-APP and GRE resources.
-
-diff --git a/ipc/glue/GeckoChildProcessHost.cpp b/ipc/glue/GeckoChildProcessHost.cpp
---- a/ipc/glue/GeckoChildProcessHost.cpp
-+++ b/ipc/glue/GeckoChildProcessHost.cpp
-@@ -440,26 +440,29 @@ GeckoChildProcessHost::PerformAsyncLaunc
- // other end of the socketpair() from us
-
- std::vector<std::string> childArgv;
-
- childArgv.push_back(exePath.value());
+diff -up xulrunner-5.0/mozilla-release/ipc/glue/GeckoChildProcessHost.cpp.omnijar xulrunner-5.0/mozilla-release/ipc/glue/GeckoChildProcessHost.cpp
+--- xulrunner-5.0/mozilla-release/ipc/glue/GeckoChildProcessHost.cpp.omnijar 2011-06-15 23:57:27.000000000 +0200
++++ xulrunner-5.0/mozilla-release/ipc/glue/GeckoChildProcessHost.cpp 2011-06-21 12:46:33.537167186 +0200
+@@ -492,16 +492,19 @@ GeckoChildProcessHost::PerformAsyncLaunc
childArgv.insert(childArgv.end(), aExtraOpts.begin(), aExtraOpts.end());
@@ -185,27 +30,17 @@ diff --git a/ipc/glue/GeckoChildProcessHost.cpp b/ipc/glue/GeckoChildProcessHost
+ if (file && NS_SUCCEEDED(file->GetNativePath(path))) {
+ childArgv.push_back("-grebase");
+ childArgv.push_back(path.get());
- }
--#endif
++ }
+ file = mozilla::Omnijar::GetBase(mozilla::Omnijar::APP);
+ if (file && NS_SUCCEEDED(file->GetNativePath(path))) {
+ childArgv.push_back("-appbase");
+ childArgv.push_back(path.get());
-+ }
+ }
+-#endif
childArgv.push_back(pidstring);
- #if defined(MOZ_CRASHREPORTER)
- # if defined(OS_LINUX)
- int childCrashFd, childCrashRemapFd;
- if (!CrashReporter::CreateNotificationPipeForChild(
- &childCrashFd, &childCrashRemapFd))
-@@ -552,26 +555,29 @@ GeckoChildProcessHost::PerformAsyncLaunc
- for (std::vector<std::string>::iterator it = aExtraOpts.begin();
- it != aExtraOpts.end();
- ++it) {
- cmdLine.AppendLooseValue(UTF8ToWide(*it));
- }
+@@ -604,16 +607,19 @@ GeckoChildProcessHost::PerformAsyncLaunc
cmdLine.AppendLooseValue(std::wstring(mGroupId.get()));
@@ -222,30 +57,20 @@ diff --git a/ipc/glue/GeckoChildProcessHost.cpp b/ipc/glue/GeckoChildProcessHost
+ if (file && NS_SUCCEEDED(file->GetPath(path))) {
+ cmdLine.AppendLooseValue(UTF8ToWide("-grebase"));
+ cmdLine.AppendLooseValue(path.get());
- }
--#endif
++ }
+ file = mozilla::Omnijar::GetBase(mozilla::Omnijar::APP);
+ if (file && NS_SUCCEEDED(file->GetPath(path))) {
+ cmdLine.AppendLooseValue(UTF8ToWide("-appbase"));
+ cmdLine.AppendLooseValue(path.get());
-+ }
+ }
+-#endif
cmdLine.AppendLooseValue(UTF8ToWide(pidstring));
- #if defined(MOZ_CRASHREPORTER)
- cmdLine.AppendLooseValue(
- UTF8ToWide(CrashReporter::GetChildNotificationPipe()));
- #endif
-
-diff --git a/js/src/xpconnect/loader/mozJSComponentLoader.cpp b/js/src/xpconnect/loader/mozJSComponentLoader.cpp
---- a/js/src/xpconnect/loader/mozJSComponentLoader.cpp
-+++ b/js/src/xpconnect/loader/mozJSComponentLoader.cpp
-@@ -81,16 +81,17 @@
- #include "nsIConsoleService.h"
- #include "nsIStorageStream.h"
- #include "nsIStringStream.h"
- #include "prmem.h"
- #if defined(XP_WIN)
+diff -up xulrunner-5.0/mozilla-release/js/src/xpconnect/loader/mozJSComponentLoader.cpp.omnijar xulrunner-5.0/mozilla-release/js/src/xpconnect/loader/mozJSComponentLoader.cpp
+--- xulrunner-5.0/mozilla-release/js/src/xpconnect/loader/mozJSComponentLoader.cpp.omnijar 2011-06-15 23:57:31.000000000 +0200
++++ xulrunner-5.0/mozilla-release/js/src/xpconnect/loader/mozJSComponentLoader.cpp 2011-06-21 13:34:03.057293901 +0200
+@@ -86,6 +86,7 @@
#include "nsILocalFileWin.h"
#endif
#include "xpcprivate.h"
@@ -253,17 +78,7 @@ diff --git a/js/src/xpconnect/loader/mozJSComponentLoader.cpp b/js/src/xpconnect
#ifdef MOZ_ENABLE_LIBXUL
#include "mozilla/scache/StartupCache.h"
- #include "mozilla/scache/StartupCacheUtils.h"
- #endif
- #include "mozilla/Omnijar.h"
-
- #include "jsdbgapi.h"
-@@ -621,34 +622,21 @@ mozJSComponentLoader::LoadModule(nsILoca
-
- const mozilla::Module*
- mozJSComponentLoader::LoadModuleFromJAR(nsILocalFile *aJarFile,
- const nsACString &aComponentPath)
- {
+@@ -626,24 +627,11 @@ mozJSComponentLoader::LoadModuleFromJAR(
#if !defined(XPCONNECT_STANDALONE)
nsresult rv;
@@ -293,18 +108,8 @@ diff --git a/js/src/xpconnect/loader/mozJSComponentLoader.cpp b/js/src/xpconnect
fullSpec += aComponentPath;
nsCOMPtr<nsIURI> uri;
- rv = NS_NewURI(getter_AddRefs(uri), fullSpec);
- if (NS_FAILED(rv))
- return NULL;
-
- nsAutoString hashstring;
-@@ -833,57 +821,138 @@ class JSScriptHolder
- JSScriptHolder(JSContext *cx, JSScript *script)
- : mCx(cx), mScript(script) {}
- ~JSScriptHolder() { ::JS_DestroyScript(mCx, mScript); }
- private:
- JSContext *mCx;
- JSScript *mScript;
+@@ -827,47 +815,129 @@ class JSPrincipalsHolder
+ JSPrincipals *mPrincipals;
};
+static const char baseName[2][5] = { "gre/", "app/" };
@@ -326,6 +131,7 @@ diff --git a/js/src/xpconnect/loader/mozJSComponentLoader.cpp b/js/src/xpconnect
+ out.Append(Substring(spec, base.Length()));
+ return PR_TRUE;
+}
++
/**
* PathifyURI transforms mozilla .js uris into useful zip paths
* to make it makes it easier to manipulate startup cache entries
@@ -386,61 +192,61 @@ diff --git a/js/src/xpconnect/loader/mozJSComponentLoader.cpp b/js/src/xpconnect
+ nsresult rv;
+ nsCOMPtr<nsIURI> uri = in;
+ nsCAutoString spec;
-+
++
+ out = "jsloader";
-+
++
+ // Resolve resource:// URIs. At the end of this if/else block, we
+ // have both spec and uri variables identifying the same URI.
+ if (NS_SUCCEEDED(in->SchemeIs("resource", &equals)) && equals) {
+ nsCOMPtr<nsIIOService> ioService = do_GetIOService(&rv);
+ NS_ENSURE_SUCCESS(rv, rv);
-+
++
+ nsCOMPtr<nsIProtocolHandler> ph;
+ rv = ioService->GetProtocolHandler("resource", getter_AddRefs(ph));
+ NS_ENSURE_SUCCESS(rv, rv);
-+
++
+ nsCOMPtr<nsIResProtocolHandler> irph(do_QueryInterface(ph, &rv));
+ NS_ENSURE_SUCCESS(rv, rv);
-+
++
+ rv = irph->ResolveURI(in, spec);
+ NS_ENSURE_SUCCESS(rv, rv);
-+
++
+ rv = ioService->NewURI(spec, nsnull, nsnull, getter_AddRefs(uri));
+ NS_ENSURE_SUCCESS(rv, rv);
+ } else {
+ rv = in->GetSpec(spec);
+ NS_ENSURE_SUCCESS(rv, rv);
+ }
-+
++
+ if (!canonicalizeBase(spec, out, mozilla::Omnijar::GRE) &&
+ !canonicalizeBase(spec, out, mozilla::Omnijar::APP)) {
+ if (NS_SUCCEEDED(uri->SchemeIs("file", &equals)) && equals) {
+ nsCOMPtr<nsIFileURL> baseFileURL;
+ baseFileURL = do_QueryInterface(uri, &rv);
+ NS_ENSURE_SUCCESS(rv, rv);
-+
++
+ nsCAutoString path;
+ rv = baseFileURL->GetPath(path);
+ NS_ENSURE_SUCCESS(rv, rv);
-+
++
+ out.Append(path);
+ } else if (NS_SUCCEEDED(uri->SchemeIs("jar", &equals)) && equals) {
+ nsCOMPtr<nsIJARURI> jarURI = do_QueryInterface(uri, &rv);
+ NS_ENSURE_SUCCESS(rv, rv);
-+
++
+ nsCOMPtr<nsIURI> jarFileURI;
+ rv = jarURI->GetJARFile(getter_AddRefs(jarFileURI));
+ NS_ENSURE_SUCCESS(rv, rv);
-+
++
+ nsCOMPtr<nsIFileURL> jarFileURL;
+ jarFileURL = do_QueryInterface(jarFileURI, &rv);
+ NS_ENSURE_SUCCESS(rv, rv);
-+
++
+ nsCAutoString path;
+ rv = jarFileURL->GetPath(path);
+ NS_ENSURE_SUCCESS(rv, rv);
+ out.Append(path);
-+
++
+ rv = jarURI->GetJAREntry(path);
+ NS_ENSURE_SUCCESS(rv, rv);
+ out.Append("/");
@@ -449,33 +255,32 @@ diff --git a/js/src/xpconnect/loader/mozJSComponentLoader.cpp b/js/src/xpconnect
+ nsCAutoString spec;
+ rv = uri->GetSpec(spec);
+ NS_ENSURE_SUCCESS(rv, rv);
-+
++
+ out.Append("/");
+ out.Append(spec);
+ }
+ }
-+
++
+ out.Append(".bin");
+ return NS_OK;
}
/* static */
- #ifdef MOZ_ENABLE_LIBXUL
- nsresult
- mozJSComponentLoader::ReadScript(StartupCache* cache, nsIURI *uri,
- JSContext *cx, JSScript **script)
- {
-diff --git a/modules/libjar/nsJAR.cpp b/modules/libjar/nsJAR.cpp
---- a/modules/libjar/nsJAR.cpp
-+++ b/modules/libjar/nsJAR.cpp
-@@ -171,26 +171,23 @@ nsJAR::Open(nsIFile* zipFile)
- if (mLock) return NS_ERROR_FAILURE; // Already open!
-
- mZipFile = zipFile;
+diff -up xulrunner-5.0/mozilla-release/layout/style/jar.mn.omnijar xulrunner-5.0/mozilla-release/layout/style/jar.mn
+--- xulrunner-5.0/mozilla-release/layout/style/jar.mn.omnijar 2011-06-15 23:57:39.000000000 +0200
++++ xulrunner-5.0/mozilla-release/layout/style/jar.mn 2011-06-21 12:46:33.530167305 +0200
+@@ -6,3 +6,5 @@ toolkit.jar:
+ * res/forms.css (forms.css)
+ res/arrow.gif (arrow.gif)
+ res/arrowd.gif (arrowd.gif)
++
++% resource gre-resources %res/
+diff -up xulrunner-5.0/mozilla-release/modules/libjar/nsJAR.cpp.omnijar xulrunner-5.0/mozilla-release/modules/libjar/nsJAR.cpp
+--- xulrunner-5.0/mozilla-release/modules/libjar/nsJAR.cpp.omnijar 2011-06-15 23:58:10.000000000 +0200
++++ xulrunner-5.0/mozilla-release/modules/libjar/nsJAR.cpp 2011-06-21 13:23:23.829895163 +0200
+@@ -177,16 +177,14 @@ nsJAR::Open(nsIFile* zipFile)
mOuterZipEntry.Truncate();
-
- mLock = PR_NewLock();
- NS_ENSURE_TRUE(mLock, NS_ERROR_OUT_OF_MEMORY);
+ mOpened = PR_TRUE;
-#ifdef MOZ_OMNIJAR
// The omnijar is special, it is opened early on and closed late
@@ -490,20 +295,11 @@ diff --git a/modules/libjar/nsJAR.cpp b/modules/libjar/nsJAR.cpp
return NS_OK;
}
-#endif
++
return mZip->OpenArchive(zipFile);
}
- NS_IMETHODIMP
- nsJAR::OpenInner(nsIZipReader *aZipReader, const char *aZipEntry)
- {
- NS_ENSURE_ARG_POINTER(aZipReader);
- NS_ENSURE_ARG_POINTER(aZipEntry);
-@@ -234,23 +231,22 @@ nsJAR::Close()
- mLock = nsnull;
- }
-
- mParsedManifest = PR_FALSE;
- mManifestData.Reset();
+@@ -235,13 +233,13 @@ nsJAR::Close()
mGlobalStatus = JAR_MANIFEST_NOT_PARSED;
mTotalItemsInManifest = 0;
@@ -516,20 +312,11 @@ diff --git a/modules/libjar/nsJAR.cpp b/modules/libjar/nsJAR.cpp
return NS_OK;
}
-#endif
++
return mZip->CloseArchive();
}
- NS_IMETHODIMP
- nsJAR::Test(const char *aEntryName)
- {
- return mZip->Test(aEntryName);
- }
-@@ -391,22 +387,21 @@ nsJAR::GetInputStreamWithSpec(const nsAC
- NS_IMETHODIMP
- nsJAR::GetCertificatePrincipal(const char* aFilename, nsIPrincipal** aPrincipal)
- {
- //-- Parameter check
- if (!aPrincipal)
+@@ -392,12 +390,11 @@ nsJAR::GetCertificatePrincipal(const cha
return NS_ERROR_NULL_POINTER;
*aPrincipal = nsnull;
@@ -544,20 +331,10 @@ diff --git a/modules/libjar/nsJAR.cpp b/modules/libjar/nsJAR.cpp
//-- Parse the manifest
nsresult rv = ParseManifest();
- if (NS_FAILED(rv)) return rv;
- if (mGlobalStatus == JAR_NO_MANIFEST)
- return NS_OK;
-
- PRInt16 requestedStatus;
-diff --git a/modules/libpref/src/nsPrefService.cpp b/modules/libpref/src/nsPrefService.cpp
---- a/modules/libpref/src/nsPrefService.cpp
-+++ b/modules/libpref/src/nsPrefService.cpp
-@@ -67,20 +67,18 @@
-
- #include "prefapi.h"
- #include "prefread.h"
- #include "prefapi_private_data.h"
- #include "PrefTuple.h"
+diff -up xulrunner-5.0/mozilla-release/modules/libpref/src/nsPrefService.cpp.omnijar xulrunner-5.0/mozilla-release/modules/libpref/src/nsPrefService.cpp
+--- xulrunner-5.0/mozilla-release/modules/libpref/src/nsPrefService.cpp.omnijar 2011-06-15 23:57:41.000000000 +0200
++++ xulrunner-5.0/mozilla-release/modules/libpref/src/nsPrefService.cpp 2011-06-21 12:46:33.545167043 +0200
+@@ -70,10 +70,8 @@
#include "nsITimelineService.h"
@@ -568,17 +345,7 @@ diff --git a/modules/libpref/src/nsPrefService.cpp b/modules/libpref/src/nsPrefS
// Definitions
#define INITIAL_PREF_FILES 10
- static NS_DEFINE_CID(kZipReaderCID, NS_ZIPREADER_CID);
-
- // Prototypes
- static nsresult openPrefFile(nsIFile* aFile);
- static nsresult pref_InitInitialObjects(void);
-@@ -793,124 +791,144 @@ static nsresult pref_LoadPrefsInDirList(
- pref_LoadPrefsInDir(dir, nsnull, 0);
- }
- }
- }
- }
+@@ -784,30 +782,6 @@ static nsresult pref_LoadPrefsInDirList(
return NS_OK;
}
@@ -609,65 +376,24 @@ diff --git a/modules/libpref/src/nsPrefService.cpp b/modules/libpref/src/nsPrefS
static nsresult pref_ReadPrefFromJar(nsZipArchive* jarReader, const char *name)
{
nsZipItemPtr<char> manifest(jarReader, name, true);
- NS_ENSURE_TRUE(manifest.Buffer(), NS_ERROR_NOT_AVAILABLE);
-
- PrefParseState ps;
- PREF_InitParseState(&ps, PREF_ReaderCallback, NULL);
- nsresult rv = PREF_ParseBuf(&ps, manifest, manifest.Length());
- PREF_FinalizeParseState(&ps);
-
+@@ -821,77 +795,121 @@ static nsresult pref_ReadPrefFromJar(nsZ
return rv;
}
-static nsresult pref_InitAppDefaultsFromOmnijar()
--{
-- nsresult rv;
--
-- nsZipArchive* jarReader = mozilla::OmnijarReader();
-- if (!jarReader)
-- return pref_InitDefaults();
--
-- rv = pref_ReadPrefFromJar(jarReader, "greprefs.js");
-- NS_ENSURE_SUCCESS(rv, rv);
--
-- nsZipFind *findPtr;
-- rv = jarReader->FindInit("defaults/pref/*.js$", &findPtr);
-- NS_ENSURE_SUCCESS(rv, rv);
--
-- nsAutoPtr<nsZipFind> find(findPtr);
--
-- nsTArray<nsCString> prefEntries;
-- const char *entryName;
-- PRUint16 entryNameLen;
-- while (NS_SUCCEEDED(find->FindNext(&entryName, &entryNameLen))) {
-- prefEntries.AppendElement(Substring(entryName, entryName + entryNameLen));
-- }
--
-- prefEntries.Sort();
-- for (PRUint32 i = prefEntries.Length(); i--; ) {
-- rv = pref_ReadPrefFromJar(jarReader, prefEntries[i].get());
-- if (NS_FAILED(rv))
-- NS_WARNING("Error parsing preferences.");
-- }
--
-- return NS_OK;
--}
--#endif
--
+//----------------------------------------------------------------------------------------
+// Initialize default preference JavaScript buffers from
+// appropriate TEXT resources
+//----------------------------------------------------------------------------------------
- static nsresult pref_InitInitialObjects()
++static nsresult pref_InitInitialObjects()
{
nsresult rv;
-- // first we parse the GRE default prefs. This also works if we're not using a GRE,
--#ifdef MOZ_OMNIJAR
-- rv = pref_InitAppDefaultsFromOmnijar();
--#else
-- rv = pref_InitDefaults();
--#endif
+- nsZipArchive* jarReader = mozilla::OmnijarReader();
+- if (!jarReader)
+- return pref_InitDefaults();
+-
+- rv = pref_ReadPrefFromJar(jarReader, "greprefs.js");
- NS_ENSURE_SUCCESS(rv, rv);
+ // In omni.jar case, we load the following prefs:
+ // - jar:$gre/omni.jar!/greprefs.js
@@ -687,33 +413,54 @@ diff --git a/modules/libpref/src/nsPrefService.cpp b/modules/libpref/src/nsPrefS
+ // and in non omni.jar case:
+ // - $app/defaults/preferences/*.js
-- nsCOMPtr<nsIFile> defaultPrefDir;
-- // now parse the "application" default preferences
-- rv = NS_GetSpecialDirectory(NS_APP_PREF_DEFAULTS_50_DIR, getter_AddRefs(defaultPrefDir));
+ nsZipFind *findPtr;
+- rv = jarReader->FindInit("defaults/pref/*.js$", &findPtr);
- NS_ENSURE_SUCCESS(rv, rv);
-+ nsZipFind *findPtr;
+-
+- nsAutoPtr<nsZipFind> find(findPtr);
+-
+ nsAutoPtr<nsZipFind> find;
-+ nsTArray<nsCString> prefEntries;
-+ const char *entryName;
-+ PRUint16 entryNameLen;
+ nsTArray<nsCString> prefEntries;
+ const char *entryName;
+ PRUint16 entryNameLen;
+- while (NS_SUCCEEDED(find->FindNext(&entryName, &entryNameLen))) {
+- prefEntries.AppendElement(Substring(entryName, entryName + entryNameLen));
+- }
-- /* these pref file names should not be used: we process them after all other application pref files for backwards compatibility */
-- static const char* specialFiles[] = {
+- prefEntries.Sort();
+- for (PRUint32 i = prefEntries.Length(); i--; ) {
+- rv = pref_ReadPrefFromJar(jarReader, prefEntries[i].get());
+- if (NS_FAILED(rv))
+- NS_WARNING("Error parsing preferences.");
+- }
+ nsZipArchive* jarReader = mozilla::Omnijar::GetReader(mozilla::Omnijar::GRE);
+ if (jarReader) {
+ // Load jar:$gre/omni.jar!/greprefs.js
+ rv = pref_ReadPrefFromJar(jarReader, "greprefs.js");
+ NS_ENSURE_SUCCESS(rv, rv);
-+
+
+- return NS_OK;
+-}
+-#endif
+ // Load jar:$gre/omni.jar!/defaults/pref/*.js
+ rv = jarReader->FindInit("defaults/pref/*.js$", &findPtr);
+ NS_ENSURE_SUCCESS(rv, rv);
-+
+
+-static nsresult pref_InitInitialObjects()
+-{
+- nsresult rv;
+ find = findPtr;
+ while (NS_SUCCEEDED(find->FindNext(&entryName, &entryNameLen))) {
+ prefEntries.AppendElement(Substring(entryName, entryName + entryNameLen));
+ }
-+
+
+- // first we parse the GRE default prefs. This also works if we're not using a GRE,
+-#ifdef MOZ_OMNIJAR
+- rv = pref_InitAppDefaultsFromOmnijar();
+-#else
+- rv = pref_InitDefaults();
+-#endif
+- NS_ENSURE_SUCCESS(rv, rv);
+ prefEntries.Sort();
+ for (PRUint32 i = prefEntries.Length(); i--; ) {
+ rv = pref_ReadPrefFromJar(jarReader, prefEntries[i].get());
@@ -725,7 +472,11 @@ diff --git a/modules/libpref/src/nsPrefService.cpp b/modules/libpref/src/nsPrefS
+ nsCOMPtr<nsIFile> greprefsFile;
+ rv = NS_GetSpecialDirectory(NS_GRE_DIR, getter_AddRefs(greprefsFile));
+ NS_ENSURE_SUCCESS(rv, rv);
-+
+
+- nsCOMPtr<nsIFile> defaultPrefDir;
+- // now parse the "application" default preferences
+- rv = NS_GetSpecialDirectory(NS_APP_PREF_DEFAULTS_50_DIR, getter_AddRefs(defaultPrefDir));
+- NS_ENSURE_SUCCESS(rv, rv);
+ rv = greprefsFile->AppendNative(NS_LITERAL_CSTRING("greprefs.js"));
+ NS_ENSURE_SUCCESS(rv, rv);
+
@@ -740,7 +491,9 @@ diff --git a/modules/libpref/src/nsPrefService.cpp b/modules/libpref/src/nsPrefS
+
+ rv = NS_GetSpecialDirectory(NS_APP_PREF_DEFAULTS_50_DIR, getter_AddRefs(defaultPrefDir));
+ NS_ENSURE_SUCCESS(rv, rv);
-+
+
+- /* these pref file names should not be used: we process them after all other application pref files for backwards compatibility */
+- static const char* specialFiles[] = {
+ /* these pref file names should not be used: we process them after all other application pref files for backwards compatibility */
+ static const char* specialFiles[] = {
#if defined(XP_MAC) || defined(XP_MACOSX)
@@ -790,20 +543,20 @@ diff --git a/modules/libpref/src/nsPrefService.cpp b/modules/libpref/src/nsPrefS
}
rv = pref_LoadPrefsInDirList(NS_APP_PREFS_DEFAULTS_DIR_LIST);
- NS_ENSURE_SUCCESS(rv, rv);
-
- NS_CreateServicesFromCategory(NS_PREFSERVICE_APPDEFAULTS_TOPIC_ID,
- nsnull, NS_PREFSERVICE_APPDEFAULTS_TOPIC_ID);
+diff -up xulrunner-5.0/mozilla-release/netwerk/protocol/res/nsResProtocolHandler.cpp.omnijar xulrunner-5.0/mozilla-release/netwerk/protocol/res/nsResProtocolHandler.cpp
+--- xulrunner-5.0/mozilla-release/netwerk/protocol/res/nsResProtocolHandler.cpp.omnijar 2011-06-15 23:57:50.000000000 +0200
++++ xulrunner-5.0/mozilla-release/netwerk/protocol/res/nsResProtocolHandler.cpp 2011-06-21 13:30:07.167653046 +0200
+@@ -76,8 +76,8 @@ static nsResProtocolHandler *gResHandler
+ static PRLogModuleInfo *gResLog;
+ #endif
-diff --git a/netwerk/protocol/res/nsResProtocolHandler.cpp b/netwerk/protocol/res/nsResProtocolHandler.cpp
---- a/netwerk/protocol/res/nsResProtocolHandler.cpp
-+++ b/netwerk/protocol/res/nsResProtocolHandler.cpp
-@@ -152,97 +152,62 @@ nsResProtocolHandler::nsResProtocolHandl
- }
++#define kAPP NS_LITERAL_CSTRING("app")
+ #define kGRE NS_LITERAL_CSTRING("gre")
+-#define kGRE_RESOURCES NS_LITERAL_CSTRING("gre-resources")
- nsResProtocolHandler::~nsResProtocolHandler()
- {
- gResHandler = nsnull;
+ //----------------------------------------------------------------------------
+ // nsResURL : overrides nsStandardURL::GetFile to provide nsIFile resolution
+@@ -155,20 +155,6 @@ nsResProtocolHandler::~nsResProtocolHand
}
nsresult
@@ -824,10 +577,7 @@ diff --git a/netwerk/protocol/res/nsResProtocolHandler.cpp b/netwerk/protocol/re
nsResProtocolHandler::Init()
{
if (!mSubstitutions.Init(32))
- return NS_ERROR_UNEXPECTED;
-
- nsresult rv;
-
+@@ -179,38 +165,39 @@ nsResProtocolHandler::Init()
mIOService = do_GetIOService(&rv);
NS_ENSURE_SUCCESS(rv, rv);
@@ -836,24 +586,29 @@ diff --git a/netwerk/protocol/res/nsResProtocolHandler.cpp b/netwerk/protocol/re
- if (omniJar)
- return Init(omniJar);
-#endif
--
-- // these entries should be kept in sync with the omnijar Init function
+ nsCAutoString appURI, greURI;
+ rv = mozilla::Omnijar::GetURIString(mozilla::Omnijar::APP, appURI);
+ NS_ENSURE_SUCCESS(rv, rv);
+ rv = mozilla::Omnijar::GetURIString(mozilla::Omnijar::GRE, greURI);
+ NS_ENSURE_SUCCESS(rv, rv);
-
- //
-- // make resource:/// point to the application directory
++
++ //
+ // make resource:/// point to the application directory or omnijar
- //
-- rv = AddSpecialDir(NS_OS_CURRENT_PROCESS_DIR, EmptyCString());
++ //
+ nsCOMPtr<nsIURI> uri;
+ rv = NS_NewURI(getter_AddRefs(uri), appURI.Length() ? appURI : greURI);
+ NS_ENSURE_SUCCESS(rv, rv);
-+
+
+- // these entries should be kept in sync with the omnijar Init function
+ rv = SetSubstitution(EmptyCString(), uri);
++ NS_ENSURE_SUCCESS(rv, rv);
+
+ //
+- // make resource:/// point to the application directory
++ // make resource://app/ point to the application directory or omnijar
+ //
+- rv = AddSpecialDir(NS_OS_CURRENT_PROCESS_DIR, EmptyCString());
++ rv = SetSubstitution(kAPP, uri);
NS_ENSURE_SUCCESS(rv, rv);
//
@@ -868,14 +623,24 @@ diff --git a/netwerk/protocol/res/nsResProtocolHandler.cpp b/netwerk/protocol/re
+ rv = SetSubstitution(kGRE, uri);
NS_ENSURE_SUCCESS(rv, rv);
- //XXXbsmedberg Neil wants a resource://pchrome/ for the profile chrome dir...
- // but once I finish multiple chrome registration I'm not sure that it is needed
-
- // XXX dveditz: resource://pchrome/ defeats profile directory salting
- // if web content can load it. Tread carefully.
-
- return rv;
- }
+- // make resource://gre-resources/ point to gre toolkit[.jar]/res
+- nsCOMPtr<nsIURI> greURI;
+- nsCOMPtr<nsIURI> greResURI;
+- GetSubstitution(kGRE, getter_AddRefs(greURI));
+-#ifdef MOZ_CHROME_FILE_FORMAT_JAR
+- NS_NAMED_LITERAL_CSTRING(strGRE_RES_URL, "jar:chrome/toolkit.jar!/res/");
+-#else
+- NS_NAMED_LITERAL_CSTRING(strGRE_RES_URL, "chrome/toolkit/res/");
+-#endif
+- rv = mIOService->NewURI(strGRE_RES_URL, nsnull, greURI,
+- getter_AddRefs(greResURI));
+- SetSubstitution(kGRE_RESOURCES, greResURI);
+ //XXXbsmedberg Neil wants a resource://pchrome/ for the profile chrome dir...
+ // but once I finish multiple chrome registration I'm not sure that it is needed
+
+@@ -220,40 +207,6 @@ nsResProtocolHandler::Init()
+ return rv;
+ }
-#ifdef MOZ_OMNIJAR
-nsresult
@@ -901,27 +666,23 @@ diff --git a/netwerk/protocol/res/nsResProtocolHandler.cpp b/netwerk/protocol/re
- // resource://gre/ points to jar:omni.jar!/
- SetSubstitution(kGRE, uri);
-
+- urlStr += "chrome/toolkit/res/";
+- rv = mIOService->NewURI(urlStr, nsnull, nsnull, getter_AddRefs(uri));
+- NS_ENSURE_SUCCESS(rv, rv);
+-
+- // resource://gre-resources/ points to jar:omni.jar!/chrome/toolkit/res/
+- SetSubstitution(kGRE_RESOURCES, uri);
- return NS_OK;
-}
-#endif
-
- #ifdef MOZ_IPC
static PLDHashOperator
EnumerateSubstitution(const nsACString& aKey,
nsIURI* aURI,
- void* aArg)
- {
- nsTArray<ResourceMapping>* resources =
- static_cast<nsTArray<ResourceMapping>*>(aArg);
-diff --git a/startupcache/StartupCache.cpp b/startupcache/StartupCache.cpp
---- a/startupcache/StartupCache.cpp
-+++ b/startupcache/StartupCache.cpp
-@@ -237,27 +237,36 @@ StartupCache::GetBuffer(const char* id,
- nsZipItemPtr<char> zipItem(mArchive, id, true);
- if (zipItem) {
- *outbuf = zipItem.Forget();
- *length = zipItem.Length();
- return NS_OK;
+diff -up xulrunner-5.0/mozilla-release/startupcache/StartupCache.cpp.omnijar xulrunner-5.0/mozilla-release/startupcache/StartupCache.cpp
+--- xulrunner-5.0/mozilla-release/startupcache/StartupCache.cpp.omnijar 2011-06-15 23:57:54.000000000 +0200
++++ xulrunner-5.0/mozilla-release/startupcache/StartupCache.cpp 2011-06-21 13:10:46.687518879 +0200
+@@ -250,17 +250,26 @@ StartupCache::GetBuffer(const char* id,
}
}
@@ -952,22 +713,24 @@ diff --git a/startupcache/StartupCache.cpp b/startupcache/StartupCache.cpp
return NS_ERROR_NOT_AVAILABLE;
}
- // Makes a copy of the buffer, client retains ownership of inbuf.
- nsresult
- StartupCache::PutBuffer(const char* id, const char* inbuf, PRUint32 len)
- {
- WaitOnWriteThread();
-diff --git a/toolkit/xre/nsAppRunner.cpp b/toolkit/xre/nsAppRunner.cpp
---- a/toolkit/xre/nsAppRunner.cpp
-+++ b/toolkit/xre/nsAppRunner.cpp
-@@ -3897,35 +3897,45 @@ XRE_InitCommandLine(int aArgc, char* aAr
- CommandLine::Init(aArgc, canonArgs);
-
- for (int i = 0; i < aArgc; ++i)
- free(canonArgs[i]);
+diff -up xulrunner-5.0/mozilla-release/toolkit/mozapps/installer/packager.mk.omnijar xulrunner-5.0/mozilla-release/toolkit/mozapps/installer/packager.mk
+--- xulrunner-5.0/mozilla-release/toolkit/mozapps/installer/packager.mk.omnijar 2011-06-15 23:58:10.000000000 +0200
++++ xulrunner-5.0/mozilla-release/toolkit/mozapps/installer/packager.mk 2011-06-21 12:46:33.535167224 +0200
+@@ -397,7 +397,7 @@ OMNIJAR_FILES = \
+
+ NON_OMNIJAR_FILES += \
+ chrome/icons/\* \
+- defaults/pref/channel-prefs.js \
++ $(PREF_DIR)/channel-prefs.js \
+ res/cursors/\* \
+ res/MainMenu.nib/\* \
+ $(NULL)
+diff -up xulrunner-5.0/mozilla-release/toolkit/xre/nsAppRunner.cpp.omnijar xulrunner-5.0/mozilla-release/toolkit/xre/nsAppRunner.cpp
+--- xulrunner-5.0/mozilla-release/toolkit/xre/nsAppRunner.cpp.omnijar 2011-06-15 23:57:56.000000000 +0200
++++ xulrunner-5.0/mozilla-release/toolkit/xre/nsAppRunner.cpp 2011-06-21 13:20:33.307973388 +0200
+@@ -3877,25 +3877,35 @@ XRE_InitCommandLine(int aArgc, char* aAr
delete[] canonArgs;
#endif
- #endif
-#ifdef MOZ_OMNIJAR
- const char *omnijarPath = nsnull;
@@ -990,13 +753,12 @@ diff --git a/toolkit/xre/nsAppRunner.cpp b/toolkit/xre/nsAppRunner.cpp
- if (NS_SUCCEEDED(rv))
- mozilla::SetOmnijar(omnijar);
-#endif
--
-- return rv;
+ nsCOMPtr<nsILocalFile> greBase;
+ rv = XRE_GetFileFromPath(path, getter_AddRefs(greBase));
+ if (NS_FAILED(rv))
+ return rv;
-+
+
+- return rv;
+ ar = CheckArg("appbase", PR_FALSE, &path);
+ if (ar == ARG_BAD) {
+ PR_fprintf(PR_STDERR, "Error: argument -appbase requires a path argument\n");
@@ -1014,20 +776,10 @@ diff --git a/toolkit/xre/nsAppRunner.cpp b/toolkit/xre/nsAppRunner.cpp
}
nsresult
- XRE_DeinitCommandLine()
- {
- nsresult rv = NS_OK;
-
- #if defined(MOZ_IPC)
-diff --git a/toolkit/xre/nsEmbedFunctions.cpp b/toolkit/xre/nsEmbedFunctions.cpp
---- a/toolkit/xre/nsEmbedFunctions.cpp
-+++ b/toolkit/xre/nsEmbedFunctions.cpp
-@@ -512,19 +512,17 @@ XRE_InitChildProcess(int aArgc,
- }
-
- // Run the UI event loop on the main thread.
- uiMessageLoop.MessageLoop::Run();
-
+diff -up xulrunner-5.0/mozilla-release/toolkit/xre/nsEmbedFunctions.cpp.omnijar xulrunner-5.0/mozilla-release/toolkit/xre/nsEmbedFunctions.cpp
+--- xulrunner-5.0/mozilla-release/toolkit/xre/nsEmbedFunctions.cpp.omnijar 2011-06-15 23:57:56.000000000 +0200
++++ xulrunner-5.0/mozilla-release/toolkit/xre/nsEmbedFunctions.cpp 2011-06-21 12:46:33.558166809 +0200
+@@ -512,9 +512,7 @@ XRE_InitChildProcess(int aArgc,
// Allow ProcessChild to clean up after itself before going out of
// scope and being deleted
process->CleanUp();
@@ -1038,20 +790,23 @@ diff --git a/toolkit/xre/nsEmbedFunctions.cpp b/toolkit/xre/nsEmbedFunctions.cpp
}
}
- NS_LogTerm();
- return XRE_DeinitCommandLine();
- }
-
- MessageLoop*
-diff --git a/xpcom/build/Makefile.in b/xpcom/build/Makefile.in
---- a/xpcom/build/Makefile.in
-+++ b/xpcom/build/Makefile.in
-@@ -64,28 +64,25 @@ CSRCS = \
- $(NULL)
+diff -up xulrunner-5.0/mozilla-release/toolkit/xre/nsXREDirProvider.cpp.omnijar xulrunner-5.0/mozilla-release/toolkit/xre/nsXREDirProvider.cpp
+--- xulrunner-5.0/mozilla-release/toolkit/xre/nsXREDirProvider.cpp.omnijar 2011-06-15 23:57:57.000000000 +0200
++++ xulrunner-5.0/mozilla-release/toolkit/xre/nsXREDirProvider.cpp 2011-06-21 12:46:33.575166505 +0200
+@@ -301,9 +301,6 @@ nsXREDirProvider::GetFile(const char* aP
+ if (NS_SUCCEEDED(rv))
+ file = lf;
+ }
+- else if (!strcmp(aProperty, "resource:app")) {
+- rv = GetAppDir()->Clone(getter_AddRefs(file));
+- }
- CPPSRCS = \
- $(XPCOM_GLUE_SRC_LCPPSRCS) \
- $(XPCOM_GLUENS_SRC_LCPPSRCS) \
+ else if (!strcmp(aProperty, NS_APP_PROFILE_DIR_STARTUP) && mProfileDir) {
+ return mProfileDir->Clone(aFile);
+diff -up xulrunner-5.0/mozilla-release/xpcom/build/Makefile.in.omnijar xulrunner-5.0/mozilla-release/xpcom/build/Makefile.in
+--- xulrunner-5.0/mozilla-release/xpcom/build/Makefile.in.omnijar 2011-06-15 23:57:58.000000000 +0200
++++ xulrunner-5.0/mozilla-release/xpcom/build/Makefile.in 2011-06-21 12:46:33.560166773 +0200
+@@ -69,6 +69,7 @@ CPPSRCS = \
nsXPComInit.cpp \
nsXPCOMStrings.cpp \
Services.cpp \
@@ -1059,8 +814,7 @@ diff --git a/xpcom/build/Makefile.in b/xpcom/build/Makefile.in
$(NULL)
ifndef MOZ_ENABLE_LIBXUL
- ifeq (,$(filter-out WINNT WINCE OS2,$(OS_ARCH)))
- CPPSRCS += dlldeps.cpp
+@@ -77,10 +78,6 @@ CPPSRCS += dlldeps.cpp
endif
endif
@@ -1071,20 +825,61 @@ diff --git a/xpcom/build/Makefile.in b/xpcom/build/Makefile.in
SHARED_LIBRARY_LIBS = \
$(DEPTH)/chrome/src/$(LIB_PREFIX)chrome_s.$(LIB_SUFFIX) \
../ds/$(LIB_PREFIX)xpcomds_s.$(LIB_SUFFIX) \
- ../io/$(LIB_PREFIX)xpcomio_s.$(LIB_SUFFIX) \
- ../components/$(LIB_PREFIX)xpcomcomponents_s.$(LIB_SUFFIX) \
- ../threads/$(LIB_PREFIX)xpcomthreads_s.$(LIB_SUFFIX) \
- ../proxy/src/$(LIB_PREFIX)xpcomproxy_s.$(LIB_SUFFIX) \
- ../base/$(LIB_PREFIX)xpcombase_s.$(LIB_SUFFIX) \
-diff --git a/xpcom/build/Omnijar.cpp b/xpcom/build/Omnijar.cpp
---- a/xpcom/build/Omnijar.cpp
-+++ b/xpcom/build/Omnijar.cpp
-@@ -16,16 +16,17 @@
- *
- * The Initial Developer of the Original Code is
- * Mozilla Foundation.
- * Portions created by the Initial Developer are Copyright (C) 2010
- * the Initial Developer. All Rights Reserved.
+diff -up xulrunner-5.0/mozilla-release/xpcom/build/nsXPComInit.cpp.omnijar xulrunner-5.0/mozilla-release/xpcom/build/nsXPComInit.cpp
+--- xulrunner-5.0/mozilla-release/xpcom/build/nsXPComInit.cpp.omnijar 2011-06-15 23:58:00.000000000 +0200
++++ xulrunner-5.0/mozilla-release/xpcom/build/nsXPComInit.cpp 2011-06-21 13:15:00.545014024 +0200
+@@ -457,25 +457,25 @@ NS_InitXPCOM2(nsIServiceManager* *result
+ if (NS_FAILED(rv)) return rv;
+ }
+
+-#ifdef MOZ_OMNIJAR
+ NS_TIME_FUNCTION_MARK("Next: Omnijar init");
+
+- if (!mozilla::OmnijarPath()) {
+- nsCOMPtr<nsILocalFile> omnijar;
++ if (!mozilla::Omnijar::IsInitialized()) {
++ nsCOMPtr<nsILocalFile> greDir, appDir;
+ nsCOMPtr<nsIFile> file;
+
+- rv = NS_ERROR_FAILURE;
+ nsDirectoryService::gService->Get(NS_GRE_DIR,
+ NS_GET_IID(nsIFile),
++ getter_AddRefs(file));
++ greDir = do_QueryInterface(file);
++
++ nsDirectoryService::gService->Get(NS_XPCOM_CURRENT_PROCESS_DIR,
++ NS_GET_IID(nsIFile),
+ getter_AddRefs(file));
+- if (file)
+- rv = file->Append(NS_LITERAL_STRING("omni.jar"));
+- if (NS_SUCCEEDED(rv))
+- omnijar = do_QueryInterface(file);
+- if (NS_SUCCEEDED(rv))
+- mozilla::SetOmnijar(omnijar);
++ appDir = do_QueryInterface(file);
++
++ rv = mozilla::Omnijar::SetBase(greDir, appDir);
++ NS_ENSURE_SUCCESS(rv, rv);
+ }
+-#endif
+
+ if ((sCommandLineWasInitialized = !CommandLine::IsInitialized())) {
+ NS_TIME_FUNCTION_MARK("Next: IPC command line init");
+@@ -755,9 +755,7 @@ ShutdownXPCOM(nsIServiceManager* servMgr
+ sExitManager = nsnull;
+ }
+
+-#ifdef MOZ_OMNIJAR
+- mozilla::SetOmnijar(nsnull);
+-#endif
++ mozilla::Omnijar::SetBase(nsnull, nsnull);
+
+ NS_LogTerm();
+
+diff -up xulrunner-5.0/mozilla-release/xpcom/build/Omnijar.cpp.omnijar xulrunner-5.0/mozilla-release/xpcom/build/Omnijar.cpp
+--- xulrunner-5.0/mozilla-release/xpcom/build/Omnijar.cpp.omnijar 2011-06-15 23:57:58.000000000 +0200
++++ xulrunner-5.0/mozilla-release/xpcom/build/Omnijar.cpp 2011-06-21 12:46:33.563166721 +0200
+@@ -21,6 +21,7 @@
*
* Contributor(s):
* Michael Wu <mwu at mozilla.com>
@@ -1092,17 +887,7 @@ diff --git a/xpcom/build/Omnijar.cpp b/xpcom/build/Omnijar.cpp
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
-@@ -33,69 +34,175 @@
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
+@@ -38,64 +39,170 @@
#include "Omnijar.h"
@@ -1130,6 +915,7 @@ diff --git a/xpcom/build/Omnijar.cpp b/xpcom/build/Omnijar.cpp
{
- if (!sOmnijarPath) {
- return;
+- }
+ PRBool isDir;
+ aIsOmnijar = PR_FALSE;
+ if (!aPath || NS_FAILED(aPath->IsDirectory(&isDir)) || !isDir)
@@ -1147,7 +933,11 @@ diff --git a/xpcom/build/Omnijar.cpp b/xpcom/build/Omnijar.cpp
+ if (NS_FAILED(path->Exists(&aIsOmnijar)))
+ return nsnull;
+#endif
-+
+
+- nsZipArchive* zipReader = new nsZipArchive();
+- if (!zipReader) {
+- NS_IF_RELEASE(sOmnijarPath);
+- return;
+ if (!aIsOmnijar && NS_FAILED(aPath->Clone(getter_AddRefs(path))))
+ return nsnull;
+
@@ -1167,10 +957,14 @@ diff --git a/xpcom/build/Omnijar.cpp b/xpcom/build/Omnijar.cpp
+ if (sReader[APP]) {
+ sReader[APP]->CloseArchive();
+ delete sReader[APP];
-+ }
+ }
+ sReader[APP] = sReader[GRE] = nsnull;
+#endif
-+
+
+- if (NS_FAILED(zipReader->OpenArchive(sOmnijarPath))) {
+- delete zipReader;
+- NS_IF_RELEASE(sOmnijarPath);
+- return;
+ nsresult rv;
+ PRBool equals;
+ if (aAppPath) {
@@ -1180,10 +974,7 @@ diff --git a/xpcom/build/Omnijar.cpp b/xpcom/build/Omnijar.cpp
+ equals = PR_TRUE;
}
-- nsZipArchive* zipReader = new nsZipArchive();
-- if (!zipReader) {
-- NS_IF_RELEASE(sOmnijarPath);
-- return;
+- sOmnijarReader = zipReader;
+ nsCOMPtr<nsIFile> grePath = ComputePath(aGrePath, sIsOmnijar[GRE]);
+ nsCOMPtr<nsIFile> appPath = ComputePath(equals ? nsnull : aAppPath, sIsOmnijar[APP]);
+
@@ -1196,19 +987,23 @@ diff --git a/xpcom/build/Omnijar.cpp b/xpcom/build/Omnijar.cpp
+ NS_IF_ADDREF(sPath[APP]);
+
+ return NS_OK;
-+}
-+
+ }
+
+-nsILocalFile*
+-mozilla::OmnijarPath()
+already_AddRefed<nsIFile>
+Omnijar::GetBase(Type aType)
-+{
+ {
+- if (!sOmnijarReader)
+- SetupReader();
+ NS_ABORT_IF_FALSE(sPath[0], "Omnijar not initialized");
+
+ if (!sIsOmnijar[aType]) {
+ NS_IF_ADDREF(sPath[aType]);
+ return sPath[aType];
- }
++ }
-- if (NS_FAILED(zipReader->OpenArchive(sOmnijarPath))) {
+- return sOmnijarPath;
+ nsCOMPtr<nsIFile> file, path;
+ if (NS_FAILED(sPath[aType]->Clone(getter_AddRefs(file))))
+ return nsnull;
@@ -1216,15 +1011,20 @@ diff --git a/xpcom/build/Omnijar.cpp b/xpcom/build/Omnijar.cpp
+ if (NS_FAILED(file->GetParent(getter_AddRefs(path))))
+ return nsnull;
+ return path.forget();
-+}
-+
+ }
+
+-nsZipArchive*
+-mozilla::OmnijarReader()
+#ifdef MOZ_ENABLE_LIBXUL
+nsZipArchive *
+Omnijar::GetReader(Type aType)
-+{
+ {
+- if (!sOmnijarReader)
+- SetupReader();
+ if (!sIsOmnijar[aType])
+ return nsnull;
-+
+
+- return sOmnijarReader;
+ if (sReader[aType])
+ return sReader[aType];
+
@@ -1233,32 +1033,31 @@ diff --git a/xpcom/build/Omnijar.cpp b/xpcom/build/Omnijar.cpp
+ return nsnull;
+
+ if (NS_FAILED(zipReader->OpenArchive(sPath[aType]))) {
- delete zipReader;
-- NS_IF_RELEASE(sOmnijarPath);
-- return;
++ delete zipReader;
+ return nsnull;
- }
-
-- sOmnijarReader = zipReader;
++ }
++
+ return (sReader[aType] = zipReader);
}
--nsILocalFile*
--mozilla::OmnijarPath()
+-void
+-mozilla::SetOmnijar(nsILocalFile* aPath)
+nsZipArchive *
+Omnijar::GetReader(nsIFile *aPath)
{
-- if (!sOmnijarReader)
-- SetupReader();
+- NS_IF_RELEASE(sOmnijarPath);
+- if (sOmnijarReader) {
+- sOmnijarReader->CloseArchive();
+- delete sOmnijarReader;
+- sOmnijarReader = nsnull;
+ PRBool equals;
+ nsresult rv;
-
-- return sOmnijarPath;
++
+ if (sIsOmnijar[GRE]) {
+ rv = sPath[GRE]->Equals(aPath, &equals);
+ if (NS_SUCCEEDED(rv) && equals)
+ return GetReader(GRE);
-+ }
+ }
+ if (sIsOmnijar[APP]) {
+ rv = sPath[APP]->Equals(aPath, &equals);
+ if (NS_SUCCEEDED(rv) && equals)
@@ -1272,7 +1071,9 @@ diff --git a/xpcom/build/Omnijar.cpp b/xpcom/build/Omnijar.cpp
+Omnijar::GetURIString(Type aType, nsCString &result)
+{
+ NS_ABORT_IF_FALSE(sPath[0], "Omnijar not initialized");
-+
+
+- sOmnijarPath = aPath;
+- NS_IF_ADDREF(sOmnijarPath);
+ result = "";
+
+ if ((aType == APP) && (!sPath[APP]))
@@ -1293,39 +1094,11 @@ diff --git a/xpcom/build/Omnijar.cpp b/xpcom/build/Omnijar.cpp
+ return NS_OK;
}
--nsZipArchive*
--mozilla::OmnijarReader()
--{
-- if (!sOmnijarReader)
-- SetupReader();
--
-- return sOmnijarReader;
--}
--
--void
--mozilla::SetOmnijar(nsILocalFile* aPath)
--{
-- NS_IF_RELEASE(sOmnijarPath);
-- if (sOmnijarReader) {
-- sOmnijarReader->CloseArchive();
-- delete sOmnijarReader;
-- sOmnijarReader = nsnull;
-- }
--
-- sOmnijarPath = aPath;
-- NS_IF_ADDREF(sOmnijarPath);
--}
--
+} /* namespace mozilla */
-diff --git a/xpcom/build/Omnijar.h b/xpcom/build/Omnijar.h
---- a/xpcom/build/Omnijar.h
-+++ b/xpcom/build/Omnijar.h
-@@ -16,16 +16,17 @@
- *
- * The Initial Developer of the Original Code is
- * Mozilla Foundation.
- * Portions created by the Initial Developer are Copyright (C) 2010
- * the Initial Developer. All Rights Reserved.
+diff -up xulrunner-5.0/mozilla-release/xpcom/build/Omnijar.h.omnijar xulrunner-5.0/mozilla-release/xpcom/build/Omnijar.h
+--- xulrunner-5.0/mozilla-release/xpcom/build/Omnijar.h.omnijar 2011-06-15 23:57:58.000000000 +0200
++++ xulrunner-5.0/mozilla-release/xpcom/build/Omnijar.h 2011-06-21 12:46:33.564166703 +0200
+@@ -21,6 +21,7 @@
*
* Contributor(s):
* Michael Wu <mwu at mozilla.com>
@@ -1333,30 +1106,20 @@ diff --git a/xpcom/build/Omnijar.h b/xpcom/build/Omnijar.h
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
-@@ -34,29 +35,137 @@
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
+@@ -39,24 +40,132 @@
#ifndef mozilla_Omnijar_h
#define mozilla_Omnijar_h
-class nsILocalFile;
+-class nsZipArchive;
+#include "nscore.h"
+#include "nsTArray.h"
+#include "nsCOMPtr.h"
+#include "nsString.h"
-+
-+class nsIFile;
- class nsZipArchive;
--
+
-#ifdef MOZ_OMNIJAR
++class nsIFile;
++class nsZipArchive;
+class nsIURI;
namespace mozilla {
@@ -1369,25 +1132,27 @@ diff --git a/xpcom/build/Omnijar.h b/xpcom/build/Omnijar.h
+
+class OMNIJAR_EXPORT Omnijar {
+private:
- /**
-- * This returns the path to the omnijar.
-- * If the omnijar isn't available, this function will return null.
-- * Callers should fallback to flat packaging if null.
++/**
+ * Store an nsIFile for either a base directory when there is no omni.jar,
+ * or omni.jar itself. We can store two paths here, one for GRE
+ * (corresponding to resource://gre/) and one for APP
+ * (corresponding to resource:/// and resource://app/), but only
+ * store one when both point to the same location (unified).
- */
++ */
++static nsIFile *sPath[2];
+ /**
+- * This returns the path to the omnijar.
+- * If the omnijar isn't available, this function will return null.
+- * Callers should fallback to flat packaging if null.
+- */
-nsILocalFile *OmnijarPath();
-nsZipArchive *OmnijarReader();
-void SetOmnijar(nsILocalFile* aPath);
-+static nsIFile *sPath[2];
-+/**
+ * Store whether the corresponding sPath is an omni.jar or a directory
+ */
+static PRBool sIsOmnijar[2];
-+
+
+-} /* namespace mozilla */
+#ifdef MOZ_ENABLE_LIBXUL
+/**
+ * Cached nsZipArchives for the corresponding sPath
@@ -1460,7 +1225,8 @@ diff --git a/xpcom/build/Omnijar.h b/xpcom/build/Omnijar.h
+#else
+static nsZipArchive *GetReader(Type aType) { return nsnull; }
+#endif
-+
+
+-#endif /* MOZ_OMNIJAR */
+/**
+ * Returns a nsZipArchive pointer for the given path IAOI the given
+ * path is the omni.jar for either GRE or APP.
@@ -1481,91 +1247,14 @@ diff --git a/xpcom/build/Omnijar.h b/xpcom/build/Omnijar.h
+static nsresult GetURIString(Type aType, nsCString &result);
+
+}; /* class Omnijar */
-
- } /* namespace mozilla */
-
--#endif /* MOZ_OMNIJAR */
--
- #endif /* mozilla_Omnijar_h */
-diff --git a/xpcom/build/nsXPComInit.cpp b/xpcom/build/nsXPComInit.cpp
---- a/xpcom/build/nsXPComInit.cpp
-+++ b/xpcom/build/nsXPComInit.cpp
-@@ -462,35 +462,35 @@ NS_InitXPCOM2(nsIServiceManager* *result
- nsDirectoryService::gService->Set(NS_XPCOM_LIBRARY_FILE, xpcomLib);
- }
-
- if (appFileLocationProvider) {
- rv = nsDirectoryService::gService->RegisterProvider(appFileLocationProvider);
- if (NS_FAILED(rv)) return rv;
- }
-
--#ifdef MOZ_OMNIJAR
- NS_TIME_FUNCTION_MARK("Next: Omnijar init");
-
-- if (!mozilla::OmnijarPath()) {
-- nsCOMPtr<nsILocalFile> omnijar;
-+ if (!mozilla::Omnijar::IsInitialized()) {
-+ nsCOMPtr<nsILocalFile> greDir, appDir;
- nsCOMPtr<nsIFile> file;
-
-- rv = NS_ERROR_FAILURE;
- nsDirectoryService::gService->Get(NS_GRE_DIR,
- NS_GET_IID(nsIFile),
- getter_AddRefs(file));
-- if (file)
-- rv = file->Append(NS_LITERAL_STRING("omni.jar"));
-- if (NS_SUCCEEDED(rv))
-- omnijar = do_QueryInterface(file);
-- if (NS_SUCCEEDED(rv))
-- mozilla::SetOmnijar(omnijar);
-+ greDir = do_QueryInterface(file);
+
-+ nsDirectoryService::gService->Get(NS_XPCOM_CURRENT_PROCESS_DIR,
-+ NS_GET_IID(nsIFile),
-+ getter_AddRefs(file));
-+ appDir = do_QueryInterface(file);
-+
-+ rv = mozilla::Omnijar::SetBase(greDir, appDir);
-+ NS_ENSURE_SUCCESS(rv, rv);
- }
--#endif
-
- #ifdef MOZ_IPC
- if ((sCommandLineWasInitialized = !CommandLine::IsInitialized())) {
- NS_TIME_FUNCTION_MARK("Next: IPC command line init");
-
- #ifdef OS_WIN
- CommandLine::Init(0, nsnull);
- #else
-@@ -769,18 +769,16 @@ ShutdownXPCOM(nsIServiceManager* servMgr
- sCommandLineWasInitialized = false;
- }
- if (sExitManager) {
- delete sExitManager;
- sExitManager = nsnull;
- }
- #endif
-
--#ifdef MOZ_OMNIJAR
-- mozilla::SetOmnijar(nsnull);
--#endif
-+ mozilla::Omnijar::SetBase(nsnull, nsnull);
-
- NS_LogTerm();
-
- return NS_OK;
- }
++} /* namespace mozilla */
- } // namespace mozilla
-diff --git a/xpcom/components/nsComponentManager.cpp b/xpcom/components/nsComponentManager.cpp
---- a/xpcom/components/nsComponentManager.cpp
-+++ b/xpcom/components/nsComponentManager.cpp
-@@ -175,18 +175,16 @@ NS_DEFINE_CID(kCategoryManagerCID, NS_CA
- #define COMPMGR_TIME_FUNCTION_CONTRACTID(cid) \
- NS_TIME_FUNCTION_MIN_FMT(5, "%s (line %d) (contractid: %s)", MOZ_FUNCTION_NAME, \
- __LINE__, (cid))
- #else
- #define COMPMGR_TIME_FUNCTION_CID(cid) do {} while (0)
+ #endif /* mozilla_Omnijar_h */
+diff -up xulrunner-5.0/mozilla-release/xpcom/components/nsComponentManager.cpp.omnijar xulrunner-5.0/mozilla-release/xpcom/components/nsComponentManager.cpp
+--- xulrunner-5.0/mozilla-release/xpcom/components/nsComponentManager.cpp.omnijar 2011-06-15 23:58:01.000000000 +0200
++++ xulrunner-5.0/mozilla-release/xpcom/components/nsComponentManager.cpp 2011-06-21 12:46:33.569166613 +0200
+@@ -174,8 +174,6 @@ NS_DEFINE_CID(kCategoryManagerCID, NS_CA
#define COMPMGR_TIME_FUNCTION_CONTRACTID(cid) do {} while (0)
#endif
@@ -1574,17 +1263,7 @@ diff --git a/xpcom/components/nsComponentManager.cpp b/xpcom/components/nsCompon
nsresult
nsGetServiceFromCategory::operator()(const nsIID& aIID, void** aInstancePtr) const
{
- nsresult rv;
- nsXPIDLCString value;
- nsCOMPtr<nsICategoryManager> catman;
- nsComponentManagerImpl *compMgr = nsComponentManagerImpl::gComponentManager;
- if (!compMgr) {
-@@ -390,47 +388,44 @@ nsresult nsComponentManagerImpl::Init()
-
- nsCategoryManager::GetSingleton()->SuppressNotifications(true);
-
- RegisterModule(&kXPCOMModule, NULL);
-
+@@ -385,14 +383,20 @@ nsresult nsComponentManagerImpl::Init()
for (PRUint32 i = 0; i < sStaticModules->Length(); ++i)
RegisterModule((*sStaticModules)[i], NULL);
@@ -1600,26 +1279,19 @@ diff --git a/xpcom/components/nsComponentManager.cpp b/xpcom/components/nsCompon
+ cl->type = NS_COMPONENT_LOCATION;
+ cl->location = do_QueryInterface(appOmnijar);
+ cl->jar = true;
- }
--#endif
++ }
+ nsCOMPtr<nsIFile> greOmnijar = mozilla::Omnijar::GetPath(mozilla::Omnijar::GRE);
+ if (greOmnijar) {
+ cl = sModuleLocations->InsertElementAt(0);
+ cl->type = NS_COMPONENT_LOCATION;
+ cl->location = do_QueryInterface(greOmnijar);
+ cl->jar = true;
-+ }
+ }
+-#endif
for (PRUint32 i = 0; i < sModuleLocations->Length(); ++i) {
ComponentLocation& l = sModuleLocations->ElementAt(i);
- if (!l.jar) {
- RegisterManifestFile(l.type, l.location, false);
- continue;
- }
-
- nsCOMPtr<nsIZipReader> reader = do_CreateInstance(kZipReaderCID, &rv);
- rv = reader->Open(l.location);
- if (NS_SUCCEEDED(rv))
+@@ -407,15 +411,6 @@ nsresult nsComponentManagerImpl::Init()
RegisterJarManifest(reader, "chrome.manifest", false);
}
@@ -1635,95 +1307,10 @@ diff --git a/xpcom/components/nsComponentManager.cpp b/xpcom/components/nsCompon
nsCategoryManager::GetSingleton()->SuppressNotifications(false);
mStatus = NORMAL;
-
- return NS_OK;
- }
-
- void
-# HG changeset patch
-# Parent ff1b810f78226d7f4010909d3cde05a57fdcf20c
-Bug 620931 part 4 - Fix resource://app/ to always point to the same as resource:///
-
-diff --git a/netwerk/protocol/res/nsResProtocolHandler.cpp b/netwerk/protocol/res/nsResProtocolHandler.cpp
---- a/netwerk/protocol/res/nsResProtocolHandler.cpp
-+++ b/netwerk/protocol/res/nsResProtocolHandler.cpp
-@@ -74,16 +74,17 @@ static nsResProtocolHandler *gResHandler
- // set NSPR_LOG_FILE=log.txt
- //
- // this enables PR_LOG_ALWAYS level information and places all output in
- // the file log.txt
- //
- static PRLogModuleInfo *gResLog;
- #endif
-
-+#define kAPP NS_LITERAL_CSTRING("app")
- #define kGRE NS_LITERAL_CSTRING("gre")
-
- //----------------------------------------------------------------------------
- // nsResURL : overrides nsStandardURL::GetFile to provide nsIFile resolution
- //----------------------------------------------------------------------------
-
- nsresult
- nsResURL::EnsureFile()
-@@ -179,16 +180,22 @@ nsResProtocolHandler::Init()
- nsCOMPtr<nsIURI> uri;
- rv = NS_NewURI(getter_AddRefs(uri), appURI.Length() ? appURI : greURI);
- NS_ENSURE_SUCCESS(rv, rv);
-
- rv = SetSubstitution(EmptyCString(), uri);
- NS_ENSURE_SUCCESS(rv, rv);
-
- //
-+ // make resource://app/ point to the application directory or omnijar
-+ //
-+ rv = SetSubstitution(kAPP, uri);
-+ NS_ENSURE_SUCCESS(rv, rv);
-+
-+ //
- // make resource://gre/ point to the GRE directory
- //
- if (appURI.Length()) { // We already have greURI in uri if appURI.Length() is 0.
- rv = NS_NewURI(getter_AddRefs(uri), greURI);
- NS_ENSURE_SUCCESS(rv, rv);
- }
-
- rv = SetSubstitution(kGRE, uri);
-diff --git a/toolkit/xre/nsXREDirProvider.cpp b/toolkit/xre/nsXREDirProvider.cpp
---- a/toolkit/xre/nsXREDirProvider.cpp
-+++ b/toolkit/xre/nsXREDirProvider.cpp
-@@ -300,19 +300,16 @@ nsXREDirProvider::GetFile(const char* aP
- }
- }
- else if (!strcmp(aProperty, XRE_EXECUTABLE_FILE) && gArgv[0]) {
- nsCOMPtr<nsILocalFile> lf;
- rv = XRE_GetBinaryPath(gArgv[0], getter_AddRefs(lf));
- if (NS_SUCCEEDED(rv))
- file = lf;
- }
-- else if (!strcmp(aProperty, "resource:app")) {
-- rv = GetAppDir()->Clone(getter_AddRefs(file));
-- }
-
- else if (!strcmp(aProperty, NS_APP_PROFILE_DIR_STARTUP) && mProfileDir) {
- return mProfileDir->Clone(aFile);
- }
- else if (!strcmp(aProperty, NS_APP_PROFILE_LOCAL_DIR_STARTUP)) {
- if (mProfileLocalDir)
- return mProfileLocalDir->Clone(aFile);
-
-# HG changeset patch
-# Parent 7d2228db71a299afca60babff632a967d2d6c456
-Bug 620931 part 5 - Enable omni.jar by default on xulrunner
-
-diff --git a/xulrunner/confvars.sh b/xulrunner/confvars.sh
---- a/xulrunner/confvars.sh
-+++ b/xulrunner/confvars.sh
-@@ -36,15 +36,16 @@
- #
- # ***** END LICENSE BLOCK *****
-
- MOZ_APP_NAME=xulrunner
- MOZ_APP_DISPLAYNAME=XULRunner
+diff -up xulrunner-5.0/mozilla-release/xulrunner/confvars.sh.omnijar xulrunner-5.0/mozilla-release/xulrunner/confvars.sh
+--- xulrunner-5.0/mozilla-release/xulrunner/confvars.sh.omnijar 2011-06-15 23:58:02.000000000 +0200
++++ xulrunner-5.0/mozilla-release/xulrunner/confvars.sh 2011-06-21 12:46:33.578166451 +0200
+@@ -41,6 +41,7 @@ MOZ_APP_DISPLAYNAME=XULRunner
MOZ_UPDATER=1
MOZ_XULRUNNER=1
MOZ_ENABLE_LIBXUL=1
@@ -1731,7 +1318,3 @@ diff --git a/xulrunner/confvars.sh b/xulrunner/confvars.sh
MOZ_STATIC_BUILD_UNSUPPORTED=1
MOZ_APP_VERSION=$MOZILLA_VERSION
if test "$MOZ_STORAGE"; then
- MOZ_PLACES=1
- fi
- MOZ_EXTENSIONS_DEFAULT=" gnomevfs"
- MOZ_URL_CLASSIFIER=1
diff --git a/xulrunner.spec b/xulrunner.spec
index ab9b29c..5071828 100644
--- a/xulrunner.spec
+++ b/xulrunner.spec
@@ -16,7 +16,7 @@
%global rc_version 0
%global mozappdir %{_libdir}/%{name}-%{gecko_dir_ver}
-%global tarballdir mozilla-2.0
+%global tarballdir mozilla-release
%global gre_dir %{_sysconfdir}/gre.d
# crash reporter and out-of-process-plugins work only on x86/x86_64
@@ -59,7 +59,7 @@
Summary: XUL Runtime for Gecko Applications
Name: xulrunner
-Version: 2.0.1
+Version: 5.0
Release: 1%{?pre_tag}%{?dist}
URL: http://developer.mozilla.org/En/XULRunner
License: MPLv1.1 or GPLv2+ or LGPLv2+
@@ -75,7 +75,6 @@ Source21: %{name}.sh.in
Patch0: xulrunner-version.patch
Patch1: mozilla-build.patch
Patch9: mozilla-build-sbrk.patch
-Patch12: xulrunner-2.0-64bit-big-endian.patch
Patch13: xulrunner-2.0-secondary-jit.patch
Patch14: xulrunner-2.0-chromium-types.patch
@@ -90,7 +89,7 @@ Patch32: firefox-4.0-moz-app-launcher.patch
Patch33: firefox-4.0-gnome3.patch
Patch34: xulrunner-2.0-network-link-service.patch
Patch35: xulrunner-2.0-NetworkManager09.patch
-Patch36: xulrunner-omnijar.patch
+Patch36: xulrunner-omnijar-5.patch
# ---------------------------------------------------
@@ -201,7 +200,6 @@ sed -e 's/__RPM_VERSION_INTERNAL__/%{gecko_dir_ver}/' %{P:%%PATCH0} \
%patch1 -p2 -b .build
%patch9 -p2 -b .sbrk
-%patch12 -p2 -b .64bit-big-endian
%patch13 -p2 -b .secondary-jit
%patch14 -p2 -b .chromium-types
@@ -212,9 +210,9 @@ sed -e 's/__RPM_VERSION_INTERNAL__/%{gecko_dir_ver}/' %{P:%%PATCH0} \
%patch32 -p1 -b .moz-app-launcher
%patch33 -p1 -b .gnome3
-%patch34 -p1 -b .network-link-service
+%patch34 -p2 -b .network-link-service
%patch35 -p1 -b .NetworkManager09
-%patch36 -p1 -b .omnijar
+%patch36 -p2 -b .omnijar
%{__rm} -f .mozconfig
%{__cp} %{SOURCE10} .mozconfig
@@ -376,10 +374,10 @@ done
popd
# GRE stuff
-MOZILLA_GECKO_VERSION=`./config/milestone.pl --topsrcdir=.`
-%{__mv} $RPM_BUILD_ROOT%{gre_dir}/$MOZILLA_GECKO_VERSION".system.conf" \
- $RPM_BUILD_ROOT%{gre_dir}/%{gre_conf_file}
-chmod 644 $RPM_BUILD_ROOT%{gre_dir}/%{gre_conf_file}
+#MOZILLA_GECKO_VERSION=`./config/milestone.pl --topsrcdir=.`
+#%{__mv} $RPM_BUILD_ROOT%{gre_dir}/$MOZILLA_GECKO_VERSION".system.conf" \
+# $RPM_BUILD_ROOT%{gre_dir}/%{gre_conf_file}
+#chmod 644 $RPM_BUILD_ROOT%{gre_dir}/%{gre_conf_file}
# Library path
LD_SO_CONF_D=%{_sysconfdir}/ld.so.conf.d
@@ -425,8 +423,8 @@ fi
%files
%defattr(-,root,root,-)
%{_bindir}/xulrunner
-%dir %{_sysconfdir}/gre.d
-%{_sysconfdir}/gre.d/gre*.conf
+#%dir %{_sysconfdir}/gre.d
+#%{_sysconfdir}/gre.d/gre*.conf
%dir %{mozappdir}
%doc %attr(644, root, root) %{mozappdir}/LICENSE
%doc %attr(644, root, root) %{mozappdir}/README.txt
@@ -455,10 +453,6 @@ fi
%{mozappdir}/plugin-container
%endif
-# XXX See if these are needed still
-%{mozappdir}/updater*
-%exclude %{mozappdir}/update.locale
-
%if %{enable_mozilla_crashreporter}
%{mozappdir}/crashreporter
%{mozappdir}/crashreporter.ini
@@ -479,6 +473,9 @@ fi
#---------------------------------------------------------------------
%changelog
+* Tue Jun 21 2011 Martin Stransky <stransky at redhat.com> 5.0-1
+- 5.0
+
* Thu Apr 28 2011 Christopher Aillon <caillon at redhat.com> - 2.0.1-1
- 2.0.1
More information about the scm-commits
mailing list