mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 610832 - Make about:sync-log a directory listing. r=rnewman,mconnor
This commit is contained in:
parent
3e28e5010d
commit
379d494c7c
@ -4,8 +4,6 @@ contract @mozilla.org/weave/service;1 {74b89fb0-f200-4ae8-a3ec-dd164117f6de}
|
|||||||
category app-startup WeaveService service,@mozilla.org/weave/service;1
|
category app-startup WeaveService service,@mozilla.org/weave/service;1
|
||||||
component {d28f8a0b-95da-48f4-b712-caf37097be41} Weave.js
|
component {d28f8a0b-95da-48f4-b712-caf37097be41} Weave.js
|
||||||
contract @mozilla.org/network/protocol/about;1?what=sync-log {d28f8a0b-95da-48f4-b712-caf37097be41}
|
contract @mozilla.org/network/protocol/about;1?what=sync-log {d28f8a0b-95da-48f4-b712-caf37097be41}
|
||||||
component {a08ee179-df50-48e0-9c87-79e4dd5caeb1} Weave.js
|
|
||||||
contract @mozilla.org/network/protocol/about;1?what=sync-log.1 {a08ee179-df50-48e0-9c87-79e4dd5caeb1}
|
|
||||||
# Register resource aliases
|
# Register resource aliases
|
||||||
resource services-sync resource:///modules/services-sync/
|
resource services-sync resource:///modules/services-sync/
|
||||||
resource services-crypto resource:///modules/services-crypto/
|
resource services-crypto resource:///modules/services-crypto/
|
||||||
|
@ -19,6 +19,7 @@
|
|||||||
*
|
*
|
||||||
* Contributor(s):
|
* Contributor(s):
|
||||||
* Dan Mills <thunder@mozilla.com>
|
* Dan Mills <thunder@mozilla.com>
|
||||||
|
* Philipp von Weitershausen <philipp@weitershausen.de>
|
||||||
*
|
*
|
||||||
* Alternatively, the contents of this file may be used under the terms of
|
* 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
|
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||||
@ -39,6 +40,8 @@ const Ci = Components.interfaces;
|
|||||||
const Cu = Components.utils;
|
const Cu = Components.utils;
|
||||||
|
|
||||||
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||||
|
Cu.import("resource://gre/modules/Services.jsm");
|
||||||
|
Cu.import("resource://gre/modules/FileUtils.jsm");
|
||||||
|
|
||||||
function WeaveService() {
|
function WeaveService() {
|
||||||
this.wrappedJSObject = this;
|
this.wrappedJSObject = this;
|
||||||
@ -84,53 +87,20 @@ AboutWeaveLog.prototype = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
newChannel: function(aURI) {
|
newChannel: function(aURI) {
|
||||||
let dir = Cc["@mozilla.org/file/directory_service;1"].
|
let dir = FileUtils.getDir("ProfD", ["weave", "logs"], true);
|
||||||
getService(Ci.nsIProperties);
|
let uri = Services.io.newFileURI(dir);
|
||||||
let file = dir.get("ProfD", Ci.nsILocalFile);
|
let channel = Services.io.newChannelFromURI(uri);
|
||||||
file.append("weave");
|
channel.originalURI = aURI;
|
||||||
file.append("logs");
|
|
||||||
file.append("verbose-log.txt");
|
// Ensure that the about page has the same privileges as a regular directory
|
||||||
let ios = Cc["@mozilla.org/network/io-service;1"].
|
// view. That way links to files can be opened.
|
||||||
getService(Ci.nsIIOService);
|
let ssm = Cc["@mozilla.org/scriptsecuritymanager;1"]
|
||||||
let ch = ios.newChannel(ios.newFileURI(file).spec, null, null);
|
.getService(Ci.nsIScriptSecurityManager);
|
||||||
ch.originalURI = aURI;
|
let principal = ssm.getCodebasePrincipal(uri);
|
||||||
return ch;
|
channel.owner = principal;
|
||||||
|
return channel;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
function AboutWeaveLog1() {}
|
const components = [WeaveService, AboutWeaveLog];
|
||||||
AboutWeaveLog1.prototype = {
|
const NSGetFactory = XPCOMUtils.generateNSGetFactory(components);
|
||||||
classID: Components.ID("{a08ee179-df50-48e0-9c87-79e4dd5caeb1}"),
|
|
||||||
|
|
||||||
QueryInterface: XPCOMUtils.generateQI([Ci.nsIAboutModule,
|
|
||||||
Ci.nsISupportsWeakReference]),
|
|
||||||
|
|
||||||
getURIFlags: function(aURI) {
|
|
||||||
return 0;
|
|
||||||
},
|
|
||||||
|
|
||||||
newChannel: function(aURI) {
|
|
||||||
let dir = Cc["@mozilla.org/file/directory_service;1"].
|
|
||||||
getService(Ci.nsIProperties);
|
|
||||||
let file = dir.get("ProfD", Ci.nsILocalFile);
|
|
||||||
file.append("weave");
|
|
||||||
file.append("logs");
|
|
||||||
file.append("verbose-log.txt.1");
|
|
||||||
let ios = Cc["@mozilla.org/network/io-service;1"].
|
|
||||||
getService(Ci.nsIIOService);
|
|
||||||
let ch = ios.newChannel(ios.newFileURI(file).spec, null, null);
|
|
||||||
ch.originalURI = aURI;
|
|
||||||
return ch;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
let components = [WeaveService, AboutWeaveLog, AboutWeaveLog1];
|
|
||||||
|
|
||||||
// Gecko <2.0
|
|
||||||
function NSGetModule(compMgr, fileSpec) {
|
|
||||||
return XPCOMUtils.generateModule(components);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Gecko >=2.0
|
|
||||||
if (typeof XPCOMUtils.generateNSGetFactory == "function")
|
|
||||||
const NSGetFactory = XPCOMUtils.generateNSGetFactory(components);
|
|
||||||
|
Loading…
Reference in New Issue
Block a user