Backed out changeset e58df849e249 (bug 1268461) for bustage

This commit is contained in:
Carsten "Tomcat" Book 2016-05-03 13:37:29 +02:00
parent 56aee50d78
commit 779fe0a0a8
6 changed files with 37 additions and 67 deletions

View File

@ -1,10 +1,7 @@
# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
# vim: set filetype=python:
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
DevToolsModules(
'storage.js',
'stylesheets.js'
)

View File

@ -1,36 +0,0 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict";
const { Front, FrontClassWithSpec } = require("devtools/server/protocol.js");
const { originalSourceSpec } = require("devtools/shared/specs/stylesheets.js");
/**
* The client-side counterpart for an OriginalSourceActor.
*/
const OriginalSourceFront = FrontClassWithSpec(originalSourceSpec, {
initialize: function (client, form) {
Front.prototype.initialize.call(this, client, form);
this.isOriginalSource = true;
},
form: function (form, detail) {
if (detail === "actorid") {
this.actorID = form;
return;
}
this.actorID = form.actor;
this._form = form;
},
get href() {
return this._form.url;
},
get url() {
return this._form.url;
}
});
exports.OriginalSourceFront = OriginalSourceFront;

View File

@ -14,13 +14,11 @@ Cu.import("resource://gre/modules/Task.jsm");
const promise = require("promise");
const events = require("sdk/event/core");
const {OriginalSourceFront} = require("devtools/client/fronts/stylesheets");
const protocol = require("devtools/server/protocol");
const {Arg, Option, method, RetVal, types} = protocol;
const {LongStringActor, ShortLongString} = require("devtools/server/actors/string");
const {fetch} = require("devtools/shared/DevToolsUtils");
const {listenOnce} = require("devtools/shared/async-utils");
const {originalSourceSpec} = require("devtools/shared/specs/stylesheets");
const {SourceMapConsumer} = require("source-map");
loader.lazyGetter(this, "CssLogic", () => require("devtools/shared/inspector/css-logic").CssLogic);
@ -68,7 +66,9 @@ let modifiedStyleSheets = new WeakMap();
* Actor representing an original source of a style sheet that was specified
* in a source map.
*/
var OriginalSourceActor = protocol.ActorClassWithSpec(originalSourceSpec, {
var OriginalSourceActor = protocol.ActorClass({
typeName: "originalsource",
initialize: function(aUrl, aSourceMap, aParentActor) {
protocol.Actor.prototype.initialize.call(this, null);
@ -110,13 +110,44 @@ var OriginalSourceActor = protocol.ActorClassWithSpec(originalSourceSpec, {
/**
* Protocol method to get the text of this source.
*/
getText: function() {
getText: method(function() {
return this._getText().then((text) => {
return new LongStringActor(this.conn, text || "");
});
}
}, {
response: {
text: RetVal("longstring")
}
})
})
/**
* The client-side counterpart for an OriginalSourceActor.
*/
var OriginalSourceFront = protocol.FrontClass(OriginalSourceActor, {
initialize: function(client, form) {
protocol.Front.prototype.initialize.call(this, client, form);
this.isOriginalSource = true;
},
form: function(form, detail) {
if (detail === "actorid") {
this.actorID = form;
return;
}
this.actorID = form.actor;
this._form = form;
},
get href() {
return this._form.url;
},
get url() {
return this._form.url;
}
});
/**
* A MediaRuleActor lives on the server and provides access to properties
* of a DOM @media rule and emits events when it changes.

View File

@ -24,7 +24,6 @@ DIRS += [
'sourcemap',
'specs',
'shims',
'specs',
'touch',
'transport',
'webconsole',

View File

@ -5,6 +5,5 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
DevToolsModules(
'storage.js',
'stylesheets.js'
'storage.js'
)

View File

@ -1,20 +0,0 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict";
const { RetVal, generateActorSpec } = require("devtools/server/protocol.js");
const originalSourceSpec = generateActorSpec({
typeName: "originalsource",
methods: {
getText: {
response: {
text: RetVal("longstring")
}
}
}
});
exports.originalSourceSpec = originalSourceSpec;