зеркало из https://github.com/mozilla/gecko-dev.git
Backout bug 385524 due to a doubling in RLk.
This commit is contained in:
Родитель
005081129f
Коммит
da89a9615b
|
@ -38,16 +38,17 @@
|
|||
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]),
|
||||
QueryInterface : function (iid) {
|
||||
var interfaces = [Ci.nsILoginInfo, Ci.nsISupports];
|
||||
if (!interfaces.some( function(v) { return iid.equals(v) } ))
|
||||
throw Components.results.NS_ERROR_NO_INTERFACE;
|
||||
return this;
|
||||
},
|
||||
|
||||
|
||||
hostname : null,
|
||||
formSubmitURL : null,
|
||||
|
@ -103,7 +104,58 @@ nsLoginInfo.prototype = {
|
|||
|
||||
}; // end of nsLoginInfo implementation
|
||||
|
||||
var component = [nsLoginInfo];
|
||||
|
||||
|
||||
|
||||
// Boilerplate code for component registration...
|
||||
var gModule = {
|
||||
registerSelf: function(componentManager, fileSpec, location, type) {
|
||||
componentManager = componentManager.QueryInterface(
|
||||
Ci.nsIComponentRegistrar);
|
||||
for each (var obj in this._objects)
|
||||
componentManager.registerFactoryLocation(obj.CID,
|
||||
obj.className, obj.contractID,
|
||||
fileSpec, location, type);
|
||||
},
|
||||
|
||||
unregisterSelf: function (componentManager, location, type) {
|
||||
for each (var obj in this._objects)
|
||||
componentManager.unregisterFactoryLocation(obj.CID, location);
|
||||
},
|
||||
|
||||
getClassObject: function(componentManager, cid, iid) {
|
||||
if (!iid.equals(Ci.nsIFactory))
|
||||
throw Components.results.NS_ERROR_NOT_IMPLEMENTED;
|
||||
|
||||
for (var key in this._objects) {
|
||||
if (cid.equals(this._objects[key].CID))
|
||||
return this._objects[key].factory;
|
||||
}
|
||||
|
||||
throw Components.results.NS_ERROR_NO_INTERFACE;
|
||||
},
|
||||
|
||||
_objects: {
|
||||
service: {
|
||||
CID : Components.ID("{0f2f347c-1e4f-40cc-8efd-792dea70a85e}"),
|
||||
contractID : "@mozilla.org/login-manager/loginInfo;1",
|
||||
className : "LoginInfo",
|
||||
factory : LoginInfoFactory = {
|
||||
createInstance: function(aOuter, aIID) {
|
||||
if (aOuter != null)
|
||||
throw Components.results.NS_ERROR_NO_AGGREGATION;
|
||||
var svc = new nsLoginInfo();
|
||||
return svc.QueryInterface(aIID);
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
canUnload: function(componentManager) {
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
function NSGetModule(compMgr, fileSpec) {
|
||||
return XPCOMUtils.generateModule(component);
|
||||
return gModule;
|
||||
}
|
||||
|
|
|
@ -38,19 +38,19 @@
|
|||
const Cc = Components.classes;
|
||||
const Ci = Components.interfaces;
|
||||
|
||||
Components.utils.import("resource://gre/modules/XPCOMUtils.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]),
|
||||
QueryInterface : function (iid) {
|
||||
const interfaces = [Ci.nsILoginManager,
|
||||
Ci.nsISupports, Ci.nsISupportsWeakReference];
|
||||
if (!interfaces.some( function(v) { return iid.equals(v) } ))
|
||||
throw Components.results.NS_ERROR_NO_INTERFACE;
|
||||
return this;
|
||||
},
|
||||
|
||||
|
||||
/* ---------- private memebers ---------- */
|
||||
|
@ -220,9 +220,13 @@ LoginManager.prototype = {
|
|||
_observer : {
|
||||
_pwmgr : null,
|
||||
|
||||
QueryInterface : XPCOMUtils.generateQI([Ci.nsIObserver,
|
||||
Ci.nsIFormSubmitObserver,
|
||||
Ci.nsISupportsWeakReference]),
|
||||
QueryInterface : function (iid) {
|
||||
const interfaces = [Ci.nsIObserver, Ci.nsIFormSubmitObserver,
|
||||
Ci.nsISupports, Ci.nsISupportsWeakReference];
|
||||
if (!interfaces.some( function(v) { return iid.equals(v) } ))
|
||||
throw Components.results.NS_ERROR_NO_INTERFACE;
|
||||
return this;
|
||||
},
|
||||
|
||||
|
||||
// nsFormSubmitObserver
|
||||
|
@ -275,8 +279,13 @@ LoginManager.prototype = {
|
|||
_pwmgr : null,
|
||||
_domEventListener : null,
|
||||
|
||||
QueryInterface : XPCOMUtils.generateQI([Ci.nsIWebProgressListener,
|
||||
Ci.nsISupportsWeakReference]),
|
||||
QueryInterface : function (iid) {
|
||||
const interfaces = [Ci.nsIWebProgressListener,
|
||||
Ci.nsISupports, Ci.nsISupportsWeakReference];
|
||||
if (!interfaces.some( function(v) { return iid.equals(v) } ))
|
||||
throw Components.results.NS_ERROR_NO_INTERFACE;
|
||||
return this;
|
||||
},
|
||||
|
||||
|
||||
onStateChange : function (aWebProgress, aRequest,
|
||||
|
@ -330,8 +339,13 @@ LoginManager.prototype = {
|
|||
_domEventListener : {
|
||||
_pwmgr : null,
|
||||
|
||||
QueryInterface : XPCOMUtils.generateQI([Ci.nsIDOMEventListener,
|
||||
Ci.nsISupportsWeakReference]),
|
||||
QueryInterface : function (iid) {
|
||||
const interfaces = [Ci.nsIDOMEventListener,
|
||||
Ci.nsISupports, Ci.nsISupportsWeakReference];
|
||||
if (!interfaces.some( function(v) { return iid.equals(v) } ))
|
||||
throw Components.results.NS_ERROR_NO_INTERFACE;
|
||||
return this;
|
||||
},
|
||||
|
||||
|
||||
handleEvent : function (event) {
|
||||
|
@ -1320,8 +1334,13 @@ function UserAutoCompleteResult (aSearchString, matchingLogins) {
|
|||
}
|
||||
|
||||
UserAutoCompleteResult.prototype = {
|
||||
QueryInterface : XPCOMUtils.generateQI([Ci.nsIAutoCompleteResult,
|
||||
Ci.nsISupportsWeakReference]),
|
||||
QueryInterface : function (iid) {
|
||||
const interfaces = [Ci.nsIAutoCompleteResult,
|
||||
Ci.nsISupports, Ci.nsISupportsWeakReference];
|
||||
if (!interfaces.some( function(v) { return iid.equals(v) } ))
|
||||
throw Components.results.NS_ERROR_NO_INTERFACE;
|
||||
return this;
|
||||
},
|
||||
|
||||
// private
|
||||
logins : null,
|
||||
|
@ -1365,7 +1384,60 @@ UserAutoCompleteResult.prototype = {
|
|||
},
|
||||
};
|
||||
|
||||
var component = [LoginManager];
|
||||
|
||||
|
||||
|
||||
// Boilerplate code for component registration...
|
||||
var gModule = {
|
||||
registerSelf: function (componentManager, fileSpec, location, type) {
|
||||
componentManager = componentManager.QueryInterface(
|
||||
Ci.nsIComponentRegistrar);
|
||||
for each (var obj in this._objects)
|
||||
componentManager.registerFactoryLocation(obj.CID,
|
||||
obj.className, obj.contractID,
|
||||
fileSpec, location, type);
|
||||
},
|
||||
|
||||
unregisterSelf: function (componentManager, location, type) {
|
||||
for each (var obj in this._objects)
|
||||
componentManager.unregisterFactoryLocation(obj.CID, location);
|
||||
},
|
||||
|
||||
getClassObject: function (componentManager, cid, iid) {
|
||||
if (!iid.equals(Ci.nsIFactory))
|
||||
throw Components.results.NS_ERROR_NOT_IMPLEMENTED;
|
||||
|
||||
for (var key in this._objects) {
|
||||
if (cid.equals(this._objects[key].CID))
|
||||
return this._objects[key].factory;
|
||||
}
|
||||
|
||||
throw Components.results.NS_ERROR_NO_INTERFACE;
|
||||
},
|
||||
|
||||
_objects: {
|
||||
service: {
|
||||
CID : Components.ID("{cb9e0de8-3598-4ed7-857b-827f011ad5d8}"),
|
||||
contractID : "@mozilla.org/login-manager;1",
|
||||
className : "LoginManager",
|
||||
factory : LoginManagerFactory = {
|
||||
createInstance: function (aOuter, aIID) {
|
||||
if (aOuter != null)
|
||||
throw Components.results.NS_ERROR_NO_AGGREGATION;
|
||||
|
||||
var svc = new LoginManager();
|
||||
|
||||
return svc.QueryInterface(aIID);
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
canUnload: function (componentManager) {
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
function NSGetModule (compMgr, fileSpec) {
|
||||
return XPCOMUtils.generateModule(component);
|
||||
return gModule;
|
||||
}
|
||||
|
|
|
@ -38,8 +38,6 @@
|
|||
const Cc = Components.classes;
|
||||
const Ci = Components.interfaces;
|
||||
|
||||
Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
|
||||
/*
|
||||
* LoginManagerPromptFactory
|
||||
*
|
||||
|
@ -52,10 +50,12 @@ function LoginManagerPromptFactory() {}
|
|||
|
||||
LoginManagerPromptFactory.prototype = {
|
||||
|
||||
classDescription : "LoginManagerPromptFactory",
|
||||
contractID : "@mozilla.org/passwordmanager/authpromptfactory;1",
|
||||
classID : Components.ID("{447fc780-1d28-412a-91a1-466d48129c65}"),
|
||||
QueryInterface : XPCOMUtils.generateQI([Ci.nsIPromptFactory]),
|
||||
QueryInterface : function (iid) {
|
||||
const interfaces = [Ci.nsIPromptFactory, Ci.nsISupports];
|
||||
if (!interfaces.some( function(v) { return iid.equals(v) } ))
|
||||
throw Components.results.NS_ERROR_NO_INTERFACE;
|
||||
return this;
|
||||
},
|
||||
|
||||
_promptService : null,
|
||||
_pwmgr : null,
|
||||
|
@ -106,7 +106,13 @@ LoginManagerPromptFactory.prototype = {
|
|||
function LoginManagerPrompter() {}
|
||||
LoginManagerPrompter.prototype = {
|
||||
|
||||
QueryInterface : XPCOMUtils.generateQI([Ci.nsIAuthPrompt2]),
|
||||
QueryInterface : function (iid) {
|
||||
var interfaces = [Ci.nsIAuthPrompt2, Ci.nsISupports];
|
||||
if (!interfaces.some( function(v) { return iid.equals(v) } ))
|
||||
throw Components.results.NS_ERROR_NO_INTERFACE;
|
||||
return this;
|
||||
},
|
||||
|
||||
|
||||
__logService : null, // Console logging service, used for debugging.
|
||||
get _logService() {
|
||||
|
@ -354,7 +360,58 @@ LoginManagerPrompter.prototype = {
|
|||
}
|
||||
}; // end of LoginManagerPrompter implementation
|
||||
|
||||
var component = [LoginManagerPromptFactory];
|
||||
|
||||
|
||||
|
||||
// Boilerplate code...
|
||||
var gModule = {
|
||||
registerSelf: function(componentManager, fileSpec, location, type) {
|
||||
componentManager = componentManager.QueryInterface(
|
||||
Ci.nsIComponentRegistrar);
|
||||
for each (var obj in this._objects)
|
||||
componentManager.registerFactoryLocation(obj.CID,
|
||||
obj.className, obj.contractID,
|
||||
fileSpec, location, type);
|
||||
},
|
||||
|
||||
unregisterSelf: function (componentManager, location, type) {
|
||||
for each (var obj in this._objects)
|
||||
componentManager.unregisterFactoryLocation(obj.CID, location);
|
||||
},
|
||||
|
||||
getClassObject: function(componentManager, cid, iid) {
|
||||
if (!iid.equals(Ci.nsIFactory))
|
||||
throw Components.results.NS_ERROR_NOT_IMPLEMENTED;
|
||||
|
||||
for (var key in this._objects) {
|
||||
if (cid.equals(this._objects[key].CID))
|
||||
return this._objects[key].factory;
|
||||
}
|
||||
|
||||
throw Components.results.NS_ERROR_NO_INTERFACE;
|
||||
},
|
||||
|
||||
_objects: {
|
||||
service: {
|
||||
CID : Components.ID("{447fc780-1d28-412a-91a1-466d48129c65}"),
|
||||
contractID : "@mozilla.org/passwordmanager/authpromptfactory;1",
|
||||
className : "LoginManagerPromptFactory",
|
||||
factory : LoginManagerPromptFactory_Factory = {
|
||||
createInstance: function (aOuter, aIID) {
|
||||
if (aOuter != null)
|
||||
throw Components.results.NS_ERROR_NO_AGGREGATION;
|
||||
|
||||
return new LoginManagerPromptFactory().QueryInterface(aIID);
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
canUnload: function(componentManager) {
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
function NSGetModule(compMgr, fileSpec) {
|
||||
return XPCOMUtils.generateModule(component);
|
||||
return gModule;
|
||||
}
|
||||
|
|
|
@ -38,16 +38,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]),
|
||||
QueryInterface : function (iid) {
|
||||
const interfaces = [Ci.nsILoginManagerStorage, Ci.nsISupports];
|
||||
if (!interfaces.some( function(v) { return iid.equals(v) } ))
|
||||
throw Components.results.NS_ERROR_NO_INTERFACE;
|
||||
return this;
|
||||
},
|
||||
|
||||
__logService : null, // Console logging service, used for debugging.
|
||||
get _logService() {
|
||||
|
@ -678,7 +678,58 @@ LoginManagerStorage_legacy.prototype = {
|
|||
|
||||
}; // end of nsLoginManagerStorage_legacy implementation
|
||||
|
||||
var component = [LoginManagerStorage_legacy];
|
||||
|
||||
|
||||
|
||||
// Boilerplate code for component registration...
|
||||
var gModule = {
|
||||
registerSelf: function(componentManager, fileSpec, location, type) {
|
||||
componentManager = componentManager.QueryInterface(
|
||||
Ci.nsIComponentRegistrar);
|
||||
for each (var obj in this._objects)
|
||||
componentManager.registerFactoryLocation(obj.CID,
|
||||
obj.className, obj.contractID,
|
||||
fileSpec, location, type);
|
||||
},
|
||||
|
||||
unregisterSelf: function (componentManager, location, type) {
|
||||
for each (var obj in this._objects)
|
||||
componentManager.unregisterFactoryLocation(obj.CID, location);
|
||||
},
|
||||
|
||||
getClassObject: function(componentManager, cid, iid) {
|
||||
if (!iid.equals(Ci.nsIFactory))
|
||||
throw Components.results.NS_ERROR_NOT_IMPLEMENTED;
|
||||
|
||||
for (var key in this._objects) {
|
||||
if (cid.equals(this._objects[key].CID))
|
||||
return this._objects[key].factory;
|
||||
}
|
||||
|
||||
throw Components.results.NS_ERROR_NO_INTERFACE;
|
||||
},
|
||||
|
||||
_objects: {
|
||||
service: {
|
||||
CID : Components.ID("{e09e4ca6-276b-4bb4-8b71-0635a3a2a007}"),
|
||||
contractID : "@mozilla.org/login-manager/storage/legacy;1",
|
||||
className : "LoginManagerStorage_legacy",
|
||||
factory : aFactory = {
|
||||
createInstance: function(aOuter, aIID) {
|
||||
if (aOuter != null)
|
||||
throw Components.results.NS_ERROR_NO_AGGREGATION;
|
||||
var svc = new LoginManagerStorage_legacy();
|
||||
return svc.QueryInterface(aIID);
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
canUnload: function(componentManager) {
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
function NSGetModule(compMgr, fileSpec) {
|
||||
return XPCOMUtils.generateModule(component);
|
||||
return gModule;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче