new file mode 100644
--- /dev/null
+++ b/browser/components/BrowserComponents.manifest
@@ -0,0 +1,30 @@
+component {5d0ce354-df01-421a-83fb-7ead0990c24e} nsBrowserContentHandler.js application={ec8030f7-c20a-464f-9b0e-13a3a9e97384}
+contract @mozilla.org/browser/clh;1 {5d0ce354-df01-421a-83fb-7ead0990c24e} application={ec8030f7-c20a-464f-9b0e-13a3a9e97384}
+component {47cd0651-b1be-4a0f-b5c4-10e5a573ef71} nsBrowserContentHandler.js application={ec8030f7-c20a-464f-9b0e-13a3a9e97384}
+contract @mozilla.org/browser/final-clh;1 {47cd0651-b1be-4a0f-b5c4-10e5a573ef71} application={ec8030f7-c20a-464f-9b0e-13a3a9e97384}
+contract @mozilla.org/uriloader/content-handler;1?type=text/html {5d0ce354-df01-421a-83fb-7ead0990c24e} application={ec8030f7-c20a-464f-9b0e-13a3a9e97384}
+contract @mozilla.org/uriloader/content-handler;1?type=application/vnd.mozilla.xul+xml {5d0ce354-df01-421a-83fb-7ead0990c24e} application={ec8030f7-c20a-464f-9b0e-13a3a9e97384}
+#ifdef MOZ_SVG
+contract @mozilla.org/uriloader/content-handler;1?type=image/svg+xml {5d0ce354-df01-421a-83fb-7ead0990c24e} application={ec8030f7-c20a-464f-9b0e-13a3a9e97384}
+#endif
+contract @mozilla.org/uriloader/content-handler;1?type=text/rdf {5d0ce354-df01-421a-83fb-7ead0990c24e} application={ec8030f7-c20a-464f-9b0e-13a3a9e97384}
+contract @mozilla.org/uriloader/content-handler;1?type=text/xml {5d0ce354-df01-421a-83fb-7ead0990c24e} application={ec8030f7-c20a-464f-9b0e-13a3a9e97384}
+contract @mozilla.org/uriloader/content-handler;1?type=application/xhtml+xml {5d0ce354-df01-421a-83fb-7ead0990c24e} application={ec8030f7-c20a-464f-9b0e-13a3a9e97384}
+contract @mozilla.org/uriloader/content-handler;1?type=text/css {5d0ce354-df01-421a-83fb-7ead0990c24e} application={ec8030f7-c20a-464f-9b0e-13a3a9e97384}
+contract @mozilla.org/uriloader/content-handler;1?type=text/plain {5d0ce354-df01-421a-83fb-7ead0990c24e} application={ec8030f7-c20a-464f-9b0e-13a3a9e97384}
+contract @mozilla.org/uriloader/content-handler;1?type=image/gif {5d0ce354-df01-421a-83fb-7ead0990c24e} application={ec8030f7-c20a-464f-9b0e-13a3a9e97384}
+contract @mozilla.org/uriloader/content-handler;1?type=image/jpeg {5d0ce354-df01-421a-83fb-7ead0990c24e} application={ec8030f7-c20a-464f-9b0e-13a3a9e97384}
+contract @mozilla.org/uriloader/content-handler;1?type=image/jpg {5d0ce354-df01-421a-83fb-7ead0990c24e} application={ec8030f7-c20a-464f-9b0e-13a3a9e97384}
+contract @mozilla.org/uriloader/content-handler;1?type=image/png {5d0ce354-df01-421a-83fb-7ead0990c24e} application={ec8030f7-c20a-464f-9b0e-13a3a9e97384}
+contract @mozilla.org/uriloader/content-handler;1?type=image/bmp {5d0ce354-df01-421a-83fb-7ead0990c24e} application={ec8030f7-c20a-464f-9b0e-13a3a9e97384}
+contract @mozilla.org/uriloader/content-handler;1?type=image/x-icon {5d0ce354-df01-421a-83fb-7ead0990c24e} application={ec8030f7-c20a-464f-9b0e-13a3a9e97384}
+contract @mozilla.org/uriloader/content-handler;1?type=image/vnd.microsoft.icon {5d0ce354-df01-421a-83fb-7ead0990c24e} application={ec8030f7-c20a-464f-9b0e-13a3a9e97384}
+contract @mozilla.org/uriloader/content-handler;1?type=application/http-index-format {5d0ce354-df01-421a-83fb-7ead0990c24e} application={ec8030f7-c20a-464f-9b0e-13a3a9e97384}
+category command-line-handler m-browser @mozilla.org/browser/clh;1 application={ec8030f7-c20a-464f-9b0e-13a3a9e97384}
+category command-line-handler x-default @mozilla.org/browser/final-clh;1 application={ec8030f7-c20a-464f-9b0e-13a3a9e97384}
+category command-line-validator b-browser @mozilla.org/browser/clh;1 application={ec8030f7-c20a-464f-9b0e-13a3a9e97384}
+component {eab9012e-5f74-4cbc-b2b5-a590235513cc} nsBrowserGlue.js application={ec8030f7-c20a-464f-9b0e-13a3a9e97384}
+contract @mozilla.org/browser/browserglue;1 {eab9012e-5f74-4cbc-b2b5-a590235513cc} application={ec8030f7-c20a-464f-9b0e-13a3a9e97384}
+category app-startup nsBrowserGlue service,@mozilla.org/browser/browserglue;1 application={ec8030f7-c20a-464f-9b0e-13a3a9e97384}
+component {C6E8C44D-9F39-4AF7-BCC0-76E38A8310F5} nsBrowserGlue.js application={ec8030f7-c20a-464f-9b0e-13a3a9e97384}
+contract @mozilla.org/geolocation/prompt;1 {C6E8C44D-9F39-4AF7-BCC0-76E38A8310F5} application={ec8030f7-c20a-464f-9b0e-13a3a9e97384}
--- a/browser/components/Makefile.in
+++ b/browser/components/Makefile.in
@@ -46,16 +46,17 @@ MODULE = browsercomps
XPIDL_MODULE = browsercompsbase
XPIDLSRCS = \
nsIBrowserGlue.idl \
nsIBrowserHandler.idl \
$(NULL)
EXTRA_PP_COMPONENTS = \
+ BrowserComponents.manifest \
nsBrowserContentHandler.js \
nsBrowserGlue.js \
$(NULL)
EXTRA_JS_MODULES = distribution.js
PARALLEL_DIRS = \
about \
new file mode 100644
--- /dev/null
+++ b/browser/components/feeds/src/BrowserFeeds.manifest
@@ -0,0 +1,16 @@
+component {229fa115-9412-4d32-baf3-2fc407f76fb1} FeedConverter.js
+contract @mozilla.org/streamconv;1?from=application/vnd.mozilla.maybe.feed&to=*/* {229fa115-9412-4d32-baf3-2fc407f76fb1}
+contract @mozilla.org/streamconv;1?from=application/vnd.mozilla.maybe.video.feed&to=*/* {229fa115-9412-4d32-baf3-2fc407f76fb1}
+contract @mozilla.org/streamconv;1?from=application/vnd.mozilla.maybe.audio.feed&to=*/* {229fa115-9412-4d32-baf3-2fc407f76fb1}
+component {2376201c-bbc6-472f-9b62-7548040a61c6} FeedConverter.js
+contract @mozilla.org/browser/feeds/result-service;1 {2376201c-bbc6-472f-9b62-7548040a61c6}
+component {4f91ef2e-57ba-472e-ab7a-b4999e42d6c0} FeedConverter.js
+contract @mozilla.org/network/protocol;1?name=feed {4f91ef2e-57ba-472e-ab7a-b4999e42d6c0}
+component {1c31ed79-accd-4b94-b517-06e0c81999d5} FeedConverter.js
+contract @mozilla.org/network/protocol;1?name=pcast {1c31ed79-accd-4b94-b517-06e0c81999d5}
+component {49bb6593-3aff-4eb3-a068-2712c28bd58e} FeedWriter.js
+contract @mozilla.org/browser/feeds/result-writer;1 {49bb6593-3aff-4eb3-a068-2712c28bd58e}
+category JavaScript-global-constructor FeedWriter @mozilla.org/browser/feeds/result-writer;1
+component {792a7e82-06a0-437c-af63-b2d12e808acc} WebContentConverter.js
+contract @mozilla.org/embeddor.implemented/web-content-handler-registrar;1 {792a7e82-06a0-437c-af63-b2d12e808acc}
+category app-startup WebContentConverter service,@mozilla.org/embeddor.implemented/web-content-handler-registrar;1
\ No newline at end of file
--- a/browser/components/feeds/src/FeedConverter.js
+++ b/browser/components/feeds/src/FeedConverter.js
@@ -32,37 +32,30 @@
# use your version of this file under the terms of the MPL, indicate your
# decision by deleting the provisions above and replace them with the notice
# 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 ***** */
+Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
Components.utils.import("resource://gre/modules/debug.js");
const Cc = Components.classes;
const Ci = Components.interfaces;
const Cr = Components.results;
function LOG(str) {
dump("*** " + str + "\n");
}
-const FC_CLASSID = Components.ID("{229fa115-9412-4d32-baf3-2fc407f76fb1}");
-const FC_CLASSNAME = "Feed Stream Converter";
-const FS_CLASSID = Components.ID("{2376201c-bbc6-472f-9b62-7548040a61c6}");
-const FS_CLASSNAME = "Feed Result Service";
const FS_CONTRACTID = "@mozilla.org/browser/feeds/result-service;1";
const FPH_CONTRACTID = "@mozilla.org/network/protocol;1?name=feed";
-const FPH_CLASSID = Components.ID("{4f91ef2e-57ba-472e-ab7a-b4999e42d6c0}");
-const FPH_CLASSNAME = "Feed Protocol Handler";
const PCPH_CONTRACTID = "@mozilla.org/network/protocol;1?name=pcast";
-const PCPH_CLASSID = Components.ID("{1c31ed79-accd-4b94-b517-06e0c81999d5}");
-const PCPH_CLASSNAME = "Podcast Protocol Handler";
const TYPE_MAYBE_FEED = "application/vnd.mozilla.maybe.feed";
const TYPE_MAYBE_VIDEO_FEED = "application/vnd.mozilla.maybe.video.feed";
const TYPE_MAYBE_AUDIO_FEED = "application/vnd.mozilla.maybe.audio.feed";
const TYPE_ANY = "*/*";
const FEEDHANDLER_URI = "about:feeds";
@@ -143,16 +136,18 @@ function safeGetCharPref(pref, defaultVa
catch (e) {
}
return defaultValue;
}
function FeedConverter() {
}
FeedConverter.prototype = {
+ classID: Components.ID("{229fa115-9412-4d32-baf3-2fc407f76fb1}"),
+
/**
* This is the downloaded text data for the feed.
*/
_data: null,
/**
* This is the object listening to the conversion, which is ultimately the
* docshell for the load.
@@ -363,36 +358,25 @@ FeedConverter.prototype = {
iid.equals(Ci.nsIStreamListener) ||
iid.equals(Ci.nsIRequestObserver)||
iid.equals(Ci.nsISupports))
return this;
throw Cr.NS_ERROR_NO_INTERFACE;
},
};
-var FeedConverterFactory = {
- createInstance: function FS_createInstance(outer, iid) {
- if (outer != null)
- throw Cr.NS_ERROR_NO_AGGREGATION;
- return new FeedConverter().QueryInterface(iid);
- },
-
- QueryInterface: function FS_QueryInterface(iid) {
- if (iid.equals(Ci.nsIFactory) ||
- iid.equals(Ci.nsISupports))
- return this;
- throw Cr.NS_ERROR_NO_INTERFACE;
- },
-};
-
/**
* Keeps parsed FeedResults around for use elsewhere in the UI after the stream
* converter completes.
*/
-var FeedResultService = {
+function FeedResultService()
+{ }
+
+FeedResultService.prototype = {
+ classID: Components.ID("{2376201c-bbc6-472f-9b62-7548040a61c6}"),
/**
* A URI spec -> [nsIFeedResult] hash. We have to keep a list as the
* value in case the same URI is requested concurrently.
*/
_results: { },
/**
@@ -529,25 +513,26 @@ var FeedResultService = {
throw Cr.NS_ERROR_NOT_IMPLEMENTED;
},
};
/**
* A protocol handler that attempts to deal with the variant forms of feed:
* URIs that are actually either http or https.
*/
-function FeedProtocolHandler(scheme) {
- this._scheme = scheme;
- var ios =
+function GenericProtocolHandler() {
+}
+FeedProtocolHandler.prototype = {
+ _init: function FPH_init() {
+ var ios =
Cc["@mozilla.org/network/io-service;1"].
getService(Ci.nsIIOService);
- this._http = ios.getProtocolHandler("http");
-}
-FeedProtocolHandler.prototype = {
- _scheme: "",
+ this._http = ios.getProtocolHandler("http");
+ },
+
get scheme() {
return this._scheme;
},
get protocolFlags() {
return this._http.protocolFlags;
},
@@ -613,77 +598,26 @@ FeedProtocolHandler.prototype = {
QueryInterface: function FPH_QueryInterface(iid) {
if (iid.equals(Ci.nsIProtocolHandler) ||
iid.equals(Ci.nsISupports))
return this;
throw Cr.NS_ERROR_NO_INTERFACE;
}
};
-var Module = {
- QueryInterface: function M_QueryInterface(iid) {
- if (iid.equals(Ci.nsIModule) ||
- iid.equals(Ci.nsISupports))
- return this;
- throw Cr.NS_ERROR_NO_INTERFACE;
- },
-
- getClassObject: function M_getClassObject(cm, cid, iid) {
- if (!iid.equals(Ci.nsIFactory))
- throw Cr.NS_ERROR_NOT_IMPLEMENTED;
-
- if (cid.equals(FS_CLASSID))
- return FeedResultService;
- if (cid.equals(FPH_CLASSID))
- return new GenericComponentFactory(FeedProtocolHandler, "feed");
- if (cid.equals(PCPH_CLASSID))
- return new GenericComponentFactory(FeedProtocolHandler, "pcast");
- if (cid.equals(FC_CLASSID))
- return new GenericComponentFactory(FeedConverter);
-
- throw Cr.NS_ERROR_NO_INTERFACE;
- },
-
- registerSelf: function M_registerSelf(cm, file, location, type) {
- var cr = cm.QueryInterface(Ci.nsIComponentRegistrar);
-
- cr.registerFactoryLocation(FS_CLASSID, FS_CLASSNAME, FS_CONTRACTID,
- file, location, type);
- cr.registerFactoryLocation(FPH_CLASSID, FPH_CLASSNAME, FPH_CONTRACTID,
- file, location, type);
- cr.registerFactoryLocation(PCPH_CLASSID, PCPH_CLASSNAME, PCPH_CONTRACTID,
- file, location, type);
+function FeedProtocolHandler()
+{
+ this._init();
+}
+FeedProtocolHandler.prototype = new GenericProtocolHandler();
+FeedProtocolHandler.prototype._scheme = "feed";
+FeedProtocolHandler.classID = Components.ID("{4f91ef2e-57ba-472e-ab7a-b4999e42d6c0}");
- // The feed converter is always attached, since parsing must be done to
- // determine whether or not auto-handling can occur.
- const converterPrefix = "@mozilla.org/streamconv;1?from=";
- var converterContractID =
- converterPrefix + TYPE_MAYBE_FEED + "&to=" + TYPE_ANY;
- cr.registerFactoryLocation(FC_CLASSID, FC_CLASSNAME, converterContractID,
- file, location, type);
-
- converterContractID =
- converterPrefix + TYPE_MAYBE_VIDEO_FEED + "&to=" + TYPE_ANY;
- cr.registerFactoryLocation(FC_CLASSID, FC_CLASSNAME, converterContractID,
- file, location, type);
+function PCastProtocolHandler()
+{
+ this._init();
+}
+PCastProtocolHandler.prototype = new GenericProtocolHandler();
+PCastProtocolHandler.prototype._scheme = "pcast";
+PCastProtocolHandler.prototype.classID = Components.ID("{1c31ed79-accd-4b94-b517-06e0c81999d5}");
- converterContractID =
- converterPrefix + TYPE_MAYBE_AUDIO_FEED + "&to=" + TYPE_ANY;
- cr.registerFactoryLocation(FC_CLASSID, FC_CLASSNAME, converterContractID,
- file, location, type);
- },
-
- unregisterSelf: function M_unregisterSelf(cm, location, type) {
- var cr = cm.QueryInterface(Ci.nsIComponentRegistrar);
- cr.unregisterFactoryLocation(FPH_CLASSID, location);
- cr.unregisterFactoryLocation(PCPH_CLASSID, location);
- },
-
- canUnload: function M_canUnload(cm) {
- return true;
- }
-};
-
-function NSGetModule(cm, file) {
- return Module;
-}
-
-#include GenericFactory.js
+var components = [FeedConverter, FeedResultService, FeedProtocolHandler, PCastProtocolHandler];
+var NSGetFactory = XPCOMUtils.generateNSGetFactory(components);
--- a/browser/components/feeds/src/FeedWriter.js
+++ b/browser/components/feeds/src/FeedWriter.js
@@ -1411,22 +1411,17 @@ FeedWriter.prototype = {
// nsIClassInfo
getInterfaces: function FW_getInterfaces(countRef) {
var interfaces = [Ci.nsIFeedWriter, Ci.nsIClassInfo, Ci.nsISupports];
countRef.value = interfaces.length;
return interfaces;
},
getHelperForLanguage: function FW_getHelperForLanguage(language) null,
- contractID: "@mozilla.org/browser/feeds/result-writer;1",
- classDescription: "Feed Writer",
classID: Components.ID("{49bb6593-3aff-4eb3-a068-2712c28bd58e}"),
implementationLanguage: Ci.nsIProgrammingLanguage.JAVASCRIPT,
flags: Ci.nsIClassInfo.DOM_OBJECT,
- _xpcom_categories: [{ category: "JavaScript-global-constructor",
- entry: "BrowserFeedWriter"}],
QueryInterface: XPCOMUtils.generateQI([Ci.nsIFeedWriter, Ci.nsIClassInfo,
Ci.nsIDOMEventListener, Ci.nsIObserver,
Ci.nsINavHistoryObserver])
};
-function NSGetModule(cm, file)
- XPCOMUtils.generateModule([FeedWriter]);
+var NSGetFactory = XPCOMUtils.generateNSGetFactory([FeedWriter]);
--- a/browser/components/feeds/src/Makefile.in
+++ b/browser/components/feeds/src/Makefile.in
@@ -49,16 +49,20 @@ ifndef MOZ_MEMORY
USE_STATIC_LIBS = 1
endif
DEFINES += \
-DMOZ_APP_NAME=$(MOZ_APP_NAME) \
-DMOZ_APP_DISPLAYNAME=$(MOZ_APP_DISPLAYNAME) \
$(NULL)
+EXTRA_COMPONENTS = \
+ BrowserFeeds.manifest \
+ $(NULL)
+
EXTRA_PP_COMPONENTS = \
FeedConverter.js \
FeedWriter.js \
WebContentConverter.js \
$(NULL)
CPPSRCS = nsFeedSniffer.cpp
--- a/browser/components/feeds/src/WebContentConverter.js
+++ b/browser/components/feeds/src/WebContentConverter.js
@@ -44,17 +44,16 @@ const Ci = Components.interfaces;
const Cr = Components.results;
function LOG(str) {
dump("*** " + str + "\n");
}
const WCCR_CONTRACTID = "@mozilla.org/embeddor.implemented/web-content-handler-registrar;1";
const WCCR_CLASSID = Components.ID("{792a7e82-06a0-437c-af63-b2d12e808acc}");
-const WCCR_CLASSNAME = "Web Content Handler Registrar";
const WCC_CLASSID = Components.ID("{db7ebf28-cc40-415f-8a51-1b111851df1e}");
const WCC_CLASSNAME = "Web Service Handler";
const TYPE_MAYBE_FEED = "application/vnd.mozilla.maybe.feed";
const TYPE_ANY = "*/*";
const PREF_CONTENTHANDLERS_AUTO = "browser.contentHandlers.auto.";
@@ -920,18 +919,16 @@ WebContentConverterRegistrar.prototype =
[Ci.nsIWebContentConverterService, Ci.nsIWebContentHandlerRegistrar,
Ci.nsIObserver, Ci.nsIClassInfo, Ci.nsIFactory, Ci.nsISupports];
countRef.value = interfaces.length;
return interfaces;
},
getHelperForLanguage: function WCCR_getHelperForLanguage(language) {
return null;
},
- contractID: WCCR_CONTRACTID,
- classDescription: WCCR_CLASSNAME,
classID: WCCR_CLASSID,
implementationLanguage: Ci.nsIProgrammingLanguage.JAVASCRIPT,
flags: Ci.nsIClassInfo.DOM_OBJECT,
/**
* See nsISupports
*/
QueryInterface: XPCOMUtils.generateQI(
@@ -943,12 +940,9 @@ WebContentConverterRegistrar.prototype =
Ci.nsISupports]),
_xpcom_categories: [{
category: "app-startup",
service: true
}]
};
-function NSGetModule(cm, file) {
- return XPCOMUtils.generateModule([WebContentConverterRegistrar]);
-}
-
+var NSGetFactory = XPCOMUtils.generateNSGetFactory([WebContentConverterRegistrar]);
--- a/browser/components/nsBrowserContentHandler.js
+++ b/browser/components/nsBrowserContentHandler.js
@@ -31,29 +31,30 @@
# use your version of this file under the terms of the MPL, indicate your
# decision by deleting the provisions above and replace them with the notice
# 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 *****
+Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
+
const nsISupports = Components.interfaces.nsISupports;
const nsIBrowserDOMWindow = Components.interfaces.nsIBrowserDOMWindow;
const nsIBrowserHandler = Components.interfaces.nsIBrowserHandler;
const nsIBrowserHistory = Components.interfaces.nsIBrowserHistory;
const nsIChannel = Components.interfaces.nsIChannel;
const nsICommandLine = Components.interfaces.nsICommandLine;
const nsICommandLineHandler = Components.interfaces.nsICommandLineHandler;
const nsIContentHandler = Components.interfaces.nsIContentHandler;
const nsIDocShellTreeItem = Components.interfaces.nsIDocShellTreeItem;
const nsIDOMChromeWindow = Components.interfaces.nsIDOMChromeWindow;
const nsIDOMWindow = Components.interfaces.nsIDOMWindow;
-const nsIFactory = Components.interfaces.nsIFactory;
const nsIFileURL = Components.interfaces.nsIFileURL;
const nsIHttpProtocolHandler = Components.interfaces.nsIHttpProtocolHandler;
const nsIInterfaceRequestor = Components.interfaces.nsIInterfaceRequestor;
const nsINetUtil = Components.interfaces.nsINetUtil;
const nsIPrefBranch = Components.interfaces.nsIPrefBranch;
const nsIPrefLocalizedString = Components.interfaces.nsIPrefLocalizedString;
const nsISupportsString = Components.interfaces.nsISupportsString;
const nsIURIFixup = Components.interfaces.nsIURIFixup;
@@ -319,24 +320,37 @@ function doSearch(searchTerm, cmdLine) {
sa.AppendElement(submission.postData);
// XXXbsmedberg: use handURIToExistingBrowser to obey tabbed-browsing
// preferences, but need nsIBrowserDOMWindow extensions
var wwatch = Components.classes["@mozilla.org/embedcomp/window-watcher;1"]
.getService(nsIWindowWatcher);
- return wwatch.openWindow(null, nsBrowserContentHandler.chromeURL,
+ return wwatch.openWindow(null, gBrowserContentHandler.chromeURL,
"_blank",
"chrome,dialog=no,all" +
- nsBrowserContentHandler.getFeatures(cmdLine),
+ gBrowserContentHandler.getFeatures(cmdLine),
sa);
}
-var nsBrowserContentHandler = {
+function nsBrowserContentHandler()
+{
+}
+nsBrowserContentHandler.prototype = {
+ classID: Components.ID("{5d0ce354-df01-421a-83fb-7ead0990c24e}"),
+
+ _xpcom_factory: {
+ createInstance: function bch_factory_ci(outer, iid) {
+ if (outer)
+ throw Components.results.NS_ERROR_NO_AGGREGATION;
+ return gBrowserContentHandler.QueryInterface(iid);
+ }
+ },
+
/* helper functions */
mChromeURL : null,
get chromeURL() {
if (this.mChromeURL) {
return this.mChromeURL;
}
@@ -349,18 +363,17 @@ var nsBrowserContentHandler = {
},
/* nsISupports */
QueryInterface : function bch_QI(iid) {
if (!iid.equals(nsISupports) &&
!iid.equals(nsICommandLineHandler) &&
!iid.equals(nsIBrowserHandler) &&
!iid.equals(nsIContentHandler) &&
- !iid.equals(nsICommandLineValidator) &&
- !iid.equals(nsIFactory))
+ !iid.equals(nsICommandLineValidator))
throw Components.results.NS_ERROR_NO_INTERFACE;
return this;
},
/* nsICommandLineHandler */
handle : function bch_handle(cmdLine) {
if (cmdLine.handleFlag("browser", false)) {
@@ -688,65 +701,56 @@ var nsBrowserContentHandler = {
if (urlFlagIdx > -1 && (osintFlagIdx > -1 ||
cmdLine.state == nsICommandLine.STATE_REMOTE_EXPLICIT)) {
var urlParam = cmdLine.getArgument(urlFlagIdx + 1);
if (cmdLine.length != urlFlagIdx + 2 || /firefoxurl:/.test(urlParam))
throw NS_ERROR_ABORT;
cmdLine.handleFlag("osint", false)
}
},
-
- /* nsIFactory */
- createInstance: function bch_CI(outer, iid) {
- if (outer != null)
- throw Components.results.NS_ERROR_NO_AGGREGATION;
+};
+var gBrowserContentHandler = new nsBrowserContentHandler();
- return this.QueryInterface(iid);
- },
-
- lockFactory : function bch_lock(lock) {
- /* no-op */
- }
-};
-
-const bch_contractID = "@mozilla.org/browser/clh;1";
-const bch_CID = Components.ID("{5d0ce354-df01-421a-83fb-7ead0990c24e}");
const CONTRACTID_PREFIX = "@mozilla.org/uriloader/content-handler;1?type=";
function handURIToExistingBrowser(uri, location, cmdLine)
{
if (!shouldLoadURI(uri))
return;
var navWin = getMostRecentBrowserWindow();
if (!navWin) {
// if we couldn't load it in an existing window, open a new one
- openWindow(null, nsBrowserContentHandler.chromeURL, "_blank",
- "chrome,dialog=no,all" + nsBrowserContentHandler.getFeatures(cmdLine),
+ openWindow(null, gBrowserContentHandler.chromeURL, "_blank",
+ "chrome,dialog=no,all" + gBrowserContentHandler.getFeatures(cmdLine),
uri.spec);
return;
}
var navNav = navWin.QueryInterface(nsIInterfaceRequestor)
.getInterface(nsIWebNavigation);
var rootItem = navNav.QueryInterface(nsIDocShellTreeItem).rootTreeItem;
var rootWin = rootItem.QueryInterface(nsIInterfaceRequestor)
.getInterface(nsIDOMWindow);
var bwin = rootWin.QueryInterface(nsIDOMChromeWindow).browserDOMWindow;
bwin.openURI(uri, null, location,
nsIBrowserDOMWindow.OPEN_EXTERNAL);
}
+function nsDefaultCommandLineHandler()
+{
+}
-var nsDefaultCommandLineHandler = {
+nsDefaultCommandLineHandler.prototype = {
+ classID: Components.ID("{47cd0651-b1be-4a0f-b5c4-10e5a573ef71}"),
+
/* nsISupports */
QueryInterface : function dch_QI(iid) {
if (!iid.equals(nsISupports) &&
- !iid.equals(nsICommandLineHandler) &&
- !iid.equals(nsIFactory))
+ !iid.equals(nsICommandLineHandler))
throw Components.results.NS_ERROR_NO_INTERFACE;
return this;
},
// List of uri's that were passed via the command line without the app
// running and have already been handled. This is compared against uri's
// opened using DDE on Win32 so we only open one of the requests.
@@ -838,155 +842,28 @@ var nsDefaultCommandLineHandler = {
return;
}
catch (e) {
}
}
var URLlist = urilist.filter(shouldLoadURI).map(function (u) u.spec);
if (URLlist.length) {
- openWindow(null, nsBrowserContentHandler.chromeURL, "_blank",
- "chrome,dialog=no,all" + nsBrowserContentHandler.getFeatures(cmdLine),
+ openWindow(null, gBrowserContentHandler.chromeURL, "_blank",
+ "chrome,dialog=no,all" + gBrowserContentHandler.getFeatures(cmdLine),
URLlist);
}
}
else if (!cmdLine.preventDefault) {
// Passing defaultArgs, so use NO_EXTERNAL_URIS
- openWindow(null, nsBrowserContentHandler.chromeURL, "_blank",
- "chrome,dialog=no,all" + nsBrowserContentHandler.getFeatures(cmdLine),
- nsBrowserContentHandler.defaultArgs, NO_EXTERNAL_URIS);
+ openWindow(null, gBrowserContentHandler.chromeURL, "_blank",
+ "chrome,dialog=no,all" + gBrowserContentHandler.getFeatures(cmdLine),
+ gBrowserContentHandler.defaultArgs, NO_EXTERNAL_URIS);
}
},
// XXX localize me... how?
helpInfo : "Usage: firefox [-flags] [<url>]\n",
-
- /* nsIFactory */
- createInstance: function dch_CI(outer, iid) {
- if (outer != null)
- throw Components.results.NS_ERROR_NO_AGGREGATION;
-
- return this.QueryInterface(iid);
- },
-
- lockFactory : function dch_lock(lock) {
- /* no-op */
- }
};
-const dch_contractID = "@mozilla.org/browser/final-clh;1";
-const dch_CID = Components.ID("{47cd0651-b1be-4a0f-b5c4-10e5a573ef71}");
-
-var Module = {
- /* nsISupports */
- QueryInterface: function mod_QI(iid) {
- if (iid.equals(Components.interfaces.nsIModule) ||
- iid.equals(Components.interfaces.nsISupports))
- return this;
-
- throw Components.results.NS_ERROR_NO_INTERFACE;
- },
-
- /* nsIModule */
- getClassObject: function mod_getco(compMgr, cid, iid) {
- if (cid.equals(bch_CID))
- return nsBrowserContentHandler.QueryInterface(iid);
-
- if (cid.equals(dch_CID))
- return nsDefaultCommandLineHandler.QueryInterface(iid);
-
- throw Components.results.NS_ERROR_NO_INTERFACE;
- },
-
- registerSelf: function mod_regself(compMgr, fileSpec, location, type) {
- if (Components.classes["@mozilla.org/xre/app-info;1"]) {
- // Don't register these if Firefox is launching a XULRunner application
- const FIREFOX_UID = "{ec8030f7-c20a-464f-9b0e-13a3a9e97384}";
- var appInfo = Components.classes["@mozilla.org/xre/app-info;1"]
- .getService(Components.interfaces.nsIXULAppInfo);
- if (appInfo.ID != FIREFOX_UID)
- return;
- }
-
- var compReg =
- compMgr.QueryInterface( Components.interfaces.nsIComponentRegistrar );
-
- compReg.registerFactoryLocation( bch_CID,
- "nsBrowserContentHandler",
- bch_contractID,
- fileSpec,
- location,
- type );
- compReg.registerFactoryLocation( dch_CID,
- "nsDefaultCommandLineHandler",
- dch_contractID,
- fileSpec,
- location,
- type );
-
- function registerType(contentType) {
- compReg.registerFactoryLocation( bch_CID,
- "Browser Cmdline Handler",
- CONTRACTID_PREFIX + contentType,
- fileSpec,
- location,
- type );
- }
-
- registerType("text/html");
- registerType("application/vnd.mozilla.xul+xml");
-#ifdef MOZ_SVG
- registerType("image/svg+xml");
-#endif
- registerType("text/rdf");
- registerType("text/xml");
- registerType("application/xhtml+xml");
- registerType("text/css");
- registerType("text/plain");
- registerType("image/gif");
- registerType("image/jpeg");
- registerType("image/jpg");
- registerType("image/png");
- registerType("image/bmp");
- registerType("image/x-icon");
- registerType("image/vnd.microsoft.icon");
- registerType("application/http-index-format");
-
- var catMan = Components.classes["@mozilla.org/categorymanager;1"]
- .getService(nsICategoryManager);
-
- catMan.addCategoryEntry("command-line-handler",
- "m-browser",
- bch_contractID, true, true);
- catMan.addCategoryEntry("command-line-handler",
- "x-default",
- dch_contractID, true, true);
- catMan.addCategoryEntry("command-line-validator",
- "b-browser",
- bch_contractID, true, true);
- },
-
- unregisterSelf : function mod_unregself(compMgr, location, type) {
- var compReg = compMgr.QueryInterface(nsIComponentRegistrar);
- compReg.unregisterFactoryLocation(bch_CID, location);
- compReg.unregisterFactoryLocation(dch_CID, location);
-
- var catMan = Components.classes["@mozilla.org/categorymanager;1"]
- .getService(nsICategoryManager);
-
- catMan.deleteCategoryEntry("command-line-handler",
- "m-browser", true);
- catMan.deleteCategoryEntry("command-line-handler",
- "x-default", true);
- catMan.deleteCategoryEntry("command-line-validator",
- "b-browser", true);
- },
-
- canUnload: function(compMgr) {
- return true;
- }
-};
-
-// NSGetModule: Return the nsIModule object.
-function NSGetModule(compMgr, fileSpec) {
- return Module;
-}
+var components = [nsBrowserContentHandler, nsDefaultCommandLineHandler];
+var NSGetFactory = XPCOMUtils.generateNSGetFactory(components);
--- a/browser/components/nsBrowserGlue.js
+++ b/browser/components/nsBrowserGlue.js
@@ -1229,41 +1229,30 @@ BrowserGlue.prototype = {
return win;
}
return null;
#endif
},
// for XPCOM
- classDescription: "Firefox Browser Glue Service",
classID: Components.ID("{eab9012e-5f74-4cbc-b2b5-a590235513cc}"),
- contractID: "@mozilla.org/browser/browserglue;1",
QueryInterface: XPCOMUtils.generateQI([Ci.nsIObserver,
Ci.nsISupportsWeakReference,
Ci.nsIBrowserGlue]),
// redefine the default factory for XPCOMUtils
_xpcom_factory: BrowserGlueServiceFactory,
-
- // get this contractID registered for certain categories via XPCOMUtils
- _xpcom_categories: [
- // make BrowserGlue a startup observer
- { category: "app-startup", service: true,
- apps: [ /* Firefox */ "{ec8030f7-c20a-464f-9b0e-13a3a9e97384}" ] }
- ]
}
function GeolocationPrompt() {}
GeolocationPrompt.prototype = {
- classDescription: "Geolocation Prompting Component",
classID: Components.ID("{C6E8C44D-9F39-4AF7-BCC0-76E38A8310F5}"),
- contractID: "@mozilla.org/geolocation/prompt;1",
QueryInterface: XPCOMUtils.generateQI([Ci.nsIGeolocationPrompt]),
prompt: function GP_prompt(request) {
var result = Services.perms.testExactPermission(request.requestingURI, "geo");
if (result == Ci.nsIPermissionManager.ALLOW_ACTION) {
request.allow();
@@ -1379,13 +1368,10 @@ GeolocationPrompt.prototype = {
};
chromeWindowObject.setTimeout(geolocation_hacks_to_notification, 0);
}
},
};
-
-//module initialization
-function NSGetModule(aCompMgr, aFileSpec) {
- return XPCOMUtils.generateModule([BrowserGlue, GeolocationPrompt]);
-}
+var components = [BrowserGlue, GeolocationPrompt];
+var NSGetFactory = XPCOMUtils.generateNSGetFactory(components);
new file mode 100644
--- /dev/null
+++ b/browser/components/places/src/BrowserPlaces.manifest
@@ -0,0 +1,4 @@
+component {c0844a84-5a12-4808-80a8-809cb002bb4f} nsPlacesTransactionService.js
+contract @mozilla.org/browser/placesTransactionsService;1 {c0844a84-5a12-4808-80a8-809cb002bb4f}
+component {6bcb9bde-9018-4443-a071-c32653469597} PlacesProtocolHandler.js
+contract @mozilla.org/network/protocol;1?name=place {6bcb9bde-9018-4443-a071-c32653469597}
--- a/browser/components/places/src/Makefile.in
+++ b/browser/components/places/src/Makefile.in
@@ -40,16 +40,17 @@
DEPTH = ../../../..
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
EXTRA_COMPONENTS = \
+ BrowserPlaces.manifest \
nsPlacesTransactionsService.js \
PlacesProtocolHandler.js \
$(NULL)
EXTRA_JS_MODULES = \
PlacesUIUtils.jsm \
$(NULL)
--- a/browser/components/places/src/PlacesProtocolHandler.js
+++ b/browser/components/places/src/PlacesProtocolHandler.js
@@ -71,18 +71,12 @@ PlacesProtocolHandler.prototype = {
allowPort: function PPH_allowPort(aPort, aScheme) {
return false;
},
QueryInterface: XPCOMUtils.generateQI([
Ci.nsIProtocolHandler
]),
- classDescription: "Places Protocol Handler",
- contractID: "@mozilla.org/network/protocol;1?name=" + SCHEME,
classID: Components.ID("{6bcb9bde-9018-4443-a071-c32653469597}")
};
-function NSGetModule(aCompMgr, aFileSpec) {
- return XPCOMUtils.generateModule([
- PlacesProtocolHandler
- ]);
-}
+var NSGetFactory = XPCOMUtils.generateNSGetFactory([PlacesProtocolHandler]);
--- a/browser/components/places/src/nsPlacesTransactionsService.js
+++ b/browser/components/places/src/nsPlacesTransactionsService.js
@@ -42,17 +42,16 @@ let Ci = Components.interfaces;
let Cc = Components.classes;
let Cr = Components.results;
let Cu = Components.utils;
const LOAD_IN_SIDEBAR_ANNO = "bookmarkProperties/loadInSidebar";
const DESCRIPTION_ANNO = "bookmarkProperties/description";
const CLASS_ID = Components.ID("c0844a84-5a12-4808-80a8-809cb002bb4f");
-const CONTRACT_ID = "@mozilla.org/browser/placesTransactionsService;1";
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
XPCOMUtils.defineLazyGetter(this, "Services", function() {
Cu.import("resource://gre/modules/Services.jsm");
return Services;
});
@@ -67,19 +66,17 @@ const MIN_TRANSACTIONS_FOR_BATCH = 5;
function placesTransactionsService() {
Services.obs.addObserver(this, PlacesUtils.TOPIC_SHUTDOWN, false);
this.mTransactionManager = Cc["@mozilla.org/transactionmanager;1"].
createInstance(Ci.nsITransactionManager);
}
placesTransactionsService.prototype = {
- classDescription: "Places Transaction Manager",
classID: CLASS_ID,
- contractID: CONTRACT_ID,
QueryInterface: XPCOMUtils.generateQI([
Ci.nsIPlacesTransactionsService,
Ci.nsITransactionManager,
Ci.nsIObserver,
]),
// nsIObserver
@@ -1182,12 +1179,9 @@ placesUntagURITransaction.prototype = {
PlacesUtils.tagging.untagURI(this._uri, this._tags);
},
undoTransaction: function PUTU_undoTransaction() {
PlacesUtils.tagging.tagURI(this._uri, this._tags);
}
};
-
-function NSGetModule(aCompMgr, aFileSpec) {
- return XPCOMUtils.generateModule([placesTransactionsService]);
-}
+var NSGetFactory = XPCOMUtils.generateNSGetFactory([placesTransactionsService]);
--- a/browser/components/privatebrowsing/src/Makefile.in
+++ b/browser/components/privatebrowsing/src/Makefile.in
@@ -52,13 +52,17 @@ endif
CPPSRCS = \
nsPrivateBrowsingServiceWrapper.cpp \
$(NULL)
LOCAL_INCLUDES = -I$(srcdir)/../../build
+EXTRA_COMPONENTS = \
+ nsPrivateBrowsingService.manifest \
+ $(NULL)
+
EXTRA_PP_COMPONENTS = \
nsPrivateBrowsingService.js \
$(NULL)
include $(topsrcdir)/config/rules.mk
--- a/browser/components/privatebrowsing/src/nsPrivateBrowsingService.js
+++ b/browser/components/privatebrowsing/src/nsPrivateBrowsingService.js
@@ -125,23 +125,17 @@ PrivateBrowsingService.prototype = {
// List of view source window URIs for restoring later
_viewSrcURLs: [],
// List of nsIXULWindows we are going to be closing during the transition
_windowsToClose: [],
// XPCOM registration
- classDescription: "PrivateBrowsing Service",
- contractID: "@mozilla.org/privatebrowsing;1",
classID: Components.ID("{c31f4883-839b-45f6-82ad-a6a9bc5ad599}"),
- _xpcom_categories: [
- { category: "command-line-handler", entry: "m-privatebrowsing" },
- { category: "app-startup", service: true }
- ],
QueryInterface: XPCOMUtils.generateQI([Ci.nsIPrivateBrowsingService,
Ci.nsIObserver,
Ci.nsISupportsWeakReference,
Ci.nsICommandLineHandler]),
_unload: function PBS__destroy() {
// Force an exit from the private browsing mode on shutdown
@@ -695,10 +689,9 @@ PrivateBrowsingService.prototype = {
}
}
// Everybody else (including extensions)
this._obs.notifyObservers(null, "browser:purge-domain-data", aDomain);
}
};
-function NSGetModule(compMgr, fileSpec)
- XPCOMUtils.generateModule([PrivateBrowsingService]);
+var NSGetFactory = XPCOMUtils.generateNSGetFactory([PrivateBrowsingService]);
new file mode 100644
--- /dev/null
+++ b/browser/components/privatebrowsing/src/nsPrivateBrowsingService.manifest
@@ -0,0 +1,4 @@
+component {c31f4883-839b-45f6-82ad-a6a9bc5ad599} nsPrivateBrowsingService.js
+contract @mozilla.org/privatebrowsing;1 {c31f4883-839b-45f6-82ad-a6a9bc5ad599}
+category command-line-handler m-privatebrowsing @mozilla.org/privatebrowsing;1
+category app-startup nsPrivateBrowsingService service,@mozilla.org/privatebrowsing;1
--- a/browser/components/safebrowsing/Makefile.in
+++ b/browser/components/safebrowsing/Makefile.in
@@ -48,14 +48,17 @@ DIRS = src
ifdef ENABLE_TESTS
DIRS += content/test
endif
ifdef MOZILLA_OFFICIAL
DEFINES += -DOFFICIAL_BUILD=1
endif
-# EXTRA_COMPONENTS installs components written in JS to dist/bin/components
+EXTRA_COMPONENTS = \
+ src/nsSafebrowsingApplication.manifest \
+ $(NULL)
+
EXTRA_PP_COMPONENTS = \
src/nsSafebrowsingApplication.js \
$(NULL)
include $(topsrcdir)/config/rules.mk
--- a/browser/components/safebrowsing/src/nsSafebrowsingApplication.js
+++ b/browser/components/safebrowsing/src/nsSafebrowsingApplication.js
@@ -1,11 +1,13 @@
const Cc = Components.classes;
const Ci = Components.interfaces;
+Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
+
// This is copied from toolkit/components/content/js/lang.js.
// It seems cleaner to copy this rather than #include from so far away.
Function.prototype.inherits = function(parentCtor) {
var tempCtor = function(){};
tempCtor.prototype = parentCtor.prototype;
this.superClass_ = parentCtor.prototype;
this.prototype = new tempCtor();
}
@@ -31,56 +33,24 @@ function Init() {
modScope.G_Protocol4Parser = jslib.G_Protocol4Parser;
modScope.PROT_UrlCrypto = jslib.PROT_UrlCrypto;
modScope.RequestBackoff = jslib.RequestBackoff;
// We only need to call Init once
modScope.Init = function() {};
}
-// Module object
-function SafebrowsingApplicationMod() {
- this.firstTime = true;
- this.cid = Components.ID("{c64d0bcb-8270-4ca7-a0b3-3380c8ffecb5}");
- this.progid = "@mozilla.org/safebrowsing/application;1";
+function SafeBrowsingApplication()
+{
}
-
-SafebrowsingApplicationMod.prototype.registerSelf = function(compMgr, fileSpec, loc, type) {
- if (this.firstTime) {
- this.firstTime = false;
- throw Components.results.NS_ERROR_FACTORY_REGISTER_AGAIN;
- }
- compMgr = compMgr.QueryInterface(Ci.nsIComponentRegistrar);
- compMgr.registerFactoryLocation(this.cid,
- "Safebrowsing Application Module",
- this.progid,
- fileSpec,
- loc,
- type);
+SafeBrowsingApplication.prototype = {
+ classID: Components.ID("{c64d0bcb-8270-4ca7-a0b3-3380c8ffecb5}"),
+ _xpcom_factory: {
+ createInstance: function(outer, iid) {
+ if (outer != null)
+ throw Components.results.NS_ERROR_NO_AGGREGATION;
+ Init();
+ return new PROT_Application();
+ }
+ },
};
-SafebrowsingApplicationMod.prototype.getClassObject = function(compMgr, cid, iid) {
- if (!cid.equals(this.cid))
- throw Components.results.NS_ERROR_NO_INTERFACE;
- if (!iid.equals(Ci.nsIFactory))
- throw Components.results.NS_ERROR_NOT_IMPLEMENTED;
-
- return this.factory;
-}
-
-SafebrowsingApplicationMod.prototype.canUnload = function(compMgr) {
- return true;
-}
-
-SafebrowsingApplicationMod.prototype.factory = {
- createInstance: function(outer, iid) {
- if (outer != null)
- throw Components.results.NS_ERROR_NO_AGGREGATION;
- Init();
- return new PROT_Application();
- }
-};
-
-var ApplicationModInst = new SafebrowsingApplicationMod();
-
-function NSGetModule(compMgr, fileSpec) {
- return ApplicationModInst;
-}
+var NSGetFactory = XPCOMUtils.generateNSGetFactory([SafeBrowsingApplication]);
new file mode 100644
--- /dev/null
+++ b/browser/components/safebrowsing/src/nsSafebrowsingApplication.manifest
@@ -0,0 +1,2 @@
+component {c64d0bcb-8270-4ca7-a0b3-3380c8ffecb5} nsSafebrowsingApplication.js
+contract @mozilla.org/safebrowsing/application;1 {c64d0bcb-8270-4ca7-a0b3-3380c8ffecb5}
--- a/browser/components/sessionstore/src/Makefile.in
+++ b/browser/components/sessionstore/src/Makefile.in
@@ -34,14 +34,18 @@
DEPTH = ../../../..
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
+EXTRA_COMPONENTS = \
+ nsSessionStore.manifest \
+ $(NULL)
+
EXTRA_PP_COMPONENTS = \
nsSessionStore.js \
nsSessionStartup.js \
$(NULL)
include $(topsrcdir)/config/rules.mk
--- a/browser/components/sessionstore/src/nsSessionStartup.js
+++ b/browser/components/sessionstore/src/nsSessionStartup.js
@@ -304,22 +304,12 @@ SessionStartup.prototype = {
return null;
},
/* ........ QueryInterface .............. */
QueryInterface : XPCOMUtils.generateQI([Ci.nsIObserver,
Ci.nsISupportsWeakReference,
Ci.nsISessionStartup]),
- classDescription: "Browser Session Startup Service",
classID: Components.ID("{ec7a6c20-e081-11da-8ad9-0800200c9a66}"),
- contractID: "@mozilla.org/browser/sessionstartup;1",
-
- // get this contractID registered for certain categories via XPCOMUtils
- _xpcom_categories: [
- // make ourselves a startup observer
- { category: "app-startup", service: true }
- ]
-
};
-function NSGetModule(aCompMgr, aFileSpec)
- XPCOMUtils.generateModule([SessionStartup]);
+var NSGetFactory = XPCOMUtils.generateNSGetFactory([SessionStartup]);
--- a/browser/components/sessionstore/src/nsSessionStore.js
+++ b/browser/components/sessionstore/src/nsSessionStore.js
@@ -143,18 +143,16 @@ function debug(aMsg) {
}
/* :::::::: The Service ::::::::::::::: */
function SessionStoreService() {
}
SessionStoreService.prototype = {
- classDescription: "Browser Session Store Service",
- contractID: "@mozilla.org/browser/sessionstore;1",
classID: Components.ID("{5280606b-2510-4fe0-97ef-9b5a22eafe6b}"),
QueryInterface: XPCOMUtils.generateQI([Ci.nsISessionStore,
Ci.nsIDOMEventListener,
Ci.nsIObserver,
Ci.nsISupportsWeakReference]),
// xul:tab attributes to (re)store (extensions might want to hook in here);
// the favicon is always saved for the about:sessionrestore page
@@ -3084,10 +3082,9 @@ String.prototype.hasRootDomain = functio
if (this == aDomain)
return true;
let prevChar = this[index - 1];
return (index == (this.length - aDomain.length)) &&
(prevChar == "." || prevChar == "/");
}
-function NSGetModule(aComMgr, aFileSpec)
- XPCOMUtils.generateModule([SessionStoreService]);
+var NSGetFactory = XPCOMUtils.generateNSGetFactory([SessionStoreService]);
new file mode 100644
--- /dev/null
+++ b/browser/components/sessionstore/src/nsSessionStore.manifest
@@ -0,0 +1,5 @@
+component {5280606b-2510-4fe0-97ef-9b5a22eafe6b} nsSessionStore.js
+contract @mozilla.org/browser/sessionstore;1 {5280606b-2510-4fe0-97ef-9b5a22eafe6b}
+component {ec7a6c20-e081-11da-8ad9-0800200c9a66} nsSessionStartup.js
+contract @mozilla.org/browser/sessionstartup;1 {ec7a6c20-e081-11da-8ad9-0800200c9a66}
+category app-startup nsSessionStartup service,@mozilla.org/browser/sessionstartup;1
--- a/browser/components/shell/src/Makefile.in
+++ b/browser/components/shell/src/Makefile.in
@@ -61,17 +61,17 @@ CPPSRCS = nsGNOMEShellService.cpp
endif
endif
endif
ifdef CPPSRCS
LIBRARY_NAME = shellservice_s
endif
-EXTRA_COMPONENTS = nsSetDefaultBrowser.js
+EXTRA_COMPONENTS = nsSetDefaultBrowser.js nsSetDefaultBrowser.manifest
include $(topsrcdir)/config/rules.mk
DEFINES += -DMOZ_APP_NAME=\"$(MOZ_APP_NAME)\"
CXXFLAGS += $(TK_CFLAGS)
clobber::
--- a/browser/components/shell/src/nsSetDefaultBrowser.js
+++ b/browser/components/shell/src/nsSetDefaultBrowser.js
@@ -52,21 +52,13 @@ nsSetDefaultBrowser.prototype = {
var shell = Cc["@mozilla.org/browser/shell-service;1"].
getService(Ci.nsIShellService);
shell.setDefaultBrowser(true, true);
}
},
helpInfo: " -setDefaultBrowser Set this app as the default browser.\n",
- classDescription: "Default Browser Cmdline Handler",
- contractID: "@mozilla.org/browser/default-browser-clh;1",
classID: Components.ID("{F57899D0-4E2C-4ac6-9E29-50C736103B0C}"),
QueryInterface: XPCOMUtils.generateQI([Ci.nsICommandLineHandler]),
- _xpcom_categories: [{
- category: "command-line-handler",
- entry: "m-setdefaultbrowser"
- }]
-}
+};
-function NSGetModule(compMgr, fileSpec) {
- return XPCOMUtils.generateModule([nsSetDefaultBrowser]);
-}
+var NSGetFactory = XPCOMUtils.generateNSGetFactory([nsSetDefaultBrowser]);
new file mode 100644
--- /dev/null
+++ b/browser/components/shell/src/nsSetDefaultBrowser.manifest
@@ -0,0 +1,3 @@
+component {F57899D0-4E2C-4ac6-9E29-50C736103B0C} nsSetDefaultBrowser.js
+contract @mozilla.org/browser/default-browser-clh;1 {F57899D0-4E2C-4ac6-9E29-50C736103B0C}
+category command-line-handler m-setdefaultbrowser @mozilla.org/browser/default-browser-clh;1
--- a/browser/components/sidebar/src/Makefile.in
+++ b/browser/components/sidebar/src/Makefile.in
@@ -37,12 +37,13 @@
DEPTH = ../../../..
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
+EXTRA_COMPONENTS = nsSidebar.manifest
EXTRA_PP_COMPONENTS = nsSidebar.js
include $(topsrcdir)/config/rules.mk
--- a/browser/components/sidebar/src/nsSidebar.js
+++ b/browser/components/sidebar/src/nsSidebar.js
@@ -36,36 +36,22 @@
# use your version of this file under the terms of the MPL, indicate your
# decision by deleting the provisions above and replace them with the notice
# 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 *****
-/*
- * No magic constructor behaviour, as is de rigeur for XPCOM.
- * If you must perform some initialization, and it could possibly fail (even
- * due to an out-of-memory condition), you should use an Init method, which
- * can convey failure appropriately (thrown exception in JS,
- * NS_FAILED(nsresult) return in C++).
- *
- * In JS, you can actually cheat, because a thrown exception will cause the
- * CreateInstance call to fail in turn, but not all languages are so lucky.
- * (Though ANSI C++ provides exceptions, they are verboten in Mozilla code
- * for portability reasons -- and even when you're building completely
- * platform-specific code, you can't throw across an XPCOM method boundary.)
- */
+Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
const DEBUG = false; /* set to false to suppress debug messages */
-const SIDEBAR_CONTRACTID = "@mozilla.org/sidebar;1";
const SIDEBAR_CID = Components.ID("{22117140-9c6e-11d3-aaf1-00805f8a4905}");
const nsISupports = Components.interfaces.nsISupports;
-const nsIFactory = Components.interfaces.nsIFactory;
const nsISidebar = Components.interfaces.nsISidebar;
const nsISidebarExternal = Components.interfaces.nsISidebarExternal;
const nsIClassInfo = Components.interfaces.nsIClassInfo;
// File extension for Sherlock search plugin description files
const SHERLOCK_FILE_EXT_REGEXP = /\.src$/i;
function nsSidebar()
@@ -76,16 +62,18 @@ function nsSidebar()
Components.classes[PROMPTSERVICE_CONTRACTID].getService(nsIPromptService);
const SEARCHSERVICE_CONTRACTID = "@mozilla.org/browser/search-service;1";
const nsIBrowserSearchService = Components.interfaces.nsIBrowserSearchService;
this.searchService =
Components.classes[SEARCHSERVICE_CONTRACTID].getService(nsIBrowserSearchService);
}
+nsSidebar.prototype.classID = SIDEBAR_CID;
+
nsSidebar.prototype.nc = "http://home.netscape.com/NC-rdf#";
function sidebarURLSecurityCheck(url)
{
if (!/^(https?:|ftp:)/i.test(url)) {
Components.utils.reportError("Invalid argument passed to window.sidebar.addPanel: Unsupported panel URL." );
return false;
}
@@ -277,86 +265,19 @@ nsSidebar.prototype.QueryInterface =
function (iid) {
if (iid.equals(nsISidebar) ||
iid.equals(nsISidebarExternal) ||
iid.equals(nsIClassInfo) ||
iid.equals(nsISupports))
return this;
throw Components.results.NS_ERROR_NO_INTERFACE;
-}
-
-var sidebarModule = new Object();
-
-sidebarModule.registerSelf =
-function (compMgr, fileSpec, location, type)
-{
- debug("registering (all right -- a JavaScript module!)");
- compMgr = compMgr.QueryInterface(Components.interfaces.nsIComponentRegistrar);
-
- compMgr.registerFactoryLocation(SIDEBAR_CID,
- "Sidebar JS Component",
- SIDEBAR_CONTRACTID,
- fileSpec,
- location,
- type);
-
- const CATMAN_CONTRACTID = "@mozilla.org/categorymanager;1";
- const nsICategoryManager = Components.interfaces.nsICategoryManager;
- var catman = Components.classes[CATMAN_CONTRACTID].
- getService(nsICategoryManager);
-
- const JAVASCRIPT_GLOBAL_PROPERTY_CATEGORY = "JavaScript-global-property";
- catman.addCategoryEntry(JAVASCRIPT_GLOBAL_PROPERTY_CATEGORY,
- "sidebar",
- SIDEBAR_CONTRACTID,
- true,
- true);
+};
- catman.addCategoryEntry(JAVASCRIPT_GLOBAL_PROPERTY_CATEGORY,
- "external",
- SIDEBAR_CONTRACTID,
- true,
- true);
-}
-
-sidebarModule.getClassObject =
-function (compMgr, cid, iid) {
- if (!cid.equals(SIDEBAR_CID))
- throw Components.results.NS_ERROR_NO_INTERFACE;
-
- if (!iid.equals(Components.interfaces.nsIFactory))
- throw Components.results.NS_ERROR_NOT_IMPLEMENTED;
-
- return sidebarFactory;
-}
-
-sidebarModule.canUnload =
-function(compMgr)
-{
- debug("Unloading component.");
- return true;
-}
-
-/* factory object */
-var sidebarFactory = new Object();
-
-sidebarFactory.createInstance =
-function (outer, iid) {
- debug("CI: " + iid);
- if (outer != null)
- throw Components.results.NS_ERROR_NO_AGGREGATION;
-
- return (new nsSidebar()).QueryInterface(iid);
-}
-
-/* entrypoint */
-function NSGetModule(compMgr, fileSpec) {
- return sidebarModule;
-}
+var NSGetFactory = XPCOMUtils.generateNSGetFactory([nsSidebar]);
/* static functions */
if (DEBUG)
debug = function (s) { dump("-*- sidebar component: " + s + "\n"); }
else
debug = function (s) {}
// String bundle service
new file mode 100644
--- /dev/null
+++ b/browser/components/sidebar/src/nsSidebar.manifest
@@ -0,0 +1,4 @@
+component {22117140-9c6e-11d3-aaf1-00805f8a4905} nsSidebar.js
+contract @mozilla.org/sidebar;1 {22117140-9c6e-11d3-aaf1-00805f8a4905}
+category JavaScript-global-property sidebar @mozilla.org/sidebar;1
+category JavaScript-global-property sidebar @mozilla.org/sidebar;1
--- a/browser/fuel/src/Makefile.in
+++ b/browser/fuel/src/Makefile.in
@@ -39,11 +39,12 @@ DEPTH = ../../..
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
MODULE = fuel
+EXTRA_COMPONENTS = fuelApplication.manifest
EXTRA_PP_COMPONENTS = fuelApplication.js
include $(topsrcdir)/config/rules.mk
--- a/browser/fuel/src/fuelApplication.js
+++ b/browser/fuel/src/fuelApplication.js
@@ -663,19 +663,17 @@ function Application() {
this.initToolkitHelpers();
this._bookmarks = null;
}
//=================================================
// Application implementation
Application.prototype = {
// for nsIClassInfo + XPCOMUtils
- classDescription: "Application",
classID: Components.ID("fe74cf80-aa2d-11db-abbd-0800200c9a66"),
- contractID: "@mozilla.org/fuel/application;1",
// redefine the default factory for XPCOMUtils
_xpcom_factory: ApplicationFactory,
// for nsISupports
QueryInterface : XPCOMUtils.generateQI([Ci.fuelIApplication, Ci.extIApplication,
Ci.nsIObserver, Ci.nsIClassInfo]),
@@ -713,16 +711,15 @@ Application.prototype = {
return win;
},
get activeWindow() {
return new Window(Utilities.windowMediator.getMostRecentWindow("navigator:browser"));
}
};
-//module initialization
-function NSGetModule(aCompMgr, aFileSpec) {
- // set the proto, defined in extApplication.js
- Application.prototype.__proto__ = extApplication.prototype;
- return XPCOMUtils.generateModule([Application]);
-}
+#include ../../../toolkit/components/exthelper/extApplication.js
-#include ../../../toolkit/components/exthelper/extApplication.js
+// set the proto, defined in extApplication.js
+Application.prototype.__proto__ = extApplication.prototype;
+
+var NSGetFactory = XPCOMUtils.generateNSGetFactory([Application]);
+
new file mode 100644
--- /dev/null
+++ b/browser/fuel/src/fuelApplication.manifest
@@ -0,0 +1,2 @@
+component {fe74cf80-aa2d-11db-abbd-0800200c9a66} fuelApplication.js
+contract @mozilla.org/fuel/application;1 {fe74cf80-aa2d-11db-abbd-0800200c9a66}
--- a/browser/installer/package-manifest.in
+++ b/browser/installer/package-manifest.in
@@ -255,95 +255,132 @@
@BINPATH@/components/xpcom_xpti.xpt
@BINPATH@/components/xpconnect.xpt
@BINPATH@/components/xulapp.xpt
@BINPATH@/components/xuldoc.xpt
@BINPATH@/components/xultmpl.xpt
@BINPATH@/components/zipwriter.xpt
; JavaScript components
+@BINPATH@/components/FeedProcessor.manifest
@BINPATH@/components/FeedProcessor.js
+@BINPATH@/components/BrowserFeeds.manifest
@BINPATH@/components/FeedConverter.js
@BINPATH@/components/FeedWriter.js
+@BINPATH@/components/fuelApplication.manifest
@BINPATH@/components/fuelApplication.js
@BINPATH@/components/WebContentConverter.js
+@BINPATH@/components/BrowserComponents.manifest
@BINPATH@/components/nsBrowserContentHandler.js
@BINPATH@/components/nsBrowserGlue.js
+@BINPATH@/components/nsSetDefaultBrowser.manifest
@BINPATH@/components/nsSetDefaultBrowser.js
@BINPATH@/components/nsMicrosummaryService.js
+@BINPATH@/components/BrowserPlaces.manifest
@BINPATH@/components/nsPlacesTransactionsService.js
+@BINPATH@/components/nsPrivateBrowsingService.manifest
@BINPATH@/components/nsPrivateBrowsingService.js
+@BINPATH@/components/toolkitsearch.manifest
@BINPATH@/components/nsSearchService.js
@BINPATH@/components/nsSearchSuggestions.js
+@BINPATH@/components/nsTryToClose.manifest
@BINPATH@/components/nsTryToClose.js
+@BINPATH@/components/passwordmgr.manifest
@BINPATH@/components/nsLoginInfo.js
@BINPATH@/components/nsLoginManager.js
@BINPATH@/components/nsLoginManagerPrompter.js
@BINPATH@/components/storage-Legacy.js
@BINPATH@/components/storage-mozStorage.js
@BINPATH@/components/crypto-SDR.js
+@BINPATH@/components/jsconsole-clhandler.manifest
@BINPATH@/components/jsconsole-clhandler.js
#ifdef MOZ_GTK2
+@BINPATH@/components/nsFilePicker.manifest
@BINPATH@/components/nsFilePicker.js
#endif
+@BINPATH@/components/nsHelperAppDlg.manifest
@BINPATH@/components/nsHelperAppDlg.js
+@BINPATH@/components/nsDownloadManagerUI.manifest
@BINPATH@/components/nsDownloadManagerUI.js
+@BINPATH@/components/nsProxyAutoConfig.manifest
@BINPATH@/components/nsProxyAutoConfig.js
+@BINPATH@/components/NetworkGeolocationProvider.manifest
@BINPATH@/components/NetworkGeolocationProvider.js
+@BINPATH@/components/GPSDGeolocationProvider.manifest
@BINPATH@/components/GPSDGeolocationProvider.js
+@BINPATH@/components/nsSidebar.manifest
@BINPATH@/components/nsSidebar.js
+@BINPATH@/components/extensions.manifest
@BINPATH@/components/addonManager.js
@BINPATH@/components/amContentHandler.js
@BINPATH@/components/amWebInstallListener.js
@BINPATH@/components/nsBlocklistService.js
#ifdef MOZ_UPDATER
+@BINPATH@/components/nsUpdateService.manifest
@BINPATH@/components/nsUpdateService.js
@BINPATH@/components/nsUpdateServiceStub.js
#endif
+@BINPATH@/components/nsUpdateTimerManager.manifest
@BINPATH@/components/nsUpdateTimerManager.js
-@BINPATH@/components/pluginGlue.js
+@BINPATH@/components/pluginGlue.manifest
+@BINPATH@/components/nsSessionStore.manifest
@BINPATH@/components/nsSessionStartup.js
@BINPATH@/components/nsSessionStore.js
+@BINPATH@/components/nsURLFormatter.manifest
@BINPATH@/components/nsURLFormatter.js
#ifndef XP_OS2
@BINPATH@/components/@DLL_PREFIX@browsercomps@DLL_SUFFIX@
#else
@BINPATH@/components/brwsrcmp@DLL_SUFFIX@
#endif
+@BINPATH@/components/txEXSLTRegExFunctions.manifest
@BINPATH@/components/txEXSLTRegExFunctions.js
@BINPATH@/components/nsLivemarkService.js
@BINPATH@/components/nsTaggingService.js
@BINPATH@/components/nsPlacesDBFlush.js
@BINPATH@/components/nsPlacesAutoComplete.js
@BINPATH@/components/nsPlacesExpiration.js
@BINPATH@/components/PlacesProtocolHandler.js
+@BINPATH@/components/nsDefaultCLH.manifest
@BINPATH@/components/nsDefaultCLH.js
+@BINPATH@/components/nsContentPrefService.manifest
@BINPATH@/components/nsContentPrefService.js
+@BINPATH@/components/nsContentDispatchChooser.manifest
@BINPATH@/components/nsContentDispatchChooser.js
+@BINPATH@/components/nsHandlerService.manifest
@BINPATH@/components/nsHandlerService.js
+@BINPATH@/components/nsWebHandlerApp.manifest
@BINPATH@/components/nsWebHandlerApp.js
+@BINPATH@/components/nsBadCertHandler.manifest
@BINPATH@/components/nsBadCertHandler.js
+@BINPATH@/components/satchel.manifest
@BINPATH@/components/nsFormAutoComplete.js
@BINPATH@/components/nsFormHistory.js
+@BINPATH@/components/contentSecurityPolicy.manifest
@BINPATH@/components/contentSecurityPolicy.js
+@BINPATH@/components/contentAreaDropListener.manifest
@BINPATH@/components/contentAreaDropListener.js
#ifdef XP_MACOSX
@BINPATH@/components/libalerts_s.dylib
#endif
#ifdef MOZ_ENABLE_DBUS
@BINPATH@/components/@DLL_PREFIX@dbusservice@DLL_SUFFIX@
#endif
+@BINPATH@/components/nsINIProcessor.manifest
@BINPATH@/components/nsINIProcessor.js
+@BINPATH@/components/nsPrompter.manifest
@BINPATH@/components/nsPrompter.js
; Modules
@BINPATH@/modules/*
; Safe Browsing
+@BINPATH@/components/nsSafebrowsingApplication.manifest
@BINPATH@/components/nsSafebrowsingApplication.js
+@BINPATH@/components/nsURLClassifier.manifest
@BINPATH@/components/nsUrlClassifierListManager.js
@BINPATH@/components/nsUrlClassifierLib.js
@BINPATH@/components/url-classifier.xpt
; GNOME hooks
#ifdef MOZ_ENABLE_GNOME_COMPONENT
@BINPATH@/components/@DLL_PREFIX@mozgnome@DLL_SUFFIX@
#endif
--- a/config/rules.mk
+++ b/config/rules.mk
@@ -1802,36 +1802,40 @@ endif
export:: $(JAVA_DIST_DIR) $(JAVADEPFILES) $(JAVA_INSTALL_DIR)
(cd $(JAVA_GEN_DIR) && tar $(TAR_CREATE_FLAGS) - .) | (cd $(JAVA_INSTALL_DIR) && tar -xf -)
endif # XPIDLSRCS
endif # MOZ_JAVAXPCOM
################################################################################
# Copy each element of EXTRA_COMPONENTS to $(FINAL_TARGET)/components
+ifneq (,$(filter %.js,$(EXTRA_COMPONENTS) $(EXTRA_PP_COMPONENTS)))
+ifeq (,$(filter %.manifest,$(EXTRA_COMPONENTS) $(EXTRA_PP_COMPONENTS)))
+$(error .js component without matching .manifest)
+endif
+endif
+
ifdef EXTRA_COMPONENTS
libs:: $(EXTRA_COMPONENTS)
ifndef NO_DIST_INSTALL
$(INSTALL) $(IFLAGS1) $^ $(FINAL_TARGET)/components
- @$(PYTHON) $(MOZILLA_DIR)/config/buildlist.py $(FINAL_TARGET)/components/components.list $(notdir $^)
endif
endif
ifdef EXTRA_PP_COMPONENTS
libs:: $(EXTRA_PP_COMPONENTS)
ifndef NO_DIST_INSTALL
$(EXIT_ON_ERROR) \
$(NSINSTALL) -D $(FINAL_TARGET)/components; \
for i in $^; do \
fname=`basename $$i`; \
dest=$(FINAL_TARGET)/components/$${fname}; \
$(RM) -f $$dest; \
$(PYTHON) $(topsrcdir)/config/Preprocessor.py $(DEFINES) $(ACDEFINES) $(XULPPFLAGS) $$i > $$dest; \
- $(PYTHON) $(MOZILLA_DIR)/config/buildlist.py $(FINAL_TARGET)/components/components.list $$fname; \
done
endif
endif
################################################################################
# Copy each element of EXTRA_JS_MODULES to $(FINAL_TARGET)/modules
ifdef EXTRA_JS_MODULES
--- a/content/base/src/Makefile.in
+++ b/content/base/src/Makefile.in
@@ -153,18 +153,21 @@ CPPSRCS = \
GQI_SRCS = contentbase.gqi
# we don't want the shared lib, but we want to force the creation of a
# static lib.
FORCE_STATIC_LIB = 1
EXTRA_COMPONENTS = \
$(srcdir)/nsBadCertHandler.js \
+ nsBadCertHandler.manifest \
contentSecurityPolicy.js \
+ contentSecurityPolicy.manifest \
contentAreaDropListener.js \
+ contentAreaDropListener.manifest \
$(NULL)
EXTRA_JS_MODULES = \
CSPUtils.jsm \
$(NULL)
include $(topsrcdir)/config/rules.mk
--- a/content/base/src/contentAreaDropListener.js
+++ b/content/base/src/contentAreaDropListener.js
@@ -9,19 +9,17 @@ const Ci = Components.interfaces;
// cannot be dropped if it is not a valid uri or the source of the drag cannot
// access the uri. This prevents, for example, a source document from tricking
// the user into dragging a chrome url.
function ContentAreaDropListener() { };
ContentAreaDropListener.prototype =
{
- classDescription: "A component that handles dragover and drop events on a content area",
classID: Components.ID("{1f34bc80-1bc7-11d6-a384-d705dd0746fc}"),
- contractID: "@mozilla.org/content/dropped-link-handler;1",
QueryInterface: XPCOMUtils.generateQI([Ci.nsIDroppedLinkHandler, Ci.nsISupports]),
_getDropURL : function (dt)
{
let types = dt.types;
for (let t = 0; t < types.length; t++) {
let type = types[t];
switch (type) {
new file mode 100644
--- /dev/null
+++ b/content/base/src/contentAreaDropListener.manifest
@@ -0,0 +1,2 @@
+component {1f34bc80-1bc7-11d6-a384-d705dd0746fc} contentAreaDropListener.js
+contract @mozilla.org/content/dropped-link-handler;1 {1f34bc80-1bc7-11d6-a384-d705dd0746fc}
--- a/content/base/src/contentSecurityPolicy.js
+++ b/content/base/src/contentSecurityPolicy.js
@@ -108,24 +108,19 @@ function ContentSecurityPolicy() {
/* These must go through the catch-all */
csp._MAPPINGS[cp.TYPE_XBL] = cspr_sd.ALLOW;
csp._MAPPINGS[cp.TYPE_PING] = cspr_sd.ALLOW;
csp._MAPPINGS[cp.TYPE_DTD] = cspr_sd.ALLOW;
}
ContentSecurityPolicy.prototype = {
- classDescription: "Content Security Policy Component",
- contractID: "@mozilla.org/contentsecuritypolicy;1",
classID: Components.ID("{AB36A2BF-CB32-4AA6-AB41-6B4E4444A221}"),
QueryInterface: XPCOMUtils.generateQI([Ci.nsIContentSecurityPolicy]),
- // get this contractID registered for certain categories via XPCOMUtils
- _xpcom_categories: [ ],
-
get isInitialized() {
return this._isInitialized;
},
set isInitialized (foo) {
this._isInitialized = foo;
},
@@ -433,12 +428,9 @@ ContentSecurityPolicy.prototype = {
// frame-ancestors check is done outside the ContentPolicy
var res = Ci.nsIContentPolicy.ACCEPT;
CSPdebug("shouldProcess aContext=" + aContext);
return res;
},
};
-
-
-function NSGetModule(aComMgr, aFileSpec)
- XPCOMUtils.generateModule([ContentSecurityPolicy]);
+var NSGetFactory = XPCOMUtils.generateNSGetFactory([ContentSecurityPolicy]);
new file mode 100644
--- /dev/null
+++ b/content/base/src/contentSecurityPolicy.manifest
@@ -0,0 +1,2 @@
+component {AB36A2BF-CB32-4AA6-AB41-6B4E4444A221} contentSecurityPolicy.js
+contract @mozilla.org/contentsecuritypolicy;1 {AB36A2BF-CB32-4AA6-AB41-6B4E4444A221}
--- a/content/base/src/nsBadCertHandler.js
+++ b/content/base/src/nsBadCertHandler.js
@@ -68,16 +68,12 @@ BadCertHandler.prototype = {
return this.QueryInterface(iid);
},
// nsISupports
QueryInterface: XPCOMUtils.generateQI([Ci.nsIBadCertListener2,
Ci.nsISSLErrorListener,
Ci.nsIInterfaceRequestor]),
- classDescription: "XMLHttpRequest Bad Cert Handler",
classID: Components.ID("{dbded6ec-edbf-4054-a834-287b82c260f9}"),
- contractID: "@mozilla.org/content/xmlhttprequest-bad-cert-handler;1"
};
-function NSGetModule(aCompMgr, aFileSpec) {
- return XPCOMUtils.generateModule([BadCertHandler]);
-}
+var NSGetFactory = XPCOMUtils.generateNSGetFactory([BadCertHandler]);
new file mode 100644
--- /dev/null
+++ b/content/base/src/nsBadCertHandler.manifest
@@ -0,0 +1,2 @@
+component {dbded6ec-edbf-4054-a834-287b82c260f9} nsBadCertHandler.js
+contract @mozilla.org/content/xmlhttprequest-bad-cert-handler;1 {dbded6ec-edbf-4054-a834-287b82c260f9}
\ No newline at end of file
--- a/content/xslt/src/xslt/Makefile.in
+++ b/content/xslt/src/xslt/Makefile.in
@@ -88,17 +88,20 @@ CPPSRCS += txMozillaStylesheetCompiler.c
txMozillaXMLOutput.cpp \
txMozillaXSLTProcessor.cpp
endif
# we don't want the shared lib, but we want to force the creation of a
# static lib.
FORCE_STATIC_LIB = 1
-EXTRA_COMPONENTS = $(srcdir)/txEXSLTRegExFunctions.js
+EXTRA_COMPONENTS = \
+ txEXSLTRegExFunctions.js \
+ txEXSLTRegExFunctions.manifest \
+ $(NULL)
include $(topsrcdir)/config/rules.mk
INCLUDES += \
-I$(srcdir) \
-I$(srcdir)/../base \
-I$(srcdir)/../xml \
-I$(srcdir)/../xpath \
--- a/content/xslt/src/xslt/txEXSLTRegExFunctions.js
+++ b/content/xslt/src/xslt/txEXSLTRegExFunctions.js
@@ -32,33 +32,32 @@
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* 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 ***** */
-const EXSLT_REGEXP_CONTRACTID = "@mozilla.org/exslt/regexp;1";
-const EXSLT_REGEXP_CID = Components.ID("{18a03189-067b-4978-b4f1-bafe35292ed6}");
-const EXSLT_REGEXP_NS = "http://exslt.org/regular-expressions";
+Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
+
const EXSLT_REGEXP_DESC = "EXSLT RegExp extension functions"
-const XSLT_EXTENSIONS_CAT = "XSLT extension functions";
-
const CATMAN_CONTRACTID = "@mozilla.org/categorymanager;1";
const NODESET_CONTRACTID = "@mozilla.org/transformiix-nodeset;1";
const Ci = Components.interfaces;
function txEXSLTRegExFunctions()
{
}
txEXSLTRegExFunctions.prototype = {
+ classID: Components.ID("{18a03189-067b-4978-b4f1-bafe35292ed6}"),
+
QueryInterface: function(iid) {
if (iid.equals(Ci.nsISupports) ||
iid.equals(Ci.txIEXSLTRegExFunctions))
return this;
if (iid.equals(Ci.nsIClassInfo))
return txEXSLTRegExModule.factory
@@ -100,89 +99,56 @@ txEXSLTRegExFunctions.prototype = {
var re = new RegExp(regex, flags);
return re.test(str);
}
}
var SingletonInstance = null;
-var txEXSLTRegExModule = {
- registerSelf: function(compMgr, fileSpec, location, type) {
- compMgr = compMgr.QueryInterface(Ci.nsIComponentRegistrar);
- compMgr.registerFactoryLocation(EXSLT_REGEXP_CID, EXSLT_REGEXP_DESC,
- EXSLT_REGEXP_CONTRACTID, fileSpec,
- location, type);
+function NSGetFactory(cid)
+{
+ if (!cid.equals(EXSLT_REGEXP_CID))
+ throw Components.results.NS_ERROR_NOT_IMPLEMENTED;
- var catman = Components.classes[CATMAN_CONTRACTID]
- .getService(Ci.nsICategoryManager);
- catman.addCategoryEntry(XSLT_EXTENSIONS_CAT, EXSLT_REGEXP_NS,
- EXSLT_REGEXP_CONTRACTID, true, true);
- },
+
+ return kFactory;
+}
- unregisterSelf: function(compMgr, location, loaderStr) {
- compMgr = compMgr.QueryInterface(Ci.nsIComponentRegistrar);
- compMgr.unregisterFactoryLocation(EXSLT_REGEXP_CID, location);
-
- var catman = Components.classes[CATMAN_CONTRACTID]
- .getService(Ci.nsICategoryManager);
- catman.deleteCategoryEntry(XSLT_EXTENSIONS_CAT, EXSLT_REGEXP_NS, true);
- },
+const kFactory = {
+ QueryInterface: function(iid) {
+ if (iid.equals(Ci.nsISupports) ||
+ iid.equals(Ci.nsIFactory) ||
+ iid.equals(Ci.nsIClassInfo))
+ return this;
- getClassObject: function(compMgr, cid, iid) {
- if (!cid.equals(EXSLT_REGEXP_CID))
- throw Components.results.NS_ERROR_NOT_IMPLEMENTED;
-
- if (!iid.equals(Ci.nsIFactory) &&
- !iid.equals(Ci.nsIClassInfo))
- throw Components.results.NS_ERROR_NOT_IMPLEMENTED;
-
- return this.factory;
+ throw Components.results.NS_ERROR_NO_INTERFACE;
},
- factory: {
- QueryInterface: function(iid) {
- if (iid.equals(Ci.nsISupports) ||
- iid.equals(Ci.nsIFactory) ||
- iid.equals(Ci.nsIClassInfo))
- return this;
-
- throw Components.results.NS_ERROR_NO_INTERFACE;
- },
-
- createInstance: function(outer, iid) {
- if (outer != null)
- throw Components.results.NS_ERROR_NO_AGGREGATION;
-
- if (SingletonInstance == null)
- SingletonInstance = new txEXSLTRegExFunctions();
+ createInstance: function(outer, iid) {
+ if (outer != null)
+ throw Components.results.NS_ERROR_NO_AGGREGATION;
- return SingletonInstance.QueryInterface(iid);
- },
-
- getInterfaces: function(countRef) {
- var interfaces = [
- Ci.txIEXSLTRegExFunctions
- ];
- countRef.value = interfaces.length;
+ if (SingletonInstance == null)
+ SingletonInstance = new txEXSLTRegExFunctions();
- return interfaces;
- },
-
- getHelperForLanguage: function(language) {
- return null;
- },
-
- contractID: EXSLT_REGEXP_CONTRACTID,
- classDescription: EXSLT_REGEXP_DESC,
- classID: EXSLT_REGEXP_CID,
- implementationLanguage: Ci.nsIProgrammingLanguage.JAVASCRIPT,
- flags: Ci.nsIClassInfo.SINGLETON
+ return SingletonInstance.QueryInterface(iid);
},
- canUnload: function(compMgr) {
- return true;
- }
+ getInterfaces: function(countRef) {
+ var interfaces = [
+ Ci.txIEXSLTRegExFunctions
+ ];
+ countRef.value = interfaces.length;
+
+ return interfaces;
+ },
+
+ getHelperForLanguage: function(language) {
+ return null;
+ },
+
+ contractID: EXSLT_REGEXP_CONTRACTID,
+ classDescription: EXSLT_REGEXP_DESC,
+ classID: EXSLT_REGEXP_CID,
+ implementationLanguage: Ci.nsIProgrammingLanguage.JAVASCRIPT,
+ flags: Ci.nsIClassInfo.SINGLETON
};
-
-function NSGetModule(compMgr, fileSpec) {
- return txEXSLTRegExModule;
-}
new file mode 100644
--- /dev/null
+++ b/content/xslt/src/xslt/txEXSLTRegExFunctions.manifest
@@ -0,0 +1,3 @@
+component {18a03189-067b-4978-b4f1-bafe35292ed6} txEXSLTRegExFunctions.js
+contract @mozilla.org/exslt/regexp;1 {18a03189-067b-4978-b4f1-bafe35292ed6}
+category XSLT-extension-functions http://exslt.org/regular-expressions @mozilla.org/exslt/regexp;1
--- a/content/xslt/src/xslt/txStylesheetCompiler.cpp
+++ b/content/xslt/src/xslt/txStylesheetCompiler.cpp
@@ -1057,17 +1057,17 @@ findFunction(nsIAtom* aName, PRInt32 aNa
do_GetService(NS_CATEGORYMANAGER_CONTRACTID, &rv);
NS_ENSURE_SUCCESS(rv, rv);
nsAutoString namespaceURI;
rv = txNamespaceManager::getNamespaceURI(aNamespaceID, namespaceURI);
NS_ENSURE_SUCCESS(rv, rv);
nsXPIDLCString contractID;
- rv = catman->GetCategoryEntry("XSLT extension functions",
+ rv = catman->GetCategoryEntry("XSLT-extension-functions",
NS_ConvertUTF16toUTF8(namespaceURI).get(),
getter_Copies(contractID));
if (rv == NS_ERROR_NOT_AVAILABLE) {
return NS_ERROR_XPATH_UNKNOWN_FUNCTION;
}
NS_ENSURE_SUCCESS(rv, rv);
map = sXPCOMFunctionMappings->AppendElement();
--- a/dom/src/geolocation/GPSDGeolocationProvider.js
+++ b/dom/src/geolocation/GPSDGeolocationProvider.js
@@ -129,22 +129,17 @@ function GPSDProvider() {
gLoggingEnabled = this.prefService.getBoolPref("geo.gpsd.logging.enabled");
} catch (e) {}
};
GPSDProvider.prototype = {
QueryInterface: XPCOMUtils.generateQI([Ci.nsIGeolocationProvider]),
- classDescription: "Returns a geolocation from a GPSD source",
classID: Components.ID("{0A3BE523-0F2A-32CC-CCD8-1E5986D5A79D}"),
- contractID: "@mozilla.org/geolocation/gpsd/provider;1",
- _xpcom_categories: [{
- category: "geolocation-provider",
- }],
prefService: null,
transport: null,
outputStream: null,
inputStream: null,
startup: function() {
@@ -256,13 +251,9 @@ GPSDProvider.prototype = {
var pump = Cc["@mozilla.org/network/input-stream-pump;1"].createInstance(Ci.nsIInputStreamPump);
pump.init(this.inputStream, -1, -1, 0, 0, false);
pump.asyncRead(dataListener, null);
},
};
-var components = [GPSDProvider];
-
-function NSGetModule(compMgr, fileSpec) {
- return XPCOMUtils.generateModule(components);
-}
+var NSGetFactory = XPCOMUtils.generateNSGetModule([GPSDProvider]);
new file mode 100644
--- /dev/null
+++ b/dom/src/geolocation/GPSDGeolocationProvider.manifest
@@ -0,0 +1,3 @@
+component {0A3BE523-0F2A-32CC-CCD8-1E5986D5A79D} GPSDGeolocationProvider.manifest
+contract @mozilla.org/geolocation/gpsd/provider;1 {0A3BE523-0F2A-32CC-CCD8-1E5986D5A79D}
+category geolocation-provider GPSDProvider @mozilla.org/geolocation/gpsd/provider;1
--- a/dom/src/geolocation/Makefile.in
+++ b/dom/src/geolocation/Makefile.in
@@ -72,15 +72,17 @@ endif
ifeq ($(MOZ_WIDGET_TOOLKIT),android)
CPPSRCS += AndroidLocationProvider.cpp nsGeoPosition.cpp
EXPORTS += nsGeoPosition.h
endif
EXTRA_COMPONENTS = \
NetworkGeolocationProvider.js \
+ NetworkGeolocationProvider.manifest \
GPSDGeolocationProvider.js \
+ GPSDGeolocationProvider.manifest \
$(NULL)
include $(topsrcdir)/config/rules.mk
DEFINES += -D_IMPL_NS_LAYOUT
--- a/dom/src/geolocation/NetworkGeolocationProvider.js
+++ b/dom/src/geolocation/NetworkGeolocationProvider.js
@@ -39,19 +39,16 @@ WifiGeoAddressObject.prototype = {
getInterfaces: function(countRef) {
var interfaces = [Ci.nsIDOMGeoPositionAddress, Ci.nsIClassInfo, Ci.nsISupports];
countRef.value = interfaces.length;
return interfaces;
},
getHelperForLanguage: function(language) null,
- contractID: "",
- classDescription: "wifi geo position address object",
- classID: null,
implementationLanguage: Ci.nsIProgrammingLanguage.JAVASCRIPT,
flags: Ci.nsIClassInfo.DOM_OBJECT,
};
function WifiGeoCoordsObject(lat, lon, acc, alt, altacc) {
this.latitude = lat;
this.longitude = lon;
this.accuracy = acc;
@@ -65,19 +62,17 @@ WifiGeoCoordsObject.prototype = {
getInterfaces: function(countRef) {
var interfaces = [Ci.nsIDOMGeoPositionCoords, Ci.nsIClassInfo, Ci.nsISupports];
countRef.value = interfaces.length;
return interfaces;
},
getHelperForLanguage: function(language) null,
- contractID: "",
classDescription: "wifi geo position coords object",
- classID: null,
implementationLanguage: Ci.nsIProgrammingLanguage.JAVASCRIPT,
flags: Ci.nsIClassInfo.DOM_OBJECT,
latitude: 0,
longitude: 0,
accuracy: 0,
altitude: 0,
altitudeAccuracy: 0,
@@ -116,19 +111,17 @@ WifiGeoPositionObject.prototype = {
// Class Info is required to be able to pass objects back into the DOM.
getInterfaces: function(countRef) {
var interfaces = [Ci.nsIDOMGeoPosition, Ci.nsIClassInfo, Ci.nsISupports];
countRef.value = interfaces.length;
return interfaces;
},
getHelperForLanguage: function(language) null,
- contractID: "",
classDescription: "wifi geo location position object",
- classID: null,
implementationLanguage: Ci.nsIProgrammingLanguage.JAVASCRIPT,
flags: Ci.nsIClassInfo.DOM_OBJECT,
coords: null,
timestamp: 0,
};
function HELD() {};
@@ -223,19 +216,17 @@ function WifiGeoPositionProvider() {
try {
gTestingEnabled = this.prefService.getBoolPref("geo.wifi.testing");
} catch (e) {}
};
WifiGeoPositionProvider.prototype = {
- classDescription: "A component that returns a geolocation based on WIFI",
classID: Components.ID("{77DA64D3-7458-4920-9491-86CC9914F904}"),
- contractID: "@mozilla.org/geolocation/provider;1",
QueryInterface: XPCOMUtils.generateQI([Ci.nsIGeolocationProvider,
Ci.nsIWifiListener,
Ci.nsITimerCallback]),
prefService: null,
provider_url: null,
wifi_service: null,
@@ -441,12 +432,9 @@ WifiGeoPositionProvider.prototype = {
notify: function (timer) {
if (this.hasSeenWiFi == false)
this.onChange(null);
this.timer = null;
},
};
-var components = [WifiGeoPositionProvider];
-function NSGetModule(compMgr, fileSpec) {
- return XPCOMUtils.generateModule(components);
-}
+var NSGetFactory = XPCOMUtils.generateNSGetFactory([WifiGeoPositionProvider]);
new file mode 100644
--- /dev/null
+++ b/dom/src/geolocation/NetworkGeolocationProvider.manifest
@@ -0,0 +1,2 @@
+component {77DA64D3-7458-4920-9491-86CC9914F904} NetworkGeolocationProvider.js
+contract @mozilla.org/geolocation/provider;1 {77DA64D3-7458-4920-9491-86CC9914F904}
--- a/layout/tools/pageloader/Makefile.in
+++ b/layout/tools/pageloader/Makefile.in
@@ -41,11 +41,12 @@ srcdir = @srcdir@
VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
MODULE = layout
EXTRA_COMPONENTS= \
tp-cmdline.js \
+ tp-cmdline.manifest \
$(NULL)
include $(topsrcdir)/config/rules.mk
--- a/layout/tools/pageloader/tp-cmdline.js
+++ b/layout/tools/pageloader/tp-cmdline.js
@@ -32,44 +32,35 @@
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* 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 ***** */
+Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
+
// This only implements nsICommandLineHandler, since it needs
// to handle multiple arguments.
-const TP_CMDLINE_CONTRACTID = "@mozilla.org/commandlinehandler/general-startup;1?type=tp";
-const TP_CMDLINE_CLSID = Components.ID('{8AF052F5-8EFE-4359-8266-E16498A82E8B}');
-const CATMAN_CONTRACTID = "@mozilla.org/categorymanager;1";
const nsISupports = Components.interfaces.nsISupports;
-const nsICategoryManager = Components.interfaces.nsICategoryManager;
const nsICommandLine = Components.interfaces.nsICommandLine;
const nsICommandLineHandler = Components.interfaces.nsICommandLineHandler;
-const nsIComponentRegistrar = Components.interfaces.nsIComponentRegistrar;
const nsISupportsString = Components.interfaces.nsISupportsString;
const nsIWindowWatcher = Components.interfaces.nsIWindowWatcher;
function PageLoaderCmdLineHandler() {}
PageLoaderCmdLineHandler.prototype =
{
- /* nsISupports */
- QueryInterface : function handler_QI(iid) {
- if (iid.equals(nsISupports))
- return this;
+ classID: Components.ID('{8AF052F5-8EFE-4359-8266-E16498A82E8B}'),
- if (nsICommandLineHandler && iid.equals(nsICommandLineHandler))
- return this;
-
- throw Components.results.NS_ERROR_NO_INTERFACE;
- },
+ /* nsISupports */
+ QueryInterface : XPCOMUtils.generateQI([nsICommandLineHandler]),
/* nsICommandLineHandler */
handle : function handler_handle(cmdLine) {
var args = {};
try {
var uristr = cmdLine.handleFlagWithParam("tp", false);
if (uristr == null)
return;
@@ -120,74 +111,9 @@ PageLoaderCmdLineHandler.prototype =
" -tpheight height Height of window\n" +
" -tpoffline Force offline mode\n" +
" -tpnoisy Dump the name of the last loaded page to console\n" +
" -tptimeout Max amount of time given for a page to load, quit if exceeded\n" +
" -tpnoforcecc Don't force cycle collection between each pageload\n"
};
-
-var PageLoaderCmdLineFactory =
-{
- createInstance : function(outer, iid)
- {
- if (outer != null) {
- throw Components.results.NS_ERROR_NO_AGGREGATION;
- }
-
- return new PageLoaderCmdLineHandler().QueryInterface(iid);
- }
-};
-
-
-var PageLoaderCmdLineModule =
-{
- registerSelf : function(compMgr, fileSpec, location, type)
- {
- compMgr = compMgr.QueryInterface(nsIComponentRegistrar);
-
- compMgr.registerFactoryLocation(TP_CMDLINE_CLSID,
- "PageLoader CommandLine Service",
- TP_CMDLINE_CONTRACTID,
- fileSpec,
- location,
- type);
-
- var catman = Components.classes[CATMAN_CONTRACTID].getService(nsICategoryManager);
- catman.addCategoryEntry("command-line-handler",
- "m-tp",
- TP_CMDLINE_CONTRACTID, true, true);
- },
-
- unregisterSelf : function(compMgr, fileSpec, location)
- {
- compMgr = compMgr.QueryInterface(nsIComponentRegistrar);
-
- compMgr.unregisterFactoryLocation(TP_CMDLINE_CLSID, fileSpec);
- catman = Components.classes[CATMAN_CONTRACTID].getService(nsICategoryManager);
- catman.deleteCategoryEntry("command-line-handler",
- "m-tp", true);
- },
-
- getClassObject : function(compMgr, cid, iid)
- {
- if (cid.equals(TP_CMDLINE_CLSID)) {
- return PageLoaderCmdLineFactory;
- }
-
- if (!iid.equals(Components.interfaces.nsIFactory)) {
- throw Components.results.NS_ERROR_NOT_IMPLEMENTED;
- }
-
- throw Components.results.NS_ERROR_NO_INTERFACE;
- },
-
- canUnload : function(compMgr)
- {
- return true;
- }
-};
-
-
-function NSGetModule(compMgr, fileSpec) {
- return PageLoaderCmdLineModule;
-}
+var NSGetFactory = XPCOMUtils.generateNSGetFactory([PageLoaderCmdLineHandler]);
new file mode 100644
--- /dev/null
+++ b/layout/tools/pageloader/tp-cmdline.manifest
@@ -0,0 +1,3 @@
+component {8AF052F5-8EFE-4359-8266-E16498A82E8B} tp-cmdline.js
+contract @mozilla.org/commandlinehandler/general-startup;1?type=tp {8AF052F5-8EFE-4359-8266-E16498A82E8B}
+category command-line-handler m-tp @mozilla.org/commandlinehandler/general-startup;1?type=tp
--- a/layout/tools/reftest/Makefile.in
+++ b/layout/tools/reftest/Makefile.in
@@ -41,16 +41,17 @@ srcdir = @srcdir@
VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
MODULE = reftest
EXTRA_COMPONENTS= \
reftest-cmdline.js \
+ reftest-cmdline.manifest \
$(NULL)
ifdef XPI_NAME
DIST_FILES = install.rdf
# Used in install.rdf
USE_EXTENSION_MANIFEST=1
endif
--- a/layout/tools/reftest/reftest-cmdline.js
+++ b/layout/tools/reftest/reftest-cmdline.js
@@ -31,57 +31,32 @@
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* 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 ***** */
-// NOTE: this file implements both the seamonkey nsICmdLineHandler and
-// the toolkit nsICommandLineHandler, using runtime detection.
+Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
-const REFTEST_CMDLINE_CONTRACTID = "@mozilla.org/commandlinehandler/general-startup;1?type=reftest";
-const REFTEST_CMDLINE_CLSID = Components.ID('{32530271-8c1b-4b7d-a812-218e42c6bb23}');
-const CATMAN_CONTRACTID = "@mozilla.org/categorymanager;1";
const nsISupports = Components.interfaces.nsISupports;
-const nsICategoryManager = Components.interfaces.nsICategoryManager;
-const nsICmdLineHandler = Components.interfaces.nsICmdLineHandler;
const nsICommandLine = Components.interfaces.nsICommandLine;
const nsICommandLineHandler = Components.interfaces.nsICommandLineHandler;
-const nsIComponentRegistrar = Components.interfaces.nsIComponentRegistrar;
const nsISupportsString = Components.interfaces.nsISupportsString;
const nsIWindowWatcher = Components.interfaces.nsIWindowWatcher;
function RefTestCmdLineHandler() {}
RefTestCmdLineHandler.prototype =
{
- /* nsISupports */
- QueryInterface : function handler_QI(iid) {
- if (iid.equals(nsISupports))
- return this;
-
- if (nsICmdLineHandler && iid.equals(nsICmdLineHandler))
- return this;
-
- if (nsICommandLineHandler && iid.equals(nsICommandLineHandler))
- return this;
+ classID: Components.ID('{32530271-8c1b-4b7d-a812-218e42c6bb23}'),
- throw Components.results.NS_ERROR_NO_INTERFACE;
- },
-
- /* nsICmdLineHandler */
- commandLineArgument : "-reftest",
- prefNameForStartup : "general.startup.reftest",
- chromeUrlForTask : "chrome://reftest/content/reftest.xul",
- helpText : "Run layout acceptance tests on given manifest.",
- handlesArgs : true,
- defaultArgs : "",
- openWindowWithArgs : true,
+ /* nsISupports */
+ QueryInterface: XPCOMUtils.generateQI([nsICommandLineHandler]),
/* nsICommandLineHandler */
handle : function handler_handle(cmdLine) {
var args = { };
args.wrappedJSObject = args;
try {
var uristr = cmdLine.handleFlagWithParam("reftest", false);
if (uristr == null)
@@ -121,79 +96,9 @@ RefTestCmdLineHandler.prototype =
wwatch.openWindow(null, "chrome://reftest/content/reftest.xul", "_blank",
"chrome,dialog=no,all", args);
cmdLine.preventDefault = true;
},
helpInfo : " -reftest <file> Run layout acceptance tests on given manifest.\n"
};
-
-var RefTestCmdLineFactory =
-{
- createInstance : function(outer, iid)
- {
- if (outer != null) {
- throw Components.results.NS_ERROR_NO_AGGREGATION;
- }
-
- return new RefTestCmdLineHandler().QueryInterface(iid);
- }
-};
-
-
-var RefTestCmdLineModule =
-{
- registerSelf : function(compMgr, fileSpec, location, type)
- {
- compMgr = compMgr.QueryInterface(nsIComponentRegistrar);
-
- compMgr.registerFactoryLocation(REFTEST_CMDLINE_CLSID,
- "RefTest CommandLine Service",
- REFTEST_CMDLINE_CONTRACTID,
- fileSpec,
- location,
- type);
-
- var catman = Components.classes[CATMAN_CONTRACTID].getService(nsICategoryManager);
- catman.addCategoryEntry("command-line-argument-handlers",
- "reftest command line handler",
- REFTEST_CMDLINE_CONTRACTID, true, true);
- catman.addCategoryEntry("command-line-handler",
- "m-reftest",
- REFTEST_CMDLINE_CONTRACTID, true, true);
- },
-
- unregisterSelf : function(compMgr, fileSpec, location)
- {
- compMgr = compMgr.QueryInterface(nsIComponentRegistrar);
-
- compMgr.unregisterFactoryLocation(REFTEST_CMDLINE_CLSID, fileSpec);
- catman = Components.classes[CATMAN_CONTRACTID].getService(nsICategoryManager);
- catman.deleteCategoryEntry("command-line-argument-handlers",
- "reftest command line handler", true);
- catman.deleteCategoryEntry("command-line-handler",
- "m-reftest", true);
- },
-
- getClassObject : function(compMgr, cid, iid)
- {
- if (cid.equals(REFTEST_CMDLINE_CLSID)) {
- return RefTestCmdLineFactory;
- }
-
- if (!iid.equals(Components.interfaces.nsIFactory)) {
- throw Components.results.NS_ERROR_NOT_IMPLEMENTED;
- }
-
- throw Components.results.NS_ERROR_NO_INTERFACE;
- },
-
- canUnload : function(compMgr)
- {
- return true;
- }
-};
-
-
-function NSGetModule(compMgr, fileSpec) {
- return RefTestCmdLineModule;
-}
+var NSGetFactory = XPCOMUtils.generateNSGetFactory([RefTestCmdLineHandler]);
new file mode 100644
--- /dev/null
+++ b/layout/tools/reftest/reftest-cmdline.manifest
@@ -0,0 +1,3 @@
+component {32530271-8c1b-4b7d-a812-218e42c6bb23} reftest-cmdline.js
+contract @mozilla.org/commandlinehandler/general-startup;1?type=reftest {32530271-8c1b-4b7d-a812-218e42c6bb23}
+category command-line-handler m-reftest @mozilla.org/commandlinehandler/general-startup;1?type=reftest
--- a/netwerk/base/src/Makefile.in
+++ b/netwerk/base/src/Makefile.in
@@ -112,16 +112,17 @@ ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
else
CPPSRCS += nsURLHelperUnix.cpp
endif
endif
endif
EXTRA_COMPONENTS = \
$(srcdir)/nsProxyAutoConfig.js \
+ $(srcdir)/nsProxyAutoConfig.manifest \
$(NULL)
EXTRA_JS_MODULES = \
NetUtil.jsm \
$(NULL)
# we don't want the shared lib, but we want to force the creation of a
# static lib.
--- a/netwerk/base/src/nsProxyAutoConfig.js
+++ b/netwerk/base/src/nsProxyAutoConfig.js
@@ -39,37 +39,38 @@
*
* ***** END LICENSE BLOCK ***** */
/*
Script for Proxy Auto Config in the new world order.
- Gagan Saksena 04/24/00
*/
+Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
+
const kDNS_CONTRACTID = "@mozilla.org/network/dns-service;1";
-const kPAC_CONTRACTID = "@mozilla.org/network/proxy-auto-config;1";
-const kPAC_CID = Components.ID("{63ac8c66-1dd2-11b2-b070-84d00d3eaece}");
const nsISupports = Components.interfaces.nsISupports;
const nsIProxyAutoConfig = Components.interfaces.nsIProxyAutoConfig;
const nsIDNSService = Components.interfaces.nsIDNSService;
+var dns;
+
// implementor of nsIProxyAutoConfig
-function nsProxyAutoConfig() {};
+function nsProxyAutoConfig() {
+ dns = Components.classes[kDNS_CONTRACTID].getService(nsIDNSService);
+};
nsProxyAutoConfig.prototype = {
+ classID: Components.ID("63ac8c66-1dd2-11b2-b070-84d00d3eaece"),
+
// sandbox in which we eval loaded autoconfig js file
_sandBox: null,
- QueryInterface: function(iid) {
- if (iid.Equals(nsIProxyAutoConfig) ||
- iid.Equals(nsISupports))
- return this;
- throw Components.results.NS_ERROR_NO_INTERFACE;
- },
+ QueryInterface: XPCOMUtils.generateQI([nsIProxyAutoConfig]),
init: function(pacURI, pacText) {
// remove PAC configuration if requested
if (pacURI == "" || pacText == "") {
this._sandBox = null;
return;
}
@@ -124,64 +125,17 @@ function myIpAddress() {
function dnsResolve(host) {
try {
return dns.resolve(host, 0).getNextAddrAsString();
} catch (e) {
return null;
}
}
-var pacModule = new Object();
-
-pacModule.registerSelf =
- function (compMgr, fileSpec, location, type) {
- compMgr = compMgr.QueryInterface(Components.interfaces.nsIComponentRegistrar);
- compMgr.registerFactoryLocation(kPAC_CID,
- "nsProxyAutoConfig",
- kPAC_CONTRACTID,
- fileSpec,
- location,
- type);
- }
-
-pacModule.getClassObject =
-function (compMgr, cid, iid) {
- if (!cid.equals(kPAC_CID))
- throw Components.results.NS_ERROR_NO_INTERFACE;
-
- if (!iid.equals(Components.interfaces.nsIFactory))
- throw Components.results.NS_ERROR_NOT_IMPLEMENTED;
-
- return pacFactory;
- }
-
-pacModule.canUnload =
- function (compMgr) {
- return true;
- }
-
-var pacFactory = new Object();
-pacFactory.createInstance =
- function (outer, iid) {
- if (outer != null)
- throw Components.results.NS_ERROR_NO_AGGREGATION;
-
- if (!iid.equals(nsIProxyAutoConfig) &&
- !iid.equals(Components.interfaces.nsISupports)) {
- throw Components.results.NS_ERROR_NO_INTERFACE;
- }
- return pac;
- }
-
-function NSGetModule(compMgr, fileSpec) {
- return pacModule;
-}
-
-var pac = new nsProxyAutoConfig() ;
-var dns = Components.classes[kDNS_CONTRACTID].getService(nsIDNSService);
+NSGetFactory = XPCOMUtils.generateNSGetFactory([nsProxyAutoConfig]);
var pacUtils =
"function dnsDomainIs(host, domain) {\n" +
" return (host.length >= domain.length &&\n" +
" host.substring(host.length - domain.length) == domain);\n" +
"}\n" +
"function dnsDomainLevels(host) {\n" +
new file mode 100644
--- /dev/null
+++ b/netwerk/base/src/nsProxyAutoConfig.manifest
@@ -0,0 +1,2 @@
+component {63ac8c66-1dd2-11b2-b070-84d00d3eaece} nsProxyAutoConfig.js
+contract "@mozilla.org/network/proxy-auto-config;1" {63ac8c66-1dd2-11b2-b070-84d00d3eaece}
--- a/netwerk/test/httpserver/Makefile.in
+++ b/netwerk/test/httpserver/Makefile.in
@@ -42,16 +42,17 @@ srcdir = @srcdir@
VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
MODULE = test_necko
EXTRA_COMPONENTS = \
httpd.js \
+ httpd.manifest \
$(NULL)
XPIDLSRCS = \
nsIHttpServer.idl \
$(NULL)
XPCSHELL_TESTS = test
--- a/netwerk/test/httpserver/httpd.js
+++ b/netwerk/test/httpserver/httpd.js
@@ -5132,89 +5132,27 @@ function makeFactory(ctor)
if (Ci.nsIFactory.equals(aIID) ||
Ci.nsISupports.equals(aIID))
return this;
throw Cr.NS_ERROR_NO_INTERFACE;
}
};
}
-/** The XPCOM module containing the HTTP server. */
-const module =
+const kServerCID = Components.ID("{54ef6f81-30af-4b1d-ac55-8ba811293e41}");
+const kServerFactory = makeFactory(nsHttpServer);
+
+function NSGetFactory(cid)
{
- // nsISupports
- QueryInterface: function(aIID)
- {
- if (Ci.nsIModule.equals(aIID) ||
- Ci.nsISupports.equals(aIID))
- return this;
- throw Cr.NS_ERROR_NO_INTERFACE;
- },
-
- // nsIModule
- registerSelf: function(compMgr, fileSpec, location, type)
- {
- compMgr = compMgr.QueryInterface(Ci.nsIComponentRegistrar);
+ if (cid.equals(kServerCID)
+ return kServerFactory;
- for (var key in this._objects)
- {
- var obj = this._objects[key];
- compMgr.registerFactoryLocation(obj.CID, obj.className, obj.contractID,
- fileSpec, location, type);
- }
- },
- unregisterSelf: function (compMgr, location, type)
- {
- compMgr = compMgr.QueryInterface(Ci.nsIComponentRegistrar);
-
- for (var key in this._objects)
- {
- var obj = this._objects[key];
- compMgr.unregisterFactoryLocation(obj.CID, location);
- }
- },
- getClassObject: function(compMgr, cid, iid)
- {
- if (!iid.equals(Ci.nsIFactory))
- throw Cr.NS_ERROR_NOT_IMPLEMENTED;
-
- for (var key in this._objects)
- {
- if (cid.equals(this._objects[key].CID))
- return this._objects[key].factory;
- }
-
- throw Cr.NS_ERROR_NO_INTERFACE;
- },
- canUnload: function(compMgr)
- {
- return true;
- },
-
- // private implementation
- _objects:
- {
- server:
- {
- CID: Components.ID("{54ef6f81-30af-4b1d-ac55-8ba811293e41}"),
- contractID: "@mozilla.org/server/jshttp;1",
- className: "httpd.js server",
- factory: makeFactory(nsHttpServer)
- }
- }
-};
-
-
-/** NSGetModule, so this code can be used as a JS component. */
-function NSGetModule(compMgr, fileSpec)
-{
- return module;
+ throw Cr.NS_ERROR_FACTORY_NOT_REGISTERED;
}
-
/**
* Creates a new HTTP server listening for loopback traffic on the given port,
* starts it, and runs the server until the server processes a shutdown request,
* spinning an event loop so that events posted by the server's socket are
* processed.
*
* This method is primarily intended for use in running this script from within
* xpcshell and running a functional HTTP server without having to deal with
new file mode 100644
--- /dev/null
+++ b/netwerk/test/httpserver/httpd.manifest
@@ -0,0 +1,2 @@
+component {54ef6f81-30af-4b1d-ac55-8ba811293e41} httpd.js
+contract 54ef6f81-30af-4b1d-ac55-8ba811293e41 {@mozilla.org/server/jshttp;1}
\ No newline at end of file
--- a/toolkit/components/Makefile.in
+++ b/toolkit/components/Makefile.in
@@ -125,10 +125,11 @@ ifdef MOZ_FASTSTART
PARALLEL_DIRS += faststart
endif
DIRS += \
build \
$(NULL)
EXTRA_PP_COMPONENTS = nsDefaultCLH.js
+EXTRA_COMPONENTS = nsDefaultCLH.manifest
include $(topsrcdir)/config/rules.mk
--- a/toolkit/components/console/Makefile.in
+++ b/toolkit/components/console/Makefile.in
@@ -38,12 +38,12 @@
DEPTH = ../../..
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
-EXTRA_PP_COMPONENTS = jsconsole-clhandler.js
+EXTRA_PP_COMPONENTS = jsconsole-clhandler.js jsconsole-clhandler.manifest
include $(topsrcdir)/config/rules.mk
--- a/toolkit/components/console/jsconsole-clhandler.js
+++ b/toolkit/components/console/jsconsole-clhandler.js
@@ -61,17 +61,13 @@ jsConsoleHandler.prototype = {
}
if (cmdLine.state == Ci.nsICommandLine.STATE_REMOTE_AUTO)
cmdLine.preventDefault = true;
},
helpInfo : " -jsconsole Open the Error console.\n",
- classDescription: "jsConsoleHandler",
classID: Components.ID("{2cd0c310-e127-44d0-88fc-4435c9ab4d4b}"),
- contractID: "@mozilla.org/toolkit/console-clh;1",
QueryInterface: XPCOMUtils.generateQI([Ci.nsICommandLineHandler]),
- _xpcom_categories: [{category: "command-line-handler", entry: "b-jsconsole"}]
};
-function NSGetModule(compMgr, fileSpec)
- XPCOMUtils.generateModule([jsConsoleHandler]);
+var NSGetFactory = XPCOMUtils.generateNSGetFactory([jsConsoleHandler]);
new file mode 100644
--- /dev/null
+++ b/toolkit/components/console/jsconsole-clhandler.manifest
@@ -0,0 +1,3 @@
+component {2cd0c310-e127-44d0-88fc-4435c9ab4d4b} jsconsole-clhandler.js
+contract @mozilla.org/toolkit/console-clh;1 {2cd0c310-e127-44d0-88fc-4435c9ab4d4b}
+category command-line-handler b-jsconsole @mozilla.org/toolkit/console-clh;1
--- a/toolkit/components/contentprefs/src/Makefile.in
+++ b/toolkit/components/contentprefs/src/Makefile.in
@@ -38,11 +38,11 @@ DEPTH = ../../../..
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
MODULE = contentprefs
-EXTRA_COMPONENTS = nsContentPrefService.js
+EXTRA_COMPONENTS = nsContentPrefService.js nsContentPrefService.manifest
include $(topsrcdir)/config/rules.mk
--- a/toolkit/components/contentprefs/src/nsContentPrefService.js
+++ b/toolkit/components/contentprefs/src/nsContentPrefService.js
@@ -53,19 +53,17 @@ function ContentPrefService() {
// Observe shutdown so we can shut down the database connection.
this._observerSvc.addObserver(this, "xpcom-shutdown", false);
}
ContentPrefService.prototype = {
//**************************************************************************//
// XPCOM Plumbing
- classDescription: "Content Pref Service",
classID: Components.ID("{e6a3f533-4ffa-4615-8eb4-d4e72d883fa7}"),
- contractID: "@mozilla.org/content-pref/service;1",
QueryInterface: XPCOMUtils.generateQI([Ci.nsIContentPrefService]),
//**************************************************************************//
// Convenience Getters
// Observer Service
__observerSvc: null,
@@ -1019,22 +1017,19 @@ ContentPrefService.prototype = {
function HostnameGrouper() {}
HostnameGrouper.prototype = {
//**************************************************************************//
// XPCOM Plumbing
- classDescription: "Hostname Grouper",
classID: Components.ID("{8df290ae-dcaa-4c11-98a5-2429a4dc97bb}"),
- contractID: "@mozilla.org/content-pref/hostname-grouper;1",
QueryInterface: XPCOMUtils.generateQI([Ci.nsIContentURIGrouper]),
-
//**************************************************************************//
// nsIContentURIGrouper
group: function HostnameGrouper_group(aURI) {
var group;
try {
// Accessing the host property of the URI will throw an exception
@@ -1098,11 +1093,9 @@ AsyncStatement.prototype = {
});
}
};
//****************************************************************************//
// XPCOM Plumbing
var components = [ContentPrefService, HostnameGrouper];
-var NSGetModule = function ContentPrefService_NSGetModule(compMgr, fileSpec) {
- return XPCOMUtils.generateModule(components);
-}
+var NSGetFactory = XPCOMUtils.generateNSGetFactory(components);
new file mode 100644
--- /dev/null
+++ b/toolkit/components/contentprefs/src/nsContentPrefService.manifest
@@ -0,0 +1,4 @@
+component {e6a3f533-4ffa-4615-8eb4-d4e72d883fa7} nsContentPrefService.js
+contract @mozilla.org/content-pref/service;1 {e6a3f533-4ffa-4615-8eb4-d4e72d883fa7}
+component {8df290ae-dcaa-4c11-98a5-2429a4dc97bb} nsContentPrefService.js
+contract @mozilla.org/content-pref/hostname-grouper;1 {8df290ae-dcaa-4c11-98a5-2429a4dc97bb}
--- a/toolkit/components/downloads/src/Makefile.in
+++ b/toolkit/components/downloads/src/Makefile.in
@@ -63,15 +63,16 @@ endif
# definition of MOZ_SUITE is only added via config.mk
include $(topsrcdir)/config/config.mk
ifndef MOZ_SUITE
# XXX - Until Suite builds off XULRunner we can't guarantee our implementation
# of nsIDownloadManagerUI overrides toolkit's.
EXTRA_COMPONENTS = \
nsDownloadManagerUI.js \
+ nsDownloadManagerUI.manifest \
$(NULL)
endif
include $(topsrcdir)/config/rules.mk
EXTRA_DSO_LDOPTS += $(MOZ_COMPONENT_LIBS)
--- a/toolkit/components/downloads/src/nsDownloadManagerUI.js
+++ b/toolkit/components/downloads/src/nsDownloadManagerUI.js
@@ -46,19 +46,17 @@ const DOWNLOAD_MANAGER_URL = "chrome://m
const PREF_FLASH_COUNT = "browser.download.manager.flashCount";
////////////////////////////////////////////////////////////////////////////////
//// nsDownloadManagerUI class
function nsDownloadManagerUI() {}
nsDownloadManagerUI.prototype = {
- classDescription: "Used to show the Download Manager's UI to the user",
classID: Components.ID("7dfdf0d1-aff6-4a34-bad1-d0fe74601642"),
- contractID: "@mozilla.org/download-manager-ui;1",
//////////////////////////////////////////////////////////////////////////////
//// nsIDownloadManagerUI
show: function show(aWindowContext, aID, aReason)
{
if (!aReason)
aReason = Ci.nsIDownloadManagerUI.REASON_USER_INTERACTED;
@@ -146,14 +144,10 @@ nsDownloadManagerUI.prototype = {
QueryInterface: XPCOMUtils.generateQI([Ci.nsIDownloadManagerUI])
};
////////////////////////////////////////////////////////////////////////////////
//// Module
let components = [nsDownloadManagerUI];
+var NSGetFactory = XPCOMUtils.generateNSGetFactory(components);
-function NSGetModule(compMgr, fileSpec)
-{
- return XPCOMUtils.generateModule(components);
-}
-
new file mode 100644
--- /dev/null
+++ b/toolkit/components/downloads/src/nsDownloadManagerUI.manifest
@@ -0,0 +1,2 @@
+component {7dfdf0d1-aff6-4a34-bad1-d0fe74601642} nsDownloadManagerUI.js
+contract @mozilla.org/download-manager-ui;1 {7dfdf0d1-aff6-4a34-bad1-d0fe74601642}
--- a/toolkit/components/feeds/src/FeedProcessor.js
+++ b/toolkit/components/feeds/src/FeedProcessor.js
@@ -246,19 +246,17 @@ FeedResult.prototype = {
uri: null,
stylesheet: null,
registerExtensionPrefix: function FR_registerExtensionPrefix(ns, prefix) {
throw Cr.NS_ERROR_NOT_IMPLEMENTED;
},
// XPCOM stuff
- classDescription: FR_CLASSNAME,
classID: FR_CLASSID,
- contractID: FR_CONTRACTID,
QueryInterface: XPCOMUtils.generateQI([Ci.nsIFeedResult])
}
function Feed() {
this.subtitle = null;
this.title = null;
this.items = Cc[ARRAY_CONTRACTID].createInstance(Ci.nsIMutableArray);
this.link = null;
@@ -422,19 +420,17 @@ Feed.prototype = {
this.fields.setPropertyAsAString(fieldLists[i][j],
textConstruct.text);
}
}
}
},
// XPCOM stuff
- classDescription: FEED_CLASSNAME,
classID: FEED_CLASSID,
- contractID: FEED_CONTRACTID,
QueryInterface: XPCOMUtils.generateQI([Ci.nsIFeed, Ci.nsIFeedContainer])
}
function Entry() {
this.summary = null;
this.content = null;
this.title = null;
this.fields = Cc["@mozilla.org/hash-property-bag;1"].
@@ -635,19 +631,17 @@ Entry.prototype = {
enc.setPropertyAsAString("length", contentElement.getPropertyAsAString("fileSize"));
}
this._addToEnclosures(enc);
}
},
// XPCOM stuff
- classDescription: ENTRY_CLASSNAME,
classID: ENTRY_CLASSID,
- contractID: ENTRY_CONTRACTID,
QueryInterface: XPCOMUtils.generateQI(
[Ci.nsIFeedEntry, Ci.nsIFeedContainer]
)
}
Entry.prototype._atomLinksToURI = Feed.prototype._atomLinksToURI;
Entry.prototype._resolveURI = Feed.prototype._resolveURI;
Entry.prototype._resetBagMembersToRawText =
@@ -687,19 +681,17 @@ TextConstruct.prototype = {
else
return null;
return this.unescapeHTML.parseFragment(this.text, isXML,
this.base, element);
},
// XPCOM stuff
- classDescription: TEXTCONSTRUCT_CLASSNAME,
classID: TEXTCONSTRUCT_CLASSID,
- contractID: TEXTCONSTRUCT_CONTRACTID,
QueryInterface: XPCOMUtils.generateQI([Ci.nsIFeedTextConstruct])
}
// Generator represents the software that produced the feed
function Generator() {
this.lang = null;
this.agent = null;
this.version = null;
@@ -727,19 +719,17 @@ Generator.prototype = {
uriAttribute = this._attributes.getValueFromName(RDF_NS,"resource");
if (uriAttribute) {
this.agent = uriAttribute;
this.uri = strToURI(uriAttribute, this.baseURI);
}
},
// XPCOM stuff
- classDescription: GENERATOR_CLASSNAME,
classID: GENERATOR_CLASSID,
- contractID: GENERATOR_CONTRACTID,
QueryInterface: XPCOMUtils.generateQI(
[Ci.nsIFeedGenerator, Ci.nsIFeedElementBase]
)
}
function Person() {
this.name = null;
this.uri = null;
@@ -747,19 +737,17 @@ function Person() {
// nsIFeedElementBase
this.attributes = null;
this.baseURI = null;
}
Person.prototype = {
// XPCOM stuff
- classDescription: PERSON_CLASSNAME,
classID: PERSON_CLASSID,
- contractID: PERSON_CONTRACTID,
QueryInterface: XPCOMUtils.generateQI(
[Ci.nsIFeedPerson, Ci.nsIFeedElementBase]
)
}
/**
* Map a list of fields into properties on a container.
*
@@ -1918,23 +1906,19 @@ FeedProcessor.prototype = {
// XHTML will cause us to peek too far. The XHTML handler will
// send us an end element to call. RFC4287-valid feeds allow a
// more graceful way to handle this. Unfortunately, we can't count
// on compliance at this point.
this.endElement(uri, localName, qName);
},
// XPCOM stuff
- classDescription: FP_CLASSNAME,
classID: FP_CLASSID,
- contractID: FP_CONTRACTID,
QueryInterface: XPCOMUtils.generateQI(
[Ci.nsIFeedProcessor, Ci.nsISAXContentHandler, Ci.nsISAXErrorHandler,
Ci.nsIStreamListener, Ci.nsIRequestObserver]
)
}
var components = [FeedProcessor, FeedResult, Feed, Entry,
TextConstruct, Generator, Person];
-function NSGetModule(compMgr, fileSpec) {
- return XPCOMUtils.generateModule(components);
-
-}
+
+var NSGetFactory = XPCOMUtils.generateNSGetFactory(components);
new file mode 100644
--- /dev/null
+++ b/toolkit/components/feeds/src/FeedProcessor.manifest
@@ -0,0 +1,14 @@
+component {072a5c3d-30c6-4f07-b87f-9f63d51403f2} FeedProcessor.js
+contract @mozilla.org/feed-result;1 {072a5c3d-30c6-4f07-b87f-9f63d51403f2}
+component {5d0cfa97-69dd-4e5e-ac84-f253162e8f9a} FeedProcessor.js
+contract @mozilla.org/feed;1 {5d0cfa97-69dd-4e5e-ac84-f253162e8f9a}
+component {8e4444ff-8e99-4bdd-aa7f-fb3c1c77319f} FeedProcessor.js
+contract @mozilla.org/feed-entry;1 {8e4444ff-8e99-4bdd-aa7f-fb3c1c77319f}
+component {b992ddcd-3899-4320-9909-924b3e72c922} FeedProcessor.js
+contract @mozilla.org/feed-textconstruct;1 {b992ddcd-3899-4320-9909-924b3e72c922}
+component {414af362-9ad8-4296-898e-62247f25a20e} FeedProcessor.js
+contract @mozilla.org/feed-generator;1 {414af362-9ad8-4296-898e-62247f25a20e}
+component {95c963b7-20b2-11db-92f6-001422106990} FeedProcessor.js
+contract @mozilla.org/feed-person;1 {95c963b7-20b2-11db-92f6-001422106990}
+component {26acb1f0-28fc-43bc-867a-a46aabc85dd4} FeedProcessor.js
+contract @mozilla.org/feed-processor;1 {26acb1f0-28fc-43bc-867a-a46aabc85dd4}
--- a/toolkit/components/feeds/src/Makefile.in
+++ b/toolkit/components/feeds/src/Makefile.in
@@ -47,11 +47,11 @@ LIBRARY_NAME = feed_s
MOZILLA_INTERNAL_API = 1
FORCE_STATIC_LIB = 1
LIBXUL_LIBRARY = 1
CPPSRCS = nsScriptableUnescapeHTML.cpp \
$(NULL)
-EXTRA_COMPONENTS = FeedProcessor.js
+EXTRA_COMPONENTS = FeedProcessor.js FeedProcessor.manifest
include $(topsrcdir)/config/rules.mk
--- a/toolkit/components/filepicker/src/Makefile.in
+++ b/toolkit/components/filepicker/src/Makefile.in
@@ -53,18 +53,13 @@ MODULE_NAME = nsFileViewModule
LIBXUL_LIBRARY = 1
CPPSRCS = \
nsFileView.cpp \
$(NULL)
EXTRA_COMPONENTS = nsFilePicker.js
-
-GARBAGE += nsFilePicker.js
+EXTRA_PP_COMPONENTS = nsFilePicker.manifest
include $(topsrcdir)/config/rules.mk
EXTRA_DSO_LDOPTS += $(MOZ_COMPONENT_LIBS)
-
-nsFilePicker.js: nsFilePicker.js.in
- $(PYTHON) $(MOZILLA_DIR)/config/Preprocessor.py $(DEFINES) $(ACDEFINES) $^ > $@
-
rename from toolkit/components/filepicker/src/nsFilePicker.js.in
rename to toolkit/components/filepicker/src/nsFilePicker.js
--- a/toolkit/components/filepicker/src/nsFilePicker.js.in
+++ b/toolkit/components/filepicker/src/nsFilePicker.js
@@ -45,21 +45,20 @@
*
* In JS, you can actually cheat, because a thrown exception will cause the
* CreateInstance call to fail in turn, but not all languages are so lucky.
* (Though ANSI C++ provides exceptions, they are verboten in Mozilla code
* for portability reasons -- and even when you're building completely
* platform-specific code, you can't throw across an XPCOM method boundary.)
*/
+Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
const DEBUG = false; /* set to true to enable debug messages */
-const FILEPICKER_CONTRACTID = "@mozilla.org/filepicker;1";
-const FILEPICKER_CID = Components.ID("{54ae32f8-1dd2-11b2-a209-df7c505370f8}");
const LOCAL_FILE_CONTRACTID = "@mozilla.org/file/local;1";
const APPSHELL_SERV_CONTRACTID = "@mozilla.org/appshell/appShellService;1";
const STRBUNDLE_SERV_CONTRACTID = "@mozilla.org/intl/stringbundle;1";
const nsIAppShellService = Components.interfaces.nsIAppShellService;
const nsILocalFile = Components.interfaces.nsILocalFile;
const nsIFileURL = Components.interfaces.nsIFileURL;
const nsISupports = Components.interfaces.nsISupports;
@@ -94,16 +93,26 @@ function nsFilePicker()
var dir = Components.classes[LOCAL_FILE_CONTRACTID].createInstance(nsILocalFile);
dir.initWithPath(lastDirectory);
this.mDisplayDirectory = dir;
} catch (e) {}
}
}
nsFilePicker.prototype = {
+ classID: Components.ID("{54ae32f8-1dd2-11b2-a209-df7c505370f8}");
+
+ QueryInterface: function(iid) {
+ if (iid.equals(nsIFilePicker) ||
+ iid.equals(nsISupports))
+ return this;
+
+ throw Components.results.NS_ERROR_NO_INTERFACE;
+ },
+
/* attribute nsILocalFile displayDirectory; */
set displayDirectory(a) {
this.mDisplayDirectory = a &&
a.clone().QueryInterface(nsILocalFile);
},
get displayDirectory() {
return this.mDisplayDirectory &&
@@ -190,24 +199,16 @@ nsFilePicker.prototype = {
}
},
appendFilter: function(title, extensions) {
this.mFilterTitles.push(title);
this.mFilters.push(extensions);
},
- QueryInterface: function(iid) {
- if (iid.equals(nsIFilePicker) ||
- iid.equals(nsISupports))
- return this;
-
- throw Components.results.NS_ERROR_NO_INTERFACE;
- },
-
show: function() {
var o = new Object();
o.title = this.mTitle;
o.mode = this.mMode;
o.displayDirectory = this.mDisplayDirectory;
o.defaultString = this.mDefaultString;
o.filterIndex = this.mFilterIndex;
o.filters = new Object();
@@ -259,79 +260,21 @@ nsFilePicker.prototype = {
return o.retvals.buttonStatus;
} catch(ex) { dump("unable to open file picker\n" + ex + "\n"); }
return null;
}
}
if (DEBUG)
- debug = function (s) { dump("-*- filepicker: " + s + "\n"); }
+ debug = function (s) { dump("-*- filepicker: " + s + "\n"); };
else
- debug = function (s) {}
-
-/* module foo */
-
-var filePickerModule = new Object();
-
-filePickerModule.registerSelf =
-function (compMgr, fileSpec, location, type)
-{
- debug("registering (all right -- a JavaScript module!)");
- compMgr = compMgr.QueryInterface(Components.interfaces.nsIComponentRegistrar);
-
- compMgr.registerFactoryLocation(FILEPICKER_CID,
- "FilePicker JS Component",
-#ifndef MOZ_WIDGET_GTK2
- FILEPICKER_CONTRACTID,
-#else
- "",
-#endif
- fileSpec,
- location,
- type);
-}
-
-filePickerModule.getClassObject =
-function (compMgr, cid, iid) {
- if (!cid.equals(FILEPICKER_CID))
- throw Components.results.NS_ERROR_NO_INTERFACE;
+ debug = function (s) {};
- if (!iid.equals(Components.interfaces.nsIFactory))
- throw Components.results.NS_ERROR_NOT_IMPLEMENTED;
-
- return filePickerFactory;
-}
-
-filePickerModule.canUnload =
-function(compMgr)
-{
- debug("Unloading component.");
- return true;
-}
-
-/* factory object */
-var filePickerFactory = new Object();
-
-filePickerFactory.createInstance =
-function (outer, iid) {
- debug("CI: " + iid);
- debug("IID:" + nsIFilePicker);
- if (outer != null)
- throw Components.results.NS_ERROR_NO_AGGREGATION;
-
- return (new nsFilePicker()).QueryInterface(iid);
-}
-
-/* entrypoint */
-function NSGetModule(compMgr, fileSpec) {
- return filePickerModule;
-}
-
-
+var NSGetFactory = XPCOMUtils.generateNSGetFactory([nsFilePicker]);
/* crap from strres.js that I want to use for string bundles since I can't include another .js file.... */
var strBundleService = null;
function srGetStrBundle(path)
{
var strBundle = null;
new file mode 100644
--- /dev/null
+++ b/toolkit/components/filepicker/src/nsFilePicker.manifest
@@ -0,0 +1,4 @@
+component {54ae32f8-1dd2-11b2-a209-df7c505370f8} nsFilePicker.js
+#ifndef MOZ_WIDGET_GTK2
+contract @mozilla.org/filepicker;1 {54ae32f8-1dd2-11b2-a209-df7c505370f8}
+#endif
--- a/toolkit/components/nsDefaultCLH.js
+++ b/toolkit/components/nsDefaultCLH.js
@@ -31,24 +31,22 @@
# use your version of this file under the terms of the MPL, indicate your
# decision by deleting the provisions above and replace them with the notice
# 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 *****
+Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
+
const nsISupports = Components.interfaces.nsISupports;
-const nsICategoryManager = Components.interfaces.nsICategoryManager;
-const nsIComponentRegistrar = Components.interfaces.nsIComponentRegistrar;
const nsICommandLine = Components.interfaces.nsICommandLine;
const nsICommandLineHandler = Components.interfaces.nsICommandLineHandler;
-const nsIFactory = Components.interfaces.nsIFactory;
-const nsIModule = Components.interfaces.nsIModule;
const nsIPrefBranch = Components.interfaces.nsIPrefBranch;
const nsISupportsString = Components.interfaces.nsISupportsString;
const nsIWindowWatcher = Components.interfaces.nsIWindowWatcher;
const nsIProperties = Components.interfaces.nsIProperties;
const nsIFile = Components.interfaces.nsIFile;
const nsISimpleEnumerator = Components.interfaces.nsISimpleEnumerator;
/**
@@ -63,27 +61,23 @@ const nsISimpleEnumerator = Compone
*/
function getDirectoryService()
{
return Components.classes["@mozilla.org/file/directory_service;1"]
.getService(nsIProperties);
}
-var nsDefaultCLH = {
+function nsDefaultCLH() { }
+nsDefaultCLH.prototype = {
+ classID: Components.ID("{6ebc941a-f2ff-4d56-b3b6-f7d0b9d73344}"),
+
/* nsISupports */
- QueryInterface : function clh_QI(iid) {
- if (iid.equals(nsICommandLineHandler) ||
- iid.equals(nsIFactory) ||
- iid.equals(nsISupports))
- return this;
-
- throw Components.results.NS_ERROR_NO_INTERFACE;
- },
+ QueryInterface : XPCOMUtils.generateQI([nsICommandLineHandler]),
/* nsICommandLineHandler */
handle : function clh_handle(cmdLine) {
var printDir;
while (printDir = cmdLine.handleFlagWithParam("print-xpcom-dir", false)) {
var out = "print-xpcom-dir(\"" + printDir + "\"): ";
try {
@@ -155,83 +149,11 @@ var nsDefaultCLH = {
.getService(nsIWindowWatcher);
wwatch.openWindow(null, chromeURI, "_blank",
flags, cmdLine);
}
catch (e) { }
},
helpInfo : "",
-
- /* nsIFactory */
-
- createInstance : function mdh_CI(outer, iid) {
- if (outer != null)
- throw Components.results.NS_ERROR_NO_AGGREGATION;
-
- return this.QueryInterface(iid);
- },
-
- lockFactory : function mdh_lock(lock) {
- /* no-op */
- }
};
-const clh_contractID = "@mozilla.org/toolkit/default-clh;1";
-const clh_CID = Components.ID("{6ebc941a-f2ff-4d56-b3b6-f7d0b9d73344}");
-
-var Module = {
- /* nsISupports */
-
- QueryInterface : function mod_QI(iid) {
- if (iid.equals(nsIModule) ||
- iid.equals(nsISupports))
- return this;
-
- throw Components.results.NS_ERROR_NO_INTERFACE;
- },
-
- /* nsIModule */
-
- getClassObject : function mod_gch(compMgr, cid, iid) {
- if (cid.equals(clh_CID))
- return nsDefaultCLH.QueryInterface(iid);
-
- throw components.results.NS_ERROR_FAILURE;
- },
-
- registerSelf : function mod_regself(compMgr, fileSpec, location, type) {
- var compReg = compMgr.QueryInterface(nsIComponentRegistrar);
-
- compReg.registerFactoryLocation(clh_CID,
- "nsDefaultCLH",
- clh_contractID,
- fileSpec,
- location,
- type);
-
- var catMan = Components.classes["@mozilla.org/categorymanager;1"]
- .getService(nsICategoryManager);
-
- catMan.addCategoryEntry("command-line-handler",
- "y-default",
- clh_contractID, true, true);
- },
-
- unregisterSelf : function mod_unreg(compMgr, location, type) {
- var compReg = compMgr.QueryInterface(nsIComponentRegistrar);
- compReg.unregisterFactoryLocation(clh_CID, location);
-
- var catMan = Components.classes["@mozilla.org/categorymanager;1"]
- .getService(nsICategoryManager);
-
- catMan.deleteCategoryEntry("command-line-handler",
- "y-default");
- },
-
- canUnload : function (compMgr) {
- return true;
- }
-};
-
-function NSGetModule(compMgr, fileSpec) {
- return Module;
-}
+var NSGetFactory = XPCOMUtils.generateNSGetFactory([nsDefaultCLH]);
new file mode 100644
--- /dev/null
+++ b/toolkit/components/nsDefaultCLH.manifest
@@ -0,0 +1,3 @@
+component {6ebc941a-f2ff-4d56-b3b6-f7d0b9d73344} nsDefaultCLH.js
+contract @mozilla.org/toolkit/default-clh;1 {6ebc941a-f2ff-4d56-b3b6-f7d0b9d73344}
+category command-line-handler y-default @mozilla.org/toolkit/default-clh;1
--- a/toolkit/components/passwordmgr/src/Makefile.in
+++ b/toolkit/components/passwordmgr/src/Makefile.in
@@ -39,18 +39,18 @@ topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
MODULE = loginmgr
EXTRA_COMPONENTS = \
+ passwordmgr.manifest \
nsLoginManager.js \
nsLoginManagerPrompter.js \
nsLoginInfo.js \
storage-Legacy.js \
storage-mozStorage.js \
crypto-SDR.js \
$(NULL)
-
include $(topsrcdir)/config/rules.mk
--- a/toolkit/components/passwordmgr/src/crypto-SDR.js
+++ b/toolkit/components/passwordmgr/src/crypto-SDR.js
@@ -43,18 +43,16 @@ Components.utils.import("resource://gre/
Components.utils.import("resource://gre/modules/Services.jsm");
function LoginManagerCrypto_SDR() {
this.init();
};
LoginManagerCrypto_SDR.prototype = {
- classDescription : "LoginManagerCrypto_SDR",
- contractID : "@mozilla.org/login-manager/crypto/SDR;1",
classID : Components.ID("{dc6c2976-0f73-4f1f-b9ff-3d72b4e28309}"),
QueryInterface : XPCOMUtils.generateQI([Ci.nsILoginManagerCrypto]),
__decoderRing : null, // nsSecretDecoderRing service
get _decoderRing() {
if (!this.__decoderRing)
this.__decoderRing = Cc["@mozilla.org/security/sdr;1"].
getService(Ci.nsISecretDecoderRing);
@@ -178,11 +176,9 @@ LoginManagerCrypto_SDR.prototype = {
throw Components.Exception("Couldn't decrypt string", Cr.NS_ERROR_FAILURE);
}
return plainText;
}
}; // end of nsLoginManagerCrypto_SDR implementation
let component = [LoginManagerCrypto_SDR];
-function NSGetModule(compMgr, fileSpec) {
- return XPCOMUtils.generateModule(component);
-}
+var NSGetFactory = XPCOMUtils.generateNSGetFactory(component);
--- a/toolkit/components/passwordmgr/src/nsLoginInfo.js
+++ b/toolkit/components/passwordmgr/src/nsLoginInfo.js
@@ -39,18 +39,16 @@ const Cc = Components.classes;
const Ci = Components.interfaces;
Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
function nsLoginInfo() {}
nsLoginInfo.prototype = {
- classDescription : "LoginInfo",
- contractID : "@mozilla.org/login-manager/loginInfo;1",
classID : Components.ID("{0f2f347c-1e4f-40cc-8efd-792dea70a85e}"),
QueryInterface: XPCOMUtils.generateQI([Ci.nsILoginInfo, Ci.nsILoginMetaInfo]),
// Allow storage-Legacy.js to get at the JS object so it can
// slap on a few extra properties for internal use.
get wrappedJSObject() {
return this;
},
@@ -136,12 +134,9 @@ nsLoginInfo.prototype = {
guid : null,
timeCreated : null,
timeLastUsed : null,
timePasswordChanged : null,
timesUsed : null
}; // end of nsLoginInfo implementation
-var component = [nsLoginInfo];
-function NSGetModule(compMgr, fileSpec) {
- return XPCOMUtils.generateModule(component);
-}
+var NSGetFactory = XPCOMUtils.generateNSGetFactory([nsLoginInfo]);
--- a/toolkit/components/passwordmgr/src/nsLoginManager.js
+++ b/toolkit/components/passwordmgr/src/nsLoginManager.js
@@ -43,18 +43,16 @@ Components.utils.import("resource://gre/
Components.utils.import("resource://gre/modules/Services.jsm");
function LoginManager() {
this.init();
}
LoginManager.prototype = {
- classDescription: "LoginManager",
- contractID: "@mozilla.org/login-manager;1",
classID: Components.ID("{cb9e0de8-3598-4ed7-857b-827f011ad5d8}"),
QueryInterface : XPCOMUtils.generateQI([Ci.nsILoginManager,
Ci.nsISupportsWeakReference]),
/* ---------- private memebers ---------- */
@@ -1351,12 +1349,9 @@ UserAutoCompleteResult.prototype = {
if (removeFromDB) {
var pwmgr = Cc["@mozilla.org/login-manager;1"].
getService(Ci.nsILoginManager);
pwmgr.removeLogin(removedLogin);
}
}
};
-var component = [LoginManager];
-function NSGetModule (compMgr, fileSpec) {
- return XPCOMUtils.generateModule(component);
-}
+var NSGetFactory = XPCOMUtils.generateNSGetFactory([LoginManager]);
--- a/toolkit/components/passwordmgr/src/nsLoginManagerPrompter.js
+++ b/toolkit/components/passwordmgr/src/nsLoginManagerPrompter.js
@@ -51,18 +51,16 @@ Components.utils.import("resource://gre/
* Invoked by [toolkit/components/prompts/src/nsPrompter.js]
*/
function LoginManagerPromptFactory() {
Services.obs.addObserver(this, "quit-application-granted", true);
}
LoginManagerPromptFactory.prototype = {
- classDescription : "LoginManagerPromptFactory",
- contractID : "@mozilla.org/passwordmanager/authpromptfactory;1",
classID : Components.ID("{749e62f4-60ae-4569-a8a2-de78b649660e}"),
QueryInterface : XPCOMUtils.generateQI([Ci.nsIPromptFactory, Ci.nsIObserver, Ci.nsISupportsWeakReference]),
_debug : false,
_asyncPrompts : {},
_asyncPromptInProgress : false,
observe : function (subject, topic, data) {
@@ -178,18 +176,16 @@ LoginManagerPromptFactory.prototype = {
*
* nsILoginManagerPrompter: Used by Login Manager for saving/changing logins
* found in HTML forms.
*/
function LoginManagerPrompter() {}
LoginManagerPrompter.prototype = {
- classDescription : "LoginManagerPrompter",
- contractID : "@mozilla.org/login-manager/prompter;1",
classID : Components.ID("{8aa66d77-1bbb-45a6-991e-b8f47751c291}"),
QueryInterface : XPCOMUtils.generateQI([Ci.nsIAuthPrompt,
Ci.nsIAuthPrompt2,
Ci.nsILoginManagerPrompter]),
_factory : null,
_window : null,
_debug : false, // mirrors signon.debug
@@ -1377,11 +1373,9 @@ LoginManagerPrompter.prototype = {
}
}
}
}; // end of LoginManagerPrompter implementation
var component = [LoginManagerPromptFactory, LoginManagerPrompter];
-function NSGetModule(compMgr, fileSpec) {
- return XPCOMUtils.generateModule(component);
-}
+var NSGetFactory = XPCOMUtils.generateNSGetFactory(component);
new file mode 100644
--- /dev/null
+++ b/toolkit/components/passwordmgr/src/passwordmgr.manifest
@@ -0,0 +1,14 @@
+component {cb9e0de8-3598-4ed7-857b-827f011ad5d8} nsLoginManager.js
+contract @mozilla.org/login-manager;1 {cb9e0de8-3598-4ed7-857b-827f011ad5d8}
+component {749e62f4-60ae-4569-a8a2-de78b649660e} nsLoginManagerPrompter.js
+contract @mozilla.org/passwordmanager/authpromptfactory;1 {749e62f4-60ae-4569-a8a2-de78b649660e}
+component {8aa66d77-1bbb-45a6-991e-b8f47751c291} nsLoginManagerPrompter.js
+contract @mozilla.org/login-manager/prompter;1 {8aa66d77-1bbb-45a6-991e-b8f47751c291}
+component {0f2f347c-1e4f-40cc-8efd-792dea70a85e} nsLoginInfo.js
+contract @mozilla.org/login-manager/loginInfo;1 {0f2f347c-1e4f-40cc-8efd-792dea70a85e}
+component {e09e4ca6-276b-4bb4-8b71-0635a3a2a007} storage-Legacy.js
+contract @mozilla.org/login-manager/storage/legacy;1 {e09e4ca6-276b-4bb4-8b71-0635a3a2a007}
+component {8c2023b9-175c-477e-9761-44ae7b549756} storage-mozStorage.js
+contract @mozilla.org/login-manager/storage/mozStorage;1 {8c2023b9-175c-477e-9761-44ae7b549756}
+component {dc6c2976-0f73-4f1f-b9ff-3d72b4e28309} crypto-SDR.js
+contract @mozilla.org/login-manager/crypto/SDR;1 {dc6c2976-0f73-4f1f-b9ff-3d72b4e28309}
--- a/toolkit/components/passwordmgr/src/storage-Legacy.js
+++ b/toolkit/components/passwordmgr/src/storage-Legacy.js
@@ -39,18 +39,16 @@ const Cc = Components.classes;
const Ci = Components.interfaces;
Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
function LoginManagerStorage_legacy() { };
LoginManagerStorage_legacy.prototype = {
- classDescription : "LoginManagerStorage_legacy",
- contractID : "@mozilla.org/login-manager/storage/legacy;1",
classID : Components.ID("{e09e4ca6-276b-4bb4-8b71-0635a3a2a007}"),
QueryInterface : XPCOMUtils.generateQI([Ci.nsILoginManagerStorage,
Ci.nsILoginManagerIEMigrationHelper]),
__logService : null, // Console logging service, used for debugging.
get _logService() {
if (!this.__logService)
this.__logService = Cc["@mozilla.org/consoleservice;1"].
@@ -1486,12 +1484,9 @@ LoginManagerStorage_legacy.prototype = {
// Add logins via the login manager (and not this.addLogin),
// lest an alternative storage module be in use.
for each (var login in logins)
this._migrationLoginManager.addLogin(login);
}
}; // end of nsLoginManagerStorage_legacy implementation
-var component = [LoginManagerStorage_legacy];
-function NSGetModule(compMgr, fileSpec) {
- return XPCOMUtils.generateModule(component);
-}
+var NSGetFactory = XPCOMUtils.generateNSGetFactory([LoginManagerStorage_legacy]);
--- a/toolkit/components/passwordmgr/src/storage-mozStorage.js
+++ b/toolkit/components/passwordmgr/src/storage-mozStorage.js
@@ -49,18 +49,16 @@ const ENCTYPE_SDR = 1;
Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
Components.utils.import("resource://gre/modules/Services.jsm");
function LoginManagerStorage_mozStorage() { };
LoginManagerStorage_mozStorage.prototype = {
- classDescription : "LoginManagerStorage_mozStorage",
- contractID : "@mozilla.org/login-manager/storage/mozStorage;1",
classID : Components.ID("{8c2023b9-175c-477e-9761-44ae7b549756}"),
QueryInterface : XPCOMUtils.generateQI([Ci.nsILoginManagerStorage]),
__crypto : null, // nsILoginManagerCrypto service
get _crypto() {
if (!this.__crypto)
this.__crypto = Cc["@mozilla.org/login-manager/crypto/SDR;1"].
getService(Ci.nsILoginManagerCrypto);
@@ -1557,11 +1555,9 @@ LoginManagerStorage_mozStorage.prototype
// Close the connection, ignore 'already closed' error
try { this._dbConnection.close() } catch(e) {}
this._signonsFile.remove(false);
}
}; // end of nsLoginManagerStorage_mozStorage implementation
let component = [LoginManagerStorage_mozStorage];
-function NSGetModule(compMgr, fileSpec) {
- return XPCOMUtils.generateModule(component);
-}
+var NSGetFactory = XPCOMUtils.generateNSGetFactory(component);
--- a/toolkit/components/places/src/Makefile.in
+++ b/toolkit/components/places/src/Makefile.in
@@ -73,16 +73,17 @@ EXTRA_DSO_LDOPTS += \
$(DEPTH)/db/morkreader/$(LIB_PREFIX)morkreader_s.$(LIB_SUFFIX) \
$(MOZ_UNICHARUTIL_LIBS) \
$(MOZ_COMPONENT_LIBS) \
$(NULL)
LOCAL_INCLUDES += -I$(srcdir)/../../build
EXTRA_COMPONENTS = \
+ toolkitplaces.manifest \
nsLivemarkService.js \
nsTaggingService.js \
nsPlacesDBFlush.js \
nsPlacesExpiration.js \
nsMicrosummaryService.js \
$(NULL)
ifdef MOZ_XUL
--- a/toolkit/components/places/src/nsLivemarkService.js
+++ b/toolkit/components/places/src/nsLivemarkService.js
@@ -503,18 +503,16 @@ LivemarkService.prototype = {
// remove the livemark from the update array
this._livemarks.splice(livemarkIndex, 1);
if (livemark.loadGroup)
livemark.loadGroup.cancel(Components.results.NS_BINDING_ABORTED);
},
// nsISupports
- classDescription: "Livemark Service",
- contractID: LS_CONTRACTID,
classID: Components.ID("{dca61eb5-c7cd-4df1-b0fb-d0722baba251}"),
QueryInterface: XPCOMUtils.generateQI([
Ci.nsILivemarkService
, Ci.nsINavBookmarkObserver
, Ci.nsIObserver
])
};
@@ -713,11 +711,9 @@ LivemarkLoadListener.prototype = {
, Ci.nsINavHistoryBatchCallback
, Ci.nsIBadCertListener2
, Ci.nsISSLErrorListener
, Ci.nsIInterfaceRequestor
])
}
let component = [LivemarkService];
-function NSGetModule(compMgr, fileSpec) {
- return XPCOMUtils.generateModule(component);
-}
+var NSGetFactory = XPCOMUtils.generateNSGetFactory(component);
--- a/toolkit/components/places/src/nsMicrosummaryService.js
+++ b/toolkit/components/places/src/nsMicrosummaryService.js
@@ -53,18 +53,16 @@ const MODE_WRONLY = 0x02;
const MODE_CREATE = 0x08;
const MODE_TRUNCATE = 0x20;
const NS_ERROR_MODULE_DOM = 2152923136;
const NS_ERROR_DOM_BAD_URI = NS_ERROR_MODULE_DOM + 1012;
// How often to check for microsummaries that need updating, in milliseconds.
const CHECK_INTERVAL = 15 * 1000; // 15 seconds
-// How often to check for generator updates, in seconds
-const GENERATOR_INTERVAL = 7 * 86400; // 1 week
// The default value of the update interval, used if there is no user's pref.
const DEFAULT_UPDATE_INTERVAL_MINUTES = 30;
const MICSUM_NS = "http://www.mozilla.org/microsummaries/0.1";
const XSLT_NS = "http://www.w3.org/1999/XSL/Transform";
const ANNO_MICSUM_GEN_URI = "microsummary/generatorURI";
@@ -122,24 +120,17 @@ MicrosummaryService.prototype = {
// A cache of local microsummary generators. This gets built on startup
// by the _cacheLocalGenerators() method.
_localGenerators: {},
// The timer that periodically checks for microsummaries needing updating.
_timer: null,
// XPCOM registration
- classDescription: "Microsummary Service",
- contractID: "@mozilla.org/microsummary/service;1",
classID: Components.ID("{460a9792-b154-4f26-a922-0f653e2c8f91}"),
- _xpcom_categories: [{ category: "update-timer",
- value: "@mozilla.org/microsummary/service;1," +
- "getService,microsummary-generator-update-timer," +
- "browser.microsummary.generatorUpdateInterval," +
- GENERATOR_INTERVAL }],
QueryInterface: XPCOMUtils.generateQI([Ci.nsIMicrosummaryService,
Ci.nsITimerCallback,
Ci.nsISupportsWeakReference,
Ci.nsIAnnotationObserver,
Ci.nsIObserver]),
// nsIObserver
observe: function MSS_observe(subject, topic, data) {
@@ -2151,11 +2142,9 @@ function sanitizeName(aName) {
// If our input had not enough valid characters, use a random name.
if (name.length < MIN_GENERATOR_NAME_LENGTH)
name = Math.random().toString(36).replace(/^.*\./, '');
// Force max length.
return name.substring(0, MAX_GENERATOR_NAME_LENGTH);
}
-function NSGetModule(compMgr, fileSpec) {
- return XPCOMUtils.generateModule([MicrosummaryService]);
-}
+var NSGetFactory = XPCOMUtils.generateNSGetFactory([MicrosummaryService]);
--- a/toolkit/components/places/src/nsPlacesDBFlush.js
+++ b/toolkit/components/places/src/nsPlacesDBFlush.js
@@ -376,36 +376,24 @@ nsPlacesDBFlush.prototype = {
timer.initWithCallback(this, this._syncInterval * 1000,
Ci.nsITimer.TYPE_REPEATING_SLACK);
return timer;
},
//////////////////////////////////////////////////////////////////////////////
//// nsISupports
- classDescription: "Used to synchronize the temporary and permanent tables of Places",
classID: Components.ID("c1751cfc-e8f1-4ade-b0bb-f74edfb8ef6a"),
- contractID: "@mozilla.org/places/sync;1",
-
- // Registering in these categories makes us get initialized when either of
- // those listeners would be notified.
- _xpcom_categories: [
- { category: "bookmark-observers" },
- { category: "history-observers" },
- ],
QueryInterface: XPCOMUtils.generateQI([
Ci.nsIObserver,
Ci.nsINavBookmarkObserver,
Ci.nsINavHistoryObserver,
Ci.nsITimerCallback,
Ci.mozIStorageStatementCallback,
])
};
////////////////////////////////////////////////////////////////////////////////
//// Module Registration
let components = [nsPlacesDBFlush];
-function NSGetModule(compMgr, fileSpec)
-{
- return XPCOMUtils.generateModule(components);
-}
+var NSGetFactory = XPCOMUtils.generateNSGetFactory(components);
--- a/toolkit/components/places/src/nsPlacesExpiration.js
+++ b/toolkit/components/places/src/nsPlacesExpiration.js
@@ -881,36 +881,25 @@ nsPlacesExpiration.prototype = {
timer.initWithCallback(this, interval * 1000,
Ci.nsITimer.TYPE_REPEATING_SLACK);
return this._timer = timer;
},
//////////////////////////////////////////////////////////////////////////////
//// nsISupports
- classDescription: "Used to expire obsolete data from Places",
classID: Components.ID("705a423f-2f69-42f3-b9fe-1517e0dee56f"),
- contractID: "@mozilla.org/places/expiration;1",
-
- // Registering in these categories makes us get initialized when either of
- // those listeners would be notified.
- _xpcom_categories: [
- { category: "history-observers" },
- ],
_xpcom_factory: nsPlacesExpirationFactory,
QueryInterface: XPCOMUtils.generateQI([
Ci.nsIObserver,
Ci.nsINavHistoryObserver,
Ci.nsITimerCallback,
Ci.mozIStorageStatementCallback,
])
};
////////////////////////////////////////////////////////////////////////////////
//// Module Registration
let components = [nsPlacesExpiration];
-function NSGetModule(compMgr, fileSpec)
-{
- return XPCOMUtils.generateModule(components);
-}
+var NSGetFactory = XPCOMUtils.generateNSGetFactory(components);
--- a/toolkit/components/places/src/nsTaggingService.js
+++ b/toolkit/components/places/src/nsTaggingService.js
@@ -429,18 +429,16 @@ TaggingService.prototype = {
onItemMoved: function(aItemId, aOldParent, aOldIndex, aNewParent, aNewIndex,
aItemType) {
if (this._tagFolders[aItemId] && this._bms.tagFolder == aOldParent &&
this._bms.tagFolder != aNewParent)
delete this._tagFolders[aItemId];
},
// nsISupports
- classDescription: "Places Tagging Service",
- contractID: "@mozilla.org/browser/tagging-service;1",
classID: Components.ID("{bbc23860-2553-479d-8b78-94d9038334f7}"),
QueryInterface: XPCOMUtils.generateQI([
Ci.nsITaggingService
, Ci.nsINavBookmarkObserver
, Ci.nsIObserver
])
};
@@ -651,17 +649,13 @@ TagAutoCompleteSearch.prototype = {
this._stopped = true;
},
// nsISupports
QueryInterface: XPCOMUtils.generateQI([
Ci.nsIAutoCompleteSearch
]),
- classDescription: "Places Tag AutoComplete",
- contractID: "@mozilla.org/autocomplete/search;1?name=places-tag-autocomplete",
classID: Components.ID("{1dcc23b0-d4cb-11dc-9ad6-479d56d89593}")
};
let component = [TaggingService, TagAutoCompleteSearch];
-function NSGetModule(compMgr, fileSpec) {
- return XPCOMUtils.generateModule(component);
-}
+var NSGetFactory = XPCOMUtils.generateNSGetFactory(component);
new file mode 100644
--- /dev/null
+++ b/toolkit/components/places/src/toolkitplaces.manifest
@@ -0,0 +1,17 @@
+component {dca61eb5-c7cd-4df1-b0fb-d0722baba251} nsLivemarkService.js
+contract @mozilla.org/browser/livemark-service;2 {dca61eb5-c7cd-4df1-b0fb-d0722baba251}
+component {bbc23860-2553-479d-8b78-94d9038334f7} nsTaggingService.js
+contract @mozilla.org/browser/tagging-service;1 {bbc23860-2553-479d-8b78-94d9038334f7}
+component {1dcc23b0-d4cb-11dc-9ad6-479d56d89593 nsTaggingService.js
+contract @mozilla.org/autocomplete/search;1?name=places-tag-autocomplete {1dcc23b0-d4cb-11dc-9ad6-479d56d89593
+component {c1751cfc-e8f1-4ade-b0bb-f74edfb8ef6a} nsPlacesDBFlush.js
+contract @mozilla.org/places/sync;1 {c1751cfc-e8f1-4ade-b0bb-f74edfb8ef6a}
+category bookmark-observers nsPlacesDBFlush @mozilla.org/places/sync;1
+category history-observers nsPlacesDBFlush @mozilla.org/places/sync;1
+component {705a423f-2f69-42f3-b9fe-1517e0dee56f} nsPlacesExpiration.js
+contract @mozilla.org/places/expiration;1 {705a423f-2f69-42f3-b9fe-1517e0dee56f}
+category history-observers nsPlacesExpiration @mozilla.org/places/expiration;1
+component {460a9792-b154-4f26-a922-0f653e2c8f91} nsMicrosummaryService.js
+contract @mozilla.org/microsummary/service;1 {460a9792-b154-4f26-a922-0f653e2c8f91}
+# How often to check for generator updates, in seconds 7 * 86400 == 1 week
+category update-timer nsMicrosummaryService @mozilla.org/microsummary/service;1,getService,microsummary-generator-update-timer,browser.microsummary.generatorUpdateInterval,604800
--- a/toolkit/components/prompts/src/Makefile.in
+++ b/toolkit/components/prompts/src/Makefile.in
@@ -40,11 +40,12 @@ srcdir = @srcdir@
VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
MODULE = prompter
EXTRA_COMPONENTS = \
nsPrompter.js \
+ nsPrompter.manifest \
$(NULL)
include $(topsrcdir)/config/rules.mk
--- a/toolkit/components/prompts/src/nsPrompter.js
+++ b/toolkit/components/prompts/src/nsPrompter.js
@@ -43,18 +43,16 @@ const Cu = Components.utils;
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
Cu.import("resource://gre/modules/Services.jsm");
function Prompter() {
// Note that EmbedPrompter clones this implementation.
}
Prompter.prototype = {
- classDescription : "Prompter",
- contractID : "@mozilla.org/prompter;1",
classID : Components.ID("{1c978d25-b37f-43a8-a2d6-0c7a239ead87}"),
QueryInterface : XPCOMUtils.generateQI([Ci.nsIPromptFactory, Ci.nsIPromptService, Ci.nsIPromptService2]),
/* ---------- private memebers ---------- */
pickPrompter : function (domWin) {
return new ModalPrompter(domWin);
@@ -690,18 +688,16 @@ ModalPrompter.prototype = {
throw Cr.NS_ERROR_NOT_IMPLEMENTED;
},
};
function AuthPromptAdapterFactory() {
}
AuthPromptAdapterFactory.prototype = {
- classDescription : "AuthPromptAdapterFactory",
- contractID : "@mozilla.org/network/authprompt-adapter-factory;1",
classID : Components.ID("{6e134924-6c3a-4d86-81ac-69432dd971dc}"),
QueryInterface : XPCOMUtils.generateQI([Ci.nsIAuthPromptAdapterFactory]),
/* ---------- nsIAuthPromptAdapterFactory ---------- */
createAdapter : function (oldPrompter) {
return new AuthPromptAdapter(oldPrompter);
}
@@ -745,17 +741,12 @@ AuthPromptAdapter.prototype = {
};
// Wrapper using the old embedding contractID, since it's already common in
// the addon ecosystem.
function EmbedPrompter() {
}
EmbedPrompter.prototype = new Prompter();
-EmbedPrompter.prototype.classDescription = "EmbedPrompter";
-EmbedPrompter.prototype.contractID = "@mozilla.org/embedcomp/prompt-service;1"; // NS_PROMPTSERVICE_CONTRACTID
EmbedPrompter.prototype.classID = Components.ID("{7ad1b327-6dfa-46ec-9234-f2a620ea7e00}");
-
var component = [Prompter, EmbedPrompter, AuthPromptAdapterFactory];
-function NSGetModule (compMgr, fileSpec) {
- return XPCOMUtils.generateModule(component);
-}
+var NSGetFactory = XPCOMUtils.generateNSGetFactory(component);
new file mode 100644
--- /dev/null
+++ b/toolkit/components/prompts/src/nsPrompter.manifest
@@ -0,0 +1,6 @@
+component {1c978d25-b37f-43a8-a2d6-0c7a239ead87} nsPrompter.js
+contract @mozilla.org/prompter;1 {1c978d25-b37f-43a8-a2d6-0c7a239ead87}
+component {6e134924-6c3a-4d86-81ac-69432dd971dc} nsPrompter.js
+contract @mozilla.org/network/authprompt-adapter-factory;1 {6e134924-6c3a-4d86-81ac-69432dd971dc}
+component {7ad1b327-6dfa-46ec-9234-f2a620ea7e00} nsPrompter.js
+contract @mozilla.org/embedcomp/prompt-service;1 {7ad1b327-6dfa-46ec-9234-f2a620ea7e00}
--- a/toolkit/components/satchel/src/Makefile.in
+++ b/toolkit/components/satchel/src/Makefile.in
@@ -48,16 +48,17 @@ LIBRARY_NAME = satchel
MODULE_NAME = satchel
IS_COMPONENT = 1
LIBXUL_LIBRARY = 1
EXPORT_LIBRARY = 1
EXTRA_COMPONENTS = \
nsFormHistory.js \
nsFormAutoComplete.js \
+ satchel.manifest \
$(NULL)
CPPSRCS = nsFormFillController.cpp \
$(NULL)
LOCAL_INCLUDES = \
-I$(srcdir)/../../build \
--- a/toolkit/components/satchel/src/nsFormAutoComplete.js
+++ b/toolkit/components/satchel/src/nsFormAutoComplete.js
@@ -42,18 +42,16 @@ const Cr = Components.results;
Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
Components.utils.import("resource://gre/modules/Services.jsm");
function FormAutoComplete() {
this.init();
}
FormAutoComplete.prototype = {
- classDescription : "FormAutoComplete",
- contractID : "@mozilla.org/satchel/form-autocomplete;1",
classID : Components.ID("{c11c21b2-71c9-4f87-a0f8-5e13f50495fd}"),
QueryInterface : XPCOMUtils.generateQI([Ci.nsIFormAutoComplete, Ci.nsISupportsWeakReference]),
__formHistory : null,
get _formHistory() {
if (!this.__formHistory)
this.__formHistory = Cc["@mozilla.org/satchel/form-history;1"].
getService(Ci.nsIFormHistory2);
@@ -444,11 +442,9 @@ FormAutoCompleteResult.prototype = {
let [removedEntry] = this.entries.splice(index, 1);
if (removeFromDB)
this.formHistory.removeEntry(this.fieldName, removedEntry.text);
}
};
let component = [FormAutoComplete];
-function NSGetModule (compMgr, fileSpec) {
- return XPCOMUtils.generateModule(component);
-}
+var NSGetFactory = XPCOMUtils.generateNSGetFactory(component);
--- a/toolkit/components/satchel/src/nsFormHistory.js
+++ b/toolkit/components/satchel/src/nsFormHistory.js
@@ -46,18 +46,16 @@ Components.utils.import("resource://gre/
const DB_VERSION = 3;
const DAY_IN_MS = 86400000; // 1 day in milliseconds
function FormHistory() {
this.init();
}
FormHistory.prototype = {
- classDescription : "FormHistory",
- contractID : "@mozilla.org/satchel/form-history;1",
classID : Components.ID("{0c1bb408-71a2-403f-854a-3a0659829ded}"),
QueryInterface : XPCOMUtils.generateQI([Ci.nsIFormHistory2, Ci.nsIObserver, Ci.nsIFormSubmitObserver, Ci.nsISupportsWeakReference]),
debug : true,
enabled : true,
saveHttpsForms : true,
prefBranch : null,
@@ -929,11 +927,9 @@ FormHistory.prototype = {
// Close the connection, ignore 'already closed' error
try { this.dbConnection.close() } catch(e) {}
this.dbFile.remove(false);
}
};
let component = [FormHistory];
-function NSGetModule (compMgr, fileSpec) {
- return XPCOMUtils.generateModule(component);
-}
+var NSGetFactory = XPCOMUtils.generateNSGetFactory(component);
new file mode 100644
--- /dev/null
+++ b/toolkit/components/satchel/src/satchel.manifest
@@ -0,0 +1,4 @@
+component {0c1bb408-71a2-403f-854a-3a0659829ded} nsFormHistory.js
+contract @mozilla.org/satchel/form-history;1 {0c1bb408-71a2-403f-854a-3a0659829ded}
+component {c11c21b2-71c9-4f87-a0f8-5e13f50495fd} nsFormAutoComplete.js
+contract @mozilla.org/satchel/form-autocomplete;1 {c11c21b2-71c9-4f87-a0f8-5e13f50495fd}
\ No newline at end of file
--- a/toolkit/components/search/Makefile.in
+++ b/toolkit/components/search/Makefile.in
@@ -43,14 +43,15 @@ VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
MODULE = toolkitsearch
XPIDL_MODULE = toolkitsearch
XPIDLSRCS = nsIBrowserSearchService.idl
+EXTRA_COMPONENTS = toolkitsearch.manifest
EXTRA_PP_COMPONENTS = nsSearchService.js \
nsSearchSuggestions.js
DEFINES += -DMOZ_DISTRIBUTION_ID=$(MOZ_DISTRIBUTION_ID)
include $(topsrcdir)/config/rules.mk
--- a/toolkit/components/search/nsSearchService.js
+++ b/toolkit/components/search/nsSearchService.js
@@ -37,16 +37,18 @@
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****
const Ci = Components.interfaces;
const Cc = Components.classes;
const Cr = Components.results;
+Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
+
const PERMS_FILE = 0644;
const PERMS_DIRECTORY = 0755;
const MODE_RDONLY = 0x01;
const MODE_WRONLY = 0x02;
const MODE_CREATE = 0x08;
const MODE_APPEND = 0x10;
const MODE_TRUNCATE = 0x20;
@@ -2464,16 +2466,18 @@ function SearchService() {
this._loadEngines();
} catch (ex) {
LOG("_init: failure loading engines: " + ex);
}
gEnginesLoaded = true;
this._addObservers();
}
SearchService.prototype = {
+ classID: Components.ID("{7319788a-fe93-4db3-9f39-818cf08f4256}"),
+
_engines: { },
__sortedEngines: null,
get _sortedEngines() {
if (!this.__sortedEngines)
return this._buildSortedEngineList();
return this.__sortedEngines;
},
@@ -3673,67 +3677,11 @@ var engineUpdateService = {
if (engine._iconUpdateURL) {
// If we're updating the engine too, use the new engine object,
// otherwise use the existing engine object.
(testEngine || engine)._setIcon(engine._iconUpdateURL, true);
}
}
};
-const kClassID = Components.ID("{7319788a-fe93-4db3-9f39-818cf08f4256}");
-const kClassName = "Browser Search Service";
-const kContractID = "@mozilla.org/browser/search-service;1";
-
-// nsIFactory
-const kFactory = {
- createInstance: function (outer, iid) {
- if (outer != null)
- throw Cr.NS_ERROR_NO_AGGREGATION;
- return (new SearchService()).QueryInterface(iid);
- }
-};
-
-// nsIModule
-const gModule = {
- get _catMan() {
- return Cc["@mozilla.org/categorymanager;1"].
- getService(Ci.nsICategoryManager);
- },
-
- registerSelf: function (componentManager, fileSpec, location, type) {
- componentManager.QueryInterface(Ci.nsIComponentRegistrar);
- componentManager.registerFactoryLocation(kClassID,
- kClassName,
- kContractID,
- fileSpec, location, type);
- this._catMan.addCategoryEntry("update-timer", kClassName,
- kContractID +
- ",getService," +
- "search-engine-update-timer," +
- BROWSER_SEARCH_PREF + "update.interval," +
- "21600", /* 6 hours */
- true, true);
- },
-
- unregisterSelf: function(componentManager, fileSpec, location) {
- componentManager.QueryInterface(Ci.nsIComponentRegistrar);
- componentManager.unregisterFactoryLocation(kClassID, fileSpec);
- this._catMan.deleteCategoryEntry("update-timer", kClassName, true);
- },
-
- getClassObject: function (componentManager, cid, iid) {
- if (!cid.equals(kClassID))
- throw Cr.NS_ERROR_NO_INTERFACE;
- if (!iid.equals(Ci.nsIFactory))
- throw Cr.NS_ERROR_NOT_IMPLEMENTED;
- return kFactory;
- },
-
- canUnload: function (componentManager) {
- return true;
- }
-};
-
-function NSGetModule(componentManager, fileSpec) {
- return gModule;
-}
+var NSGetFactory = XPCOMUtils.generateNSGetFactory([SearchService]);
#include ../../../toolkit/content/debug.js
--- a/toolkit/components/search/nsSearchSuggestions.js
+++ b/toolkit/components/search/nsSearchSuggestions.js
@@ -745,19 +745,15 @@ SearchSuggestLoadListener.prototype = {
* @constructor
*/
function SearchSuggestAutoComplete() {
// This calls _init() in the parent class (SuggestAutoComplete) via the
// prototype, below.
this._init();
}
SearchSuggestAutoComplete.prototype = {
- classDescription: "Remote Search Suggestions",
- contractID: "@mozilla.org/autocomplete/search;1?name=search-autocomplete",
classID: Components.ID("{aa892eb4-ffbf-477d-9f9a-06c995ae9f27}"),
__proto__: SuggestAutoComplete.prototype,
serviceURL: ""
};
var component = [SearchSuggestAutoComplete];
-function NSGetModule(compMgr, fileSpec) {
- return XPCOMUtils.generateModule(component);
-}
+var NSGetFactory = XPCOMUtils.generateNSGetFactory(component);
new file mode 100644
--- /dev/null
+++ b/toolkit/components/search/toolkitsearch.manifest
@@ -0,0 +1,6 @@
+component {7319788a-fe93-4db3-9f39-818cf08f4256} nsSearchService.js
+contract @mozilla.org/browser/search-service;1 {7319788a-fe93-4db3-9f39-818cf08f4256}
+# 21600 == 6 hours
+category update-timer nsSearchService @mozilla.org/browser/search-service;1,getService,search-engine-update-timer,browser.search.update.interval,21600
+component {aa892eb4-ffbf-477d-9f9a-06c995ae9f27} nsSearchSuggestions.js
+contract @mozilla.org/autocomplete/search;1?name=search-autocomplete {aa892eb4-ffbf-477d-9f9a-06c995ae9f27}
\ No newline at end of file
--- a/toolkit/components/startup/src/Makefile.in
+++ b/toolkit/components/startup/src/Makefile.in
@@ -60,11 +60,11 @@ else
ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
CMMSRCS += nsUserInfoMac.mm
else
CPPSRCS += nsUserInfoUnix.cpp
endif
endif
endif
-EXTRA_COMPONENTS = nsTryToClose.js
+EXTRA_COMPONENTS = nsTryToClose.js nsTryToClose.manifest
include $(topsrcdir)/config/rules.mk
--- a/toolkit/components/startup/src/nsTryToClose.js
+++ b/toolkit/components/startup/src/nsTryToClose.js
@@ -62,19 +62,14 @@ TryToClose.prototype = {
aSubject.data = true;
break;
}
}
break;
}
},
- classDescription: "tryToClose Service",
- contractID: "@mozilla.org/appshell/trytoclose;1",
classID: Components.ID("{b69155f4-a8bf-453d-8653-91d1456e1d3d}"),
QueryInterface: XPCOMUtils.generateQI([Ci.nsIObserver,
Ci.nsISupportsWeakReference]),
- _xpcom_categories: [{ category: "app-startup", service: true }]
};
-function NSGetModule(aCompMgr, aFileSpec) {
- return XPCOMUtils.generateModule([TryToClose]);
-}
+var NSGetFactory = XPCOMUtils.generateNSGetFactory([TryToClose]);
new file mode 100644
--- /dev/null
+++ b/toolkit/components/startup/src/nsTryToClose.manifest
@@ -0,0 +1,3 @@
+component {b69155f4-a8bf-453d-8653-91d1456e1d3d} nsTryToClose.js
+contract @mozilla.org/appshell/trytoclose;1 {b69155f4-a8bf-453d-8653-91d1456e1d3d}
+category app-startup nsTryToClose service,@mozilla.org/appshell/trytoclose;1
--- a/toolkit/components/url-classifier/src/Makefile.in
+++ b/toolkit/components/url-classifier/src/Makefile.in
@@ -20,16 +20,17 @@ CPPSRCS = \
nsUrlClassifierHashCompleter.cpp \
$(NULL)
LOCAL_INCLUDES = \
-I$(srcdir)/../../build \
$(SQLITE_CFLAGS) \
$(NULL)
+EXTRA_COMPONENTS = nsURLClassifier.manifest
# Same as JS components that are run through the pre-processor.
EXTRA_PP_COMPONENTS = nsUrlClassifierLib.js \
nsUrlClassifierListManager.js \
$(NULL)
include $(topsrcdir)/config/rules.mk
new file mode 100644
--- /dev/null
+++ b/toolkit/components/url-classifier/src/nsURLClassifier.manifest
@@ -0,0 +1,4 @@
+component {26a4a019-2827-4a89-a85c-5931a678823a} nsUrlClassifierLib.js
+contract @mozilla.org/url-classifier/jslib;1 {26a4a019-2827-4a89-a85c-5931a678823a}
+component {ca168834-cc00-48f9-b83c-fd018e58cae3} nsUrlClassifierListManager.js
+contract @mozilla.org/url-classifier/listmanager;1 {ca168834-cc00-48f9-b83c-fd018e58cae3}
--- a/toolkit/components/url-classifier/src/nsUrlClassifierLib.js
+++ b/toolkit/components/url-classifier/src/nsUrlClassifierLib.js
@@ -38,16 +38,18 @@
// We wastefully reload the same JS files across components. This puts all
// the common JS files used by safebrowsing and url-classifier into a
// single component.
const Cc = Components.classes;
const Ci = Components.interfaces;
const G_GDEBUG = false;
+Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
+
#include ../content/moz/lang.js
#include ../content/moz/preferences.js
#include ../content/moz/debug.js
#include ../content/moz/alarm.js
#include ../content/moz/cryptohasher.js
#include ../content/moz/observer.js
#include ../content/moz/protocol4.js
@@ -56,56 +58,12 @@ const G_GDEBUG = false;
#include ../content/xml-fetcher.js
// Expose this whole component.
var lib = this;
function UrlClassifierLib() {
this.wrappedJSObject = lib;
}
-
-// Module object
-function UrlClassifierLibMod() {
- this.firstTime = true;
- this.cid = Components.ID("{26a4a019-2827-4a89-a85c-5931a678823a}");
- this.progid = "@mozilla.org/url-classifier/jslib;1";
-}
-
-UrlClassifierLibMod.prototype.registerSelf = function(compMgr, fileSpec, loc, type) {
- if (this.firstTime) {
- this.firstTime = false;
- throw Components.results.NS_ERROR_FACTORY_REGISTER_AGAIN;
- }
- compMgr = compMgr.QueryInterface(Ci.nsIComponentRegistrar);
- compMgr.registerFactoryLocation(this.cid,
- "UrlClassifier JS Lib",
- this.progid,
- fileSpec,
- loc,
- type);
-};
+UrlClassifierLib.prototype.classID = Components.ID("{26a4a019-2827-4a89-a85c-5931a678823a}");
+UrlClassifierLib.prototype.QueryInterface = XPCOMUtils.generateQI([]);
-UrlClassifierLibMod.prototype.getClassObject = function(compMgr, cid, iid) {
- if (!cid.equals(this.cid))
- throw Components.results.NS_ERROR_NO_INTERFACE;
- if (!iid.equals(Ci.nsIFactory))
- throw Components.results.NS_ERROR_NOT_IMPLEMENTED;
-
- return this.factory;
-}
-
-UrlClassifierLibMod.prototype.canUnload = function(compMgr) {
- return true;
-}
-
-UrlClassifierLibMod.prototype.factory = {
- createInstance: function(outer, iid) {
- if (outer != null)
- throw Components.results.NS_ERROR_NO_AGGREGATION;
- return new UrlClassifierLib();
- }
-};
-
-var LibModInst = new UrlClassifierLibMod();
-
-function NSGetModule(compMgr, fileSpec) {
- return LibModInst;
-}
+var NSGetFactory = XPCOMUtils.generateNSGetFactory([UrlClassifierLib]);
--- a/toolkit/components/url-classifier/src/nsUrlClassifierListManager.js
+++ b/toolkit/components/url-classifier/src/nsUrlClassifierListManager.js
@@ -33,16 +33,18 @@
# 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 *****
const Cc = Components.classes;
const Ci = Components.interfaces;
+Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
+
#include ../content/listmanager.js
var modScope = this;
function Init() {
// Pull the library in.
var jslib = Cc["@mozilla.org/url-classifier/jslib;1"]
.getService().wrappedJSObject;
Function.prototype.inherits = jslib.Function.prototype.inherits;
@@ -57,56 +59,24 @@ function Init() {
modScope.PROT_XMLFetcher = jslib.PROT_XMLFetcher;
modScope.PROT_UrlCryptoKeyManager = jslib.PROT_UrlCryptoKeyManager;
modScope.RequestBackoff = jslib.RequestBackoff;
// We only need to call Init once.
modScope.Init = function() {};
}
-// Module object
-function UrlClassifierListManagerMod() {
- this.firstTime = true;
- this.cid = Components.ID("{ca168834-cc00-48f9-b83c-fd018e58cae3}");
- this.progid = "@mozilla.org/url-classifier/listmanager;1";
+function RegistrationData()
+{
}
-
-UrlClassifierListManagerMod.prototype.registerSelf = function(compMgr, fileSpec, loc, type) {
- if (this.firstTime) {
- this.firstTime = false;
- throw Components.results.NS_ERROR_FACTORY_REGISTER_AGAIN;
- }
- compMgr = compMgr.QueryInterface(Ci.nsIComponentRegistrar);
- compMgr.registerFactoryLocation(this.cid,
- "UrlClassifier List Manager Module",
- this.progid,
- fileSpec,
- loc,
- type);
+RegistrationData.prototype = {
+ classID: Components.ID("{ca168834-cc00-48f9-b83c-fd018e58cae3}"),
+ _xpcom_factory: {
+ createInstance: function(outer, iid) {
+ if (outer != null)
+ throw Components.results.NS_ERROR_NO_AGGREGATION;
+ Init();
+ return (new PROT_ListManager()).QueryInterface(iid);
+ }
+ },
};
-UrlClassifierListManagerMod.prototype.getClassObject = function(compMgr, cid, iid) {
- if (!cid.equals(this.cid))
- throw Components.results.NS_ERROR_NO_INTERFACE;
- if (!iid.equals(Ci.nsIFactory))
- throw Components.results.NS_ERROR_NOT_IMPLEMENTED;
-
- return this.factory;
-}
-
-UrlClassifierListManagerMod.prototype.canUnload = function(compMgr) {
- return true;
-}
-
-UrlClassifierListManagerMod.prototype.factory = {
- createInstance: function(outer, iid) {
- if (outer != null)
- throw Components.results.NS_ERROR_NO_AGGREGATION;
- Init();
- return (new PROT_ListManager()).QueryInterface(iid);
- }
-};
-
-var ListManagerModInst = new UrlClassifierListManagerMod();
-
-function NSGetModule(compMgr, fileSpec) {
- return ListManagerModInst;
-}
+var NSGetFactory = XPCOMUtils.generateNSGetFactory([RegistrationData]);
--- a/toolkit/components/urlformatter/src/Makefile.in
+++ b/toolkit/components/urlformatter/src/Makefile.in
@@ -37,14 +37,18 @@
DEPTH = ../../../..
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
+EXTRA_COMPONENTS = \
+ nsURLFormatter.manifest \
+ $(NULL)
+
EXTRA_PP_COMPONENTS = \
nsURLFormatter.js \
$(NULL)
include $(topsrcdir)/config/rules.mk
--- a/toolkit/components/urlformatter/src/nsURLFormatter.js
+++ b/toolkit/components/urlformatter/src/nsURLFormatter.js
@@ -48,18 +48,16 @@
const Cc = Components.classes;
const Ci = Components.interfaces;
const Cu = Components.utils;
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
function nsURLFormatterService() {}
nsURLFormatterService.prototype = {
- classDescription: "Application URL Formatter Service",
- contractID: "@mozilla.org/toolkit/URLFormatterService;1",
classID: Components.ID("{e6156350-2be8-11db-a98b-0800200c9a66}"),
QueryInterface: XPCOMUtils.generateQI([Ci.nsIURLFormatter]),
_defaults: {
get appInfo() {
if (!this._appInfo)
this._appInfo = Cc["@mozilla.org/xre/app-info;1"].
getService(Ci.nsIXULAppInfo).
@@ -111,10 +109,9 @@ nsURLFormatterService.prototype = {
format = PS.getComplexValue(aPref, Ci.nsIPrefLocalizedString).data;
} catch(ex) {}
}
return this.formatURL(format);
}
};
-function NSGetModule(aCompMgr, aFileSpec)
- XPCOMUtils.generateModule([nsURLFormatterService]);
+var NSGetFactory = XPCOMUtils.generateNSGetFactory([nsURLFormatterService]);
new file mode 100644
--- /dev/null
+++ b/toolkit/components/urlformatter/src/nsURLFormatter.manifest
@@ -0,0 +1,2 @@
+component {e6156350-2be8-11db-a98b-0800200c9a66} nsURLFormatter.js
+contract @mozilla.org/toolkit/URLFormatterService;1 {e6156350-2be8-11db-a98b-0800200c9a66}
--- a/toolkit/mozapps/downloads/Makefile.in
+++ b/toolkit/mozapps/downloads/Makefile.in
@@ -39,16 +39,17 @@ DEPTH = ../../..
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
include $(topsrcdir)/config/config.mk
MODULE = helperAppDlg
+EXTRA_COMPONENTS = nsHelperAppDlg.manifest
EXTRA_PP_COMPONENTS = nsHelperAppDlg.js
EXTRA_JS_MODULES = \
DownloadLastDir.jsm \
DownloadPaths.jsm \
DownloadUtils.jsm \
$(NULL)
--- a/toolkit/mozapps/downloads/nsHelperAppDlg.js
+++ b/toolkit/mozapps/downloads/nsHelperAppDlg.js
@@ -73,16 +73,17 @@ function isUsableDirectory(aDirectory)
*
* In addition, this file implements an nsIModule object that registers the
* nsUnknownContentTypeDialog component.
*/
const PREF_BD_USEDOWNLOADDIR = "browser.download.useDownloadDir";
const nsITimer = Components.interfaces.nsITimer;
+Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
Components.utils.import("resource://gre/modules/DownloadLastDir.jsm");
Components.utils.import("resource://gre/modules/DownloadPaths.jsm");
/* ctor
*/
function nsUnknownContentTypeDialog() {
// Initialize data properties.
this.mLauncher = null;
@@ -90,16 +91,18 @@ function nsUnknownContentTypeDialog() {
this.mSourcePath = null;
this.chosenApp = null;
this.givenDefaultApp = false;
this.updateSelf = true;
this.mTitle = "";
}
nsUnknownContentTypeDialog.prototype = {
+ classID: Components.ID("{F68578EB-6EC2-4169-AE19-8C6243F0ABE1}"),
+
nsIMIMEInfo : Components.interfaces.nsIMIMEInfo,
QueryInterface: function (iid) {
if (!iid.equals(Components.interfaces.nsIHelperAppLauncherDialog) &&
!iid.equals(Components.interfaces.nsITimerCallback) &&
!iid.equals(Components.interfaces.nsISupports)) {
throw Components.results.NS_ERROR_NO_INTERFACE;
}
@@ -1093,63 +1096,9 @@ nsUnknownContentTypeDialog.prototype = {
val = obj[ prop ];
} catch ( exception ) {
}
this.dump( val + "\n" );
}
}
}
-// This Component's module implementation. All the code below is used to get this
-// component registered and accessible via XPCOM.
-var module = {
- // registerSelf: Register this component.
- registerSelf: function (compMgr, fileSpec, location, type) {
- compMgr = compMgr.QueryInterface(Components.interfaces.nsIComponentRegistrar);
-
- compMgr.registerFactoryLocation( this.cid,
- "Unknown Content Type Dialog",
- this.contractId,
- fileSpec,
- location,
- type );
- },
-
- // getClassObject: Return this component's factory object.
- getClassObject: function (compMgr, cid, iid) {
- if (!cid.equals(this.cid)) {
- throw Components.results.NS_ERROR_NO_INTERFACE;
- }
-
- if (!iid.equals(Components.interfaces.nsIFactory)) {
- throw Components.results.NS_ERROR_NOT_IMPLEMENTED;
- }
-
- return this.factory;
- },
-
- /* CID for this class */
- cid: Components.ID("{F68578EB-6EC2-4169-AE19-8C6243F0ABE1}"),
-
- /* Contract ID for this class */
- contractId: "@mozilla.org/helperapplauncherdialog;1",
-
- /* factory object */
- factory: {
- // createInstance: Return a new nsProgressDialog object.
- createInstance: function (outer, iid) {
- if (outer != null)
- throw Components.results.NS_ERROR_NO_AGGREGATION;
-
- return (new nsUnknownContentTypeDialog()).QueryInterface(iid);
- }
- },
-
- // canUnload: n/a (returns true)
- canUnload: function(compMgr) {
- return true;
- }
-};
-
-// NSGetModule: Return the nsIModule object.
-function NSGetModule(compMgr, fileSpec) {
- return module;
-}
+var NSGetFactory = XPCOMUtils.generateNSGetFactory([nsUnknownContentTypeDialog]);
new file mode 100644
--- /dev/null
+++ b/toolkit/mozapps/downloads/nsHelperAppDlg.manifest
@@ -0,0 +1,2 @@
+component {F68578EB-6EC2-4169-AE19-8C6243F0ABE1} nsHelperAppDlg.js
+contract @mozilla.org/helperapplauncherdialog;1 {F68578EB-6EC2-4169-AE19-8C6243F0ABE1}
--- a/toolkit/mozapps/extensions/Makefile.in
+++ b/toolkit/mozapps/extensions/Makefile.in
@@ -55,16 +55,17 @@ XPIDLSRCS = \
amIWebInstaller.idl \
$(NULL)
CPPSRCS = \
amInstallTrigger.cpp \
$(NULL)
EXTRA_PP_COMPONENTS = \
+ extensions.manifest \
nsBlocklistService.js \
addonManager.js \
amContentHandler.js \
amWebInstallListener.js \
$(NULL)
EXTRA_PP_JS_MODULES = \
AddonManager.jsm \
--- a/toolkit/mozapps/extensions/addonManager.js
+++ b/toolkit/mozapps/extensions/addonManager.js
@@ -162,32 +162,25 @@ amManager.prototype = {
return retval;
},
notify: function AMC_notify(aTimer) {
AddonManagerPrivate.backgroundUpdateCheck();
},
- classDescription: "Addons Manager",
- contractID: "@mozilla.org/addons/integration;1",
classID: Components.ID("{4399533d-08d1-458c-a87a-235f74451cfa}"),
- _xpcom_categories: [{ category: "update-timer",
- value: "@mozilla.org/addons/integration;1," +
- "getService,addon-background-update-timer," +
- PREF_EM_UPDATE_INTERVAL + ",86400" }],
_xpcom_factory: {
createInstance: function(aOuter, aIid) {
if (aOuter != null)
throw Cr.NS_ERROR_NO_AGGREGATION;
if (!gSingleton)
gSingleton = new amManager();
return gSingleton.QueryInterface(aIid);
}
},
QueryInterface: XPCOMUtils.generateQI([Ci.amIWebInstaller,
Ci.nsITimerCallback,
Ci.nsIObserver])
};
-function NSGetModule(aCompMgr, aFileSpec)
- XPCOMUtils.generateModule([amManager]);
+var NSGetFactory = XPCOMUtils.generateNSGetFactory([amManager]);
--- a/toolkit/mozapps/extensions/amContentHandler.js
+++ b/toolkit/mozapps/extensions/amContentHandler.js
@@ -84,16 +84,13 @@ amContentHandler.prototype = {
aRequest.cancel(Cr.NS_BINDING_ABORTED);
let manager = Cc["@mozilla.org/addons/integration;1"].
getService(Ci.amIWebInstaller);
manager.installAddonsFromWebpage(aMimetype, window, referer, [uri.spec],
[null], [null], [null], null, 1);
},
- classDescription: "XPI Content Handler",
- contractID: "@mozilla.org/uriloader/content-handler;1?type=" + XPI_CONTENT_TYPE,
classID: Components.ID("{7beb3ba8-6ec3-41b4-b67c-da89b8518922}"),
QueryInterface: XPCOMUtils.generateQI([Ci.nsIContentHandler])
};
-function NSGetModule(compMgr, fileSpec)
- XPCOMUtils.generateModule([amContentHandler]);
+var NSGetFactory = XPCOMUtils.generateNSGetFactory([amContentHandler]);
--- a/toolkit/mozapps/extensions/amWebInstallListener.js
+++ b/toolkit/mozapps/extensions/amWebInstallListener.js
@@ -223,10 +223,9 @@ extWebInstallListener.prototype = {
},
classDescription: "XPI Install Handler",
contractID: "@mozilla.org/addons/web-install-listener;1",
classID: Components.ID("{0f38e086-89a3-40a5-8ffc-9b694de1d04a}"),
QueryInterface: XPCOMUtils.generateQI([Ci.amIWebInstallListener])
};
-function NSGetModule(aCompMgr, aFileSpec)
- XPCOMUtils.generateModule([extWebInstallListener]);
+var NSGetFactory = XPCOMUtils.generateNSGetFactory([extWebInstallListener]);
new file mode 100644
--- /dev/null
+++ b/toolkit/mozapps/extensions/extensions.manifest
@@ -0,0 +1,10 @@
+component {66354bc9-7ed1-4692-ae1d-8da97d6b205e} nsBlocklistService.js
+contract @mozilla.org/extensions/blocklist;1 {66354bc9-7ed1-4692-ae1d-8da97d6b205e}
+category update-timer nsBlocklistService @mozilla.org/extensions/blocklist;1,getService,blocklist-background-update-timer,extensions.blocklist.interval,86400
+component {4399533d-08d1-458c-a87a-235f74451cfa} addonManager.js
+contract @mozilla.org/addons/integration;1 {4399533d-08d1-458c-a87a-235f74451cfa}
+category update-timer addonManager @mozilla.org/addons/integration;1,getService,addon-background-update-timer,extensions.update.interval,86400
+component {7beb3ba8-6ec3-41b4-b67c-da89b8518922} amContentHandler.js
+contract @mozilla.org/uriloader/content-handler;1?type=application/x-xpinstall {7beb3ba8-6ec3-41b4-b67c-da89b8518922}
+component {0f38e086-89a3-40a5-8ffc-9b694de1d04a} amWebInstallListener.js
+contract @mozilla.org/addons/web-install-listener;1 {0f38e086-89a3-40a5-8ffc-9b694de1d04a}
--- a/toolkit/mozapps/extensions/nsBlocklistService.js
+++ b/toolkit/mozapps/extensions/nsBlocklistService.js
@@ -888,26 +888,20 @@ Blocklist.prototype = {
addonList[i].item.userDisabled = true;
}
if (args.restart)
restartApp();
});
},
- classDescription: "Blocklist Service",
- contractID: "@mozilla.org/extensions/blocklist;1",
classID: Components.ID("{66354bc9-7ed1-4692-ae1d-8da97d6b205e}"),
QueryInterface: XPCOMUtils.generateQI([Ci.nsIObserver,
Ci.nsIBlocklistService,
Ci.nsITimerCallback]),
- _xpcom_categories: [{ category: "update-timer",
- value: "@mozilla.org/extensions/blocklist;1," +
- "getService,blocklist-background-update-timer," +
- PREF_BLOCKLIST_INTERVAL + ",86400" }]
};
/**
* Helper for constructing a blocklist.
*/
function BlocklistItemData(versionRangeElement) {
var versionRange = this.getBlocklistVersionRange(versionRangeElement);
this.minVersion = versionRange.minVersion;
@@ -1058,11 +1052,9 @@ BlocklistItemData.prototype = {
minVersion = versionRangeElement.getAttribute("minVersion");
if (versionRangeElement.hasAttribute("maxVersion"))
maxVersion = versionRangeElement.getAttribute("maxVersion");
return { minVersion: minVersion, maxVersion: maxVersion };
}
};
-function NSGetModule(aCompMgr, aFileSpec) {
- return XPCOMUtils.generateModule([Blocklist]);
-}
+var NSGetFactory = XPCOMUtils.generateNSGetFactory([Blocklist]);
--- a/toolkit/mozapps/handling/Makefile.in
+++ b/toolkit/mozapps/handling/Makefile.in
@@ -39,11 +39,11 @@ DEPTH = ../../..
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
MODULE = contentDispatchChooser
-EXTRA_COMPONENTS = nsContentDispatchChooser.js
+EXTRA_COMPONENTS = nsContentDispatchChooser.js nsContentDispatchChooser.manifest
include $(topsrcdir)/config/rules.mk
--- a/toolkit/mozapps/handling/nsContentDispatchChooser.js
+++ b/toolkit/mozapps/handling/nsContentDispatchChooser.js
@@ -52,19 +52,17 @@ const STRINGBUNDLE_URL = "chrome://mozap
//// nsContentDispatchChooser class
function nsContentDispatchChooser()
{
}
nsContentDispatchChooser.prototype =
{
- classDescription: "Used to handle different types of content",
classID: Components.ID("e35d5067-95bc-4029-8432-e8f1e431148d"),
- contractID: "@mozilla.org/content-dispatch-chooser;1",
//////////////////////////////////////////////////////////////////////////////
//// nsIContentDispatchChooser
ask: function ask(aHandler, aWindowContext, aURI, aReason)
{
var window = null;
try {
@@ -118,13 +116,9 @@ nsContentDispatchChooser.prototype =
QueryInterface: XPCOMUtils.generateQI([Ci.nsIContentDispatchChooser])
};
////////////////////////////////////////////////////////////////////////////////
//// Module
let components = [nsContentDispatchChooser];
-function NSGetModule(compMgr, fileSpec)
-{
- return XPCOMUtils.generateModule(components);
-}
-
+var NSGetFactory = XPCOMUtils.generateNSGetFactory(components);
new file mode 100644
--- /dev/null
+++ b/toolkit/mozapps/handling/nsContentDispatchChooser.manifest
@@ -0,0 +1,2 @@
+component {e35d5067-95bc-4029-8432-e8f1e431148d} nsContentDispatchChooser.js
+contract @mozilla.org/content-dispatch-chooser;1 {e35d5067-95bc-4029-8432-e8f1e431148d}
--- a/toolkit/mozapps/plugins/Makefile.in
+++ b/toolkit/mozapps/plugins/Makefile.in
@@ -37,15 +37,15 @@
DEPTH = ../../..
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
-EXTRA_COMPONENTS = pluginGlue.js
+EXTRA_COMPONENTS = pluginGlue.manifest
ifdef ENABLE_TESTS
DIRS += tests
endif
include $(topsrcdir)/config/rules.mk
deleted file mode 100644
--- a/toolkit/mozapps/plugins/pluginGlue.js
+++ /dev/null
@@ -1,59 +0,0 @@
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is mozilla pluginfinder style sheet registration code.
- *
- * The Initial Developer of the Original Code is
- * Christian Biesinger <cbiesinger@web.de>.
- * Portions created by the Initial Developer are Copyright (C) 2005
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *
- * Justin Dolske <dolske@mozilla.com>
- *
- * 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
- * decision by deleting the provisions above and replace them with the notice
- * 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 ***** */
-
-Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
-
-function pluginBindings() { }
-
-pluginBindings.prototype = {
- // This isn't a real component, we're just using categories to
- // automatically add our stylesheets during module registration.
- classDescription: "plugin bindings",
- classID: Components.ID("12663f3a-a311-4606-83eb-b6b9108dcc36"),
- contractID: "@mozilla.org/plugin-bindings;1",
- QueryInterface: XPCOMUtils.generateQI([]),
-
- _xpcom_categories: [{ category: "agent-style-sheets",
- entry: "pluginfinder xbl binding",
- value: "chrome://mozapps/content/plugins/pluginFinderBinding.css"},
- { category: "agent-style-sheets",
- entry: "pluginproblem xbl binding",
- value: "chrome://mozapps/content/plugins/pluginProblemBinding.css"}]
-};
-
-var NSGetModule = XPCOMUtils.generateNSGetModule([pluginBindings]);
new file mode 100644
--- /dev/null
+++ b/toolkit/mozapps/plugins/pluginGlue.manifest
@@ -0,0 +1,2 @@
+category agent-style-sheets pluginGlue-pluginFinder chrome://mozapps/content/plugins/pluginFinderBinding.css
+category agent-style-sheets pluginGlue-pluginProblem chrome://mozapps/content/plugins/pluginProblemBinding.css
--- a/toolkit/mozapps/update/Makefile.in
+++ b/toolkit/mozapps/update/Makefile.in
@@ -41,28 +41,29 @@ srcdir = @srcdir@
VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
MODULE = update
XPIDLSRCS = nsIUpdateTimerManager.idl
-EXTRA_PP_COMPONENTS = nsUpdateTimerManager.js
+EXTRA_PP_COMPONENTS = nsUpdateTimerManager.js nsUpdateTimerManager.manifest
ifdef MOZ_UPDATER
DIRS = ../readstrings \
updater \
$(NULL)
XPIDLSRCS += nsIUpdateService.idl
EXTRA_PP_COMPONENTS += \
nsUpdateService.js \
nsUpdateServiceStub.js \
+ nsUpdateService.manifest \
$(NULL)
endif
ifdef ENABLE_TESTS
DIRS += test_timermanager
# Update tests require the updater binary
ifdef MOZ_UPDATER
DIRS += test
--- a/toolkit/mozapps/update/nsUpdateService.js
+++ b/toolkit/mozapps/update/nsUpdateService.js
@@ -1688,23 +1688,17 @@ UpdateService.prototype = {
getInterfaces: function AUS_getInterfaces(count) {
var interfaces = [Ci.nsIApplicationUpdateService,
Ci.nsITimerCallback,
Ci.nsIObserver];
count.value = interfaces.length;
return interfaces;
},
- classDescription: "Update Service",
- contractID: "@mozilla.org/updates/update-service;1",
classID: Components.ID("{B3C290A6-3943-4B89-8BBE-C01EB7B3B311}"),
- _xpcom_categories: [{ category: CATEGORY_UPDATE_TIMER,
- value: "@mozilla.org/updates/update-service;1," +
- "getService,background-update-timer," +
- PREF_APP_UPDATE_INTERVAL + ",86400" }],
_xpcom_factory: UpdateServiceFactory,
QueryInterface: XPCOMUtils.generateQI([Ci.nsIApplicationUpdateService,
Ci.nsIAddonUpdateCheckListener,
Ci.nsITimerCallback,
Ci.nsIObserver])
};
/**
@@ -1944,18 +1938,16 @@ UpdateManager.prototype = {
}
}
this._writeUpdatesToXMLFile(updates.slice(0, 10),
getUpdateFile([FILE_UPDATES_DB]));
}
},
- classDescription: "Update Manager",
- contractID: "@mozilla.org/updates/update-manager;1",
classID: Components.ID("{093C2356-4843-4C65-8709-D7DBCBBE7DFB}"),
QueryInterface: XPCOMUtils.generateQI([Ci.nsIUpdateManager, Ci.nsIObserver])
};
/**
* Checker
* Checks for new Updates
* @constructor
@@ -2187,18 +2179,16 @@ Checker.prototype = {
break;
case Ci.nsIUpdateChecker.ANY_CHECKS:
this._enabled = false;
gPref.setBoolPref(PREF_APP_UPDATE_ENABLED, this._enabled);
break;
}
},
- classDescription: "Update Checker",
- contractID: "@mozilla.org/updates/update-checker;1",
classID: Components.ID("{898CDC9B-E43F-422F-9CC4-2F6291B415A3}"),
QueryInterface: XPCOMUtils.generateQI([Ci.nsIUpdateChecker])
};
/**
* Manages the download of updates
* @param background
* Whether or not this downloader is operating in background
@@ -3018,18 +3008,18 @@ UpdatePrompt.prototype = {
},
classDescription: "Update Prompt",
contractID: "@mozilla.org/updates/update-prompt;1",
classID: Components.ID("{27ABA825-35B5-4018-9FDD-F99250A0E722}"),
QueryInterface: XPCOMUtils.generateQI([Ci.nsIUpdatePrompt])
};
-function NSGetModule(compMgr, fileSpec)
- XPCOMUtils.generateModule([UpdateService, Checker, UpdatePrompt, UpdateManager]);
+var components = [UpdateService, Checker, UpdatePrompt, UpdateManager];
+var NSGetFactory = XPCOMUtils.generateNSGetFactory(components);
#if 0
/**
* Logs a message and stack trace to the console.
* @param string
* The string to write to the console.
*/
function STACK(string) {
new file mode 100644
--- /dev/null
+++ b/toolkit/mozapps/update/nsUpdateService.manifest
@@ -0,0 +1,12 @@
+component {B3C290A6-3943-4B89-8BBE-C01EB7B3B311} nsUpdateService.js
+contract @mozilla.org/updates/update-service;1 {B3C290A6-3943-4B89-8BBE-C01EB7B3B311}
+category update-timer nsUpdateService @mozilla.org/updates/update-service;1,getService,background-update-timer,app.update.interval,86400
+component {093C2356-4843-4C65-8709-D7DBCBBE7DFB} nsUpdateService.js
+contract @mozilla.org/updates/update-manager;1 {093C2356-4843-4C65-8709-D7DBCBBE7DFB}
+component {898CDC9B-E43F-422F-9CC4-2F6291B415A3} nsUpdateService.js
+contract @mozilla.org/updates/update-checker;1 {898CDC9B-E43F-422F-9CC4-2F6291B415A3}
+component {27ABA825-35B5-4018-9FDD-F99250A0E722} nsUpdateService.js
+contract @mozilla.org/updates/update-prompt;1 {27ABA825-35B5-4018-9FDD-F99250A0E722}
+component {e43b0010-04ba-4da6-b523-1f92580bc150} nsUpdateServiceStub.js
+contract @mozilla.org/updates/update-service-stub;1 {e43b0010-04ba-4da6-b523-1f92580bc150}
+category profile-after-change nsUpdateServiceStub @mozilla.org/updates/update-service-stub;1
--- a/toolkit/mozapps/update/nsUpdateServiceStub.js
+++ b/toolkit/mozapps/update/nsUpdateServiceStub.js
@@ -79,17 +79,13 @@ function UpdateServiceStub() {
if (statusFile.exists()) {
let aus = Components.classes["@mozilla.org/updates/update-service;1"].
getService(Ci.nsIApplicationUpdateService).
QueryInterface(Ci.nsIObserver);
aus.observe(null, "post-update-processing", "");
}
}
UpdateServiceStub.prototype = {
- classDescription: "Update Service Stub",
- contractID: "@mozilla.org/updates/update-service-stub;1",
classID: Components.ID("{e43b0010-04ba-4da6-b523-1f92580bc150}"),
- _xpcom_categories: [{ category: "profile-after-change" }],
QueryInterface: XPCOMUtils.generateQI([])
};
-function NSGetModule(compMgr, fileSpec)
- XPCOMUtils.generateModule([UpdateServiceStub]);
+var NSGetFactory = XPCOMUtils.generateNSGetFactory([UpdateServiceStub]);
--- a/toolkit/mozapps/update/nsUpdateTimerManager.js
+++ b/toolkit/mozapps/update/nsUpdateTimerManager.js
@@ -264,19 +264,15 @@ TimerManager.prototype = {
lastUpdateTime = Math.round(Date.now() / 1000) + this._fudge;
gPref.setIntPref(prefLastUpdate, lastUpdateTime);
}
this._timers[id] = { callback : callback,
interval : interval,
lastUpdateTime : lastUpdateTime };
},
- classDescription: "Timer Manager",
- contractID: "@mozilla.org/updates/timer-manager;1",
classID: Components.ID("{B322A5C0-A419-484E-96BA-D7182163899F}"),
- _xpcom_categories: [{ category: "profile-after-change" }],
QueryInterface: XPCOMUtils.generateQI([Ci.nsIUpdateTimerManager,
Ci.nsITimerCallback,
Ci.nsIObserver])
};
-function NSGetModule(compMgr, fileSpec)
- XPCOMUtils.generateModule([TimerManager]);
+var NSGetFactory = XPCOMUtils.generateNSGetFactory([TimerManager]);
new file mode 100644
--- /dev/null
+++ b/toolkit/mozapps/update/nsUpdateTimerManager.manifest
@@ -0,0 +1,3 @@
+component {B322A5C0-A419-484E-96BA-D7182163899F} nsUpdateTimerManager.js
+contract @mozilla.org/updates/timer-manager;1 {B322A5C0-A419-484E-96BA-D7182163899F}
+category profile-after-change nsUpdateTimerManager @mozilla.org/updates/timer-manager;1
--- a/uriloader/exthandler/Makefile.in
+++ b/uriloader/exthandler/Makefile.in
@@ -158,17 +158,19 @@ endif
ifeq ($(OS_ARCH),WINNT WINCE)
OS_LIBS += shell32.lib
GARBAGE += nsOSHelperAppService.cpp $(srcdir)/nsOSHelperAppService.cpp \
nsMIMEInfoWin.cpp $(srcdir)/nsMIMEInfoWin.cpp
endif
EXTRA_COMPONENTS = \
nsHandlerService.js \
+ nsHandlerService.manifest \
nsWebHandlerApp.js \
+ nsWebHandlerApp.manifest \
$(NULL)
# we don't want the shared lib, but we want to force the creation of a static lib.
FORCE_STATIC_LIB = 1
SRCS_IN_OBJDIR = 1
include $(topsrcdir)/config/rules.mk
ifneq (,$(filter qt gtk2, $(MOZ_WIDGET_TOOLKIT)))
--- a/uriloader/exthandler/nsHandlerService.js
+++ b/uriloader/exthandler/nsHandlerService.js
@@ -114,22 +114,19 @@ Cu.import("resource://gre/modules/XPCOMU
function HandlerService() {
this._init();
}
HandlerService.prototype = {
//**************************************************************************//
// XPCOM Plumbing
- classDescription: "Handler Service",
classID: Components.ID("{32314cc8-22f7-4f7f-a645-1a45453ba6a6}"),
- contractID: "@mozilla.org/uriloader/handler-service;1",
QueryInterface: XPCOMUtils.generateQI([Ci.nsIHandlerService]),
-
//**************************************************************************//
// Initialization & Destruction
_init: function HS__init() {
// Observe profile-before-change so we can switch to the datasource
// in the new profile when the user changes profiles.
this._observerSvc.addObserver(this, "profile-before-change", false);
@@ -1417,15 +1414,12 @@ HandlerService.prototype = {
let target = targets.getNext();
this._ds.Unassert(source, property, target);
}
}
}
};
-
//****************************************************************************//
// More XPCOM Plumbing
-function NSGetModule(compMgr, fileSpec) {
- return XPCOMUtils.generateModule([HandlerService]);
-}
+NSGetFactory = XPCOMUtils.generateNSGetFactory([HandlerService]);
new file mode 100644
--- /dev/null
+++ b/uriloader/exthandler/nsHandlerService.manifest
@@ -0,0 +1,2 @@
+component {32314cc8-22f7-4f7f-a645-1a45453ba6a6} nsHandlerService.js
+contract @mozilla.org/uriloader/handler-service;1 {32314cc8-22f7-4f7f-a645-1a45453ba6a6}
\ No newline at end of file
--- a/uriloader/exthandler/nsWebHandlerApp.js
+++ b/uriloader/exthandler/nsWebHandlerApp.js
@@ -179,15 +179,10 @@ nsWebHandlerApp.prototype = {
//// nsISupports
QueryInterface: XPCOMUtils.generateQI([Ci.nsIWebHandlerApp, Ci.nsIHandlerApp])
};
////////////////////////////////////////////////////////////////////////////////
//// Module
-let components = [nsWebHandlerApp];
+NSGetFactory = XPCOMUtils.generateNSGetFactory([nsWebHandlerApp]);
-function NSGetModule(compMgr, fileSpec)
-{
- return XPCOMUtils.generateModule(components);
-}
-
new file mode 100644
--- /dev/null
+++ b/uriloader/exthandler/nsWebHandlerApp.manifest
@@ -0,0 +1,2 @@
+component {8b1ae382-51a9-4972-b930-56977a57919d} nsWebHandlerApp.js
+contract @mozilla.org/uriloader/web-handler-app;1 {8b1ae382-51a9-4972-b930-56977a57919d}
--- a/xpcom/ds/Makefile.in
+++ b/xpcom/ds/Makefile.in
@@ -151,16 +151,17 @@ SDK_XPIDLSRCS = \
ifneq (,$(filter WINNT WINCE,$(OS_ARCH)))
CPPSRCS += nsWindowsRegKey.cpp
XPIDLSRCS += nsIWindowsRegKey.idl
EXPORTS += nsWindowsRegKey.h
endif
EXTRA_COMPONENTS = \
nsINIProcessor.js \
+ nsINIProcessor.manifest \
$(NULL)
# we don't want the shared lib, but we want to force the creation of a static lib.
FORCE_STATIC_LIB = 1
# Force use of PIC
FORCE_USE_PIC = 1
new file mode 100644
--- /dev/null
+++ b/xpcom/ds/nsINIProcessor.manifest
@@ -0,0 +1,2 @@
+component {6ec5f479-8e13-4403-b6ca-fe4c2dca14fd} nsINIProcessor.js
+contract @mozilla.org/xpcom/ini-processor-factory;1 {6ec5f479-8e13-4403-b6ca-fe4c2dca14fd}