[Pkg-mozext-commits] [firebug] 03/15: Firebug doesn't work on nightly 48 (deprecated APIs)
David Prévot
taffit at moszumanska.debian.org
Fri Mar 25 19:18:17 UTC 2016
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to branch master
in repository firebug.
commit 8d08a9fe6be130a88b783d7ccc2758d9d08d3f62
Author: Jan Odvarko <odvarko at gmail.com>
Date: Mon Mar 21 16:25:21 2016 +0100
Firebug doesn't work on nightly 48 (deprecated APIs)
---
.../content/firebug/firefox/browserOverlay.js | 15 ++++++---------
extension/content/firebug/lib/http.js | 22 +++++++++-------------
extension/content/firebug/net/sourceCache.js | 11 +++++++++--
extension/content/firebug/net/tabCache.js | 9 +++++++--
extension/modules/firebug-trace-service.js | 3 ++-
5 files changed, 33 insertions(+), 27 deletions(-)
diff --git a/extension/content/firebug/firefox/browserOverlay.js b/extension/content/firebug/firefox/browserOverlay.js
index 39ad5cb..81380e6 100644
--- a/extension/content/firebug/firefox/browserOverlay.js
+++ b/extension/content/firebug/firefox/browserOverlay.js
@@ -38,6 +38,7 @@ Locale.registerStringBundle("chrome://firebug/locale/multiprocess-notification.p
Cu.import("resource://firebug/loader.js");
Cu.import("resource://firebug/fbtrace.js");
Cu.import("resource://gre/modules/AddonManager.jsm");
+Cu.import("resource://gre/modules/NetUtil.jsm");
var servicesScope = {};
Cu.import("resource://gre/modules/Services.jsm", servicesScope);
@@ -449,15 +450,11 @@ BrowserOverlay.prototype =
var loadingPrincipal = servicesScope.Services.scriptSecurityManager.getSystemPrincipal();
- var channel = ioService.newChannel2(
- versionURL,
- /* aOriginCharset */null,
- /* aBaseURI */ null,
- /* aLoadingNode */null,
- loadingPrincipal,
- /* aTriggeringPrincipal */ null,
- /* aSecurityFlag */ Ci.nsILoadInfo.SEC_ALLOW_CROSS_ORIGIN_DATA_IS_NULL,
- /* aContentPolicyType */ Ci.nsIContentPolicy.TYPE_OTHER);
+ var channel = NetUtil.newChannel({
+ uri: versionURL,
+ loadUsingSystemPrincipal: true
+ });
+
var input = channel.open();
var sis = Cc["@mozilla.org/scriptableinputstream;1"].
createInstance(Ci.nsIScriptableInputStream);
diff --git a/extension/content/firebug/lib/http.js b/extension/content/firebug/lib/http.js
index b5b46fa..d165aa9 100644
--- a/extension/content/firebug/lib/http.js
+++ b/extension/content/firebug/lib/http.js
@@ -17,10 +17,13 @@ function(Xpcom, FBTrace, Deprecated, StackFrame, Str) {
const Cc = Components.classes;
const Ci = Components.interfaces;
const Cr = Components.results;
+const Cu = Components.utils;
const NS_SEEK_SET = Ci.nsISeekableStream.NS_SEEK_SET;
const ioService = Cc["@mozilla.org/network/io-service;1"].getService(Ci.nsIIOService);
+Cu.import("resource://gre/modules/NetUtil.jsm");
+
var Http = {};
// ********************************************************************************************* //
@@ -92,22 +95,15 @@ Http.readPostTextFromPage = function(url, context)
}
};
-Http.getResource = function(aURL, ignoreMissing, doc)
+Http.getResource = function(aURL, ignoreMissing)
{
- if (!doc) {
- doc = Firebug.chrome.window.document;
- }
try
{
- var channel = ioService.newChannel2(
- aURL,
- /* aCharset */ null,
- /* aBaseURI */ null,
- /* aLoadingNode */ doc,
- /* aLoadingPrincipal */ null,
- /* aTriggeringPrincipal */ null,
- /* aSecurityFlag */ null,
- /* aContentPolicyType */ null);
+ var channel = NetUtil.newChannel({
+ uri: aURL,
+ loadUsingSystemPrincipal: true
+ });
+
var input = channel.open();
return Http.readFromStream(input);
diff --git a/extension/content/firebug/net/sourceCache.js b/extension/content/firebug/net/sourceCache.js
index 39cb97a..30032f3 100644
--- a/extension/content/firebug/net/sourceCache.js
+++ b/extension/content/firebug/net/sourceCache.js
@@ -17,6 +17,8 @@ function(EventSource, Obj, Firebug, Xpcom, Url, Http, Options, Str) {
const Cc = Components.classes;
const Ci = Components.interfaces;
+const Cu = Components.utils;
+
const nsIIOService = Ci.nsIIOService;
const nsIRequest = Ci.nsIRequest;
const nsICachingChannel = Ci.nsICachingChannel;
@@ -34,6 +36,8 @@ const LOAD_BYPASS_LOCAL_CACHE_IF_BUSY = nsICachingChannel.LOAD_BYPASS_LOCAL_CACH
const NS_BINDING_ABORTED = 0x804b0002;
+Cu.import("resource://gre/modules/NetUtil.jsm");
+
// ********************************************************************************************* //
Firebug.SourceCache = function(context)
@@ -214,8 +218,11 @@ Firebug.SourceCache.prototype = Obj.extend(new EventSource(),
var channel;
try
{
- // TODO use newChannel2 here
- channel = ioService.newChannel(url, null, null);
+ channel = NetUtil.newChannel({
+ uri: url,
+ loadUsingSystemPrincipal: true
+ });
+
channel.loadFlags |= LOAD_FROM_CACHE | LOAD_BYPASS_LOCAL_CACHE_IF_BUSY;
if (method && (channel instanceof nsIHttpChannel))
diff --git a/extension/content/firebug/net/tabCache.js b/extension/content/firebug/net/tabCache.js
index da0e719..38e5955 100644
--- a/extension/content/firebug/net/tabCache.js
+++ b/extension/content/firebug/net/tabCache.js
@@ -27,9 +27,12 @@ function(ActivableModule, Obj, Firebug, Xpcom, HttpRequestObserver, HttpResponse
const Cc = Components.classes;
const Ci = Components.interfaces;
+const Cu = Components.utils;
const ioService = Cc["@mozilla.org/network/io-service;1"].getService(Ci.nsIIOService);
+Cu.import("resource://gre/modules/NetUtil.jsm");
+
// List of text content types. These content-types are cached.
var contentTypes =
{
@@ -440,8 +443,10 @@ Firebug.TabCache.prototype = Obj.extend(SourceCache.prototype,
if (url === "<unknown>")
return [Locale.$STR("message.sourceNotAvailableFor") + ": " + url];
- // TODO use newChannel2 here
- var channel = ioService.newChannel(url, null, null);
+ var channel = NetUtil.newChannel({
+ uri: url,
+ loadUsingSystemPrincipal: true
+ });
// These flag combination doesn't repost the request.
channel.loadFlags = Ci.nsIRequest.LOAD_FROM_CACHE |
diff --git a/extension/modules/firebug-trace-service.js b/extension/modules/firebug-trace-service.js
index d34e6db..40ffc08 100644
--- a/extension/modules/firebug-trace-service.js
+++ b/extension/modules/firebug-trace-service.js
@@ -138,7 +138,8 @@ TracerWrapper.prototype =
// Create FBTrace proxy. As soon as FBTrace console is available it'll forward
// all calls to it.
- return new Proxy({}, {
+ return new Proxy({},
+ {
get: function(target, name)
{
return self.FBTrace ? self.FBTrace[name] : self.tracer[name];
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/firebug.git
More information about the Pkg-mozext-commits
mailing list