Backed out changeset e74192b1a9c8 (bug 1202458)

--HG--
extra : rebase_source : 95f662b3116ce3c9dc5357578a65672a1f3d5b2a
This commit is contained in:
Carsten "Tomcat" Book 2016-06-02 16:29:47 +02:00
Родитель a5d777df66
Коммит eb67af1f6f
6 изменённых файлов: 14 добавлений и 12 удалений

Просмотреть файл

@ -51,7 +51,7 @@ const TEST_DATA = [{
selector: "#longtext-and-node",
inline: false,
value: LONG_VALUE,
}];
}, ];
add_task(function* () {
let {inspector, testActor} = yield openInspectorForURL(TEST_URL);

Просмотреть файл

@ -52,11 +52,13 @@ exports.LongStringActor = protocol.ActorClass({
});
/**
* When a caller is expecting a LongString actor but the string is already available on
* client, the SimpleStringFront can be used as it shares the same API as a
* LongStringFront but will not make unnecessary trips to the server.
* When a LongString on the server is short enough to be passed
* as a full string, the client will get a ShortLongString instead of
* a LongStringFront. Its API should match.
*
* I'm very proud of this name.
*/
exports.SimpleStringFront = Class({
exports.ShortLongString = Class({
initialize: function (str) {
this.str = str;
},
@ -139,7 +141,7 @@ protocol.types.addType("longstring", {
throw Error("Passing a longstring as an argument isn't supported.");
}
if (typeof (value) === "string") {
return exports.SimpleStringFront(value);
return exports.ShortLongString(value);
}
return stringActorType.read(value, context, detail);
}

Просмотреть файл

@ -15,7 +15,7 @@ const promise = require("promise");
const events = require("sdk/event/core");
const protocol = require("devtools/shared/protocol");
const {Arg, Option, method, RetVal, types} = protocol;
const {LongStringActor} = require("devtools/server/actors/string");
const {LongStringActor, ShortLongString} = require("devtools/server/actors/string");
const {fetch} = require("devtools/shared/DevToolsUtils");
const {OldStyleSheetFront} = require("devtools/shared/fronts/styleeditor");
const {oldStyleSheetSpec} = require("devtools/shared/specs/styleeditor");

Просмотреть файл

@ -16,7 +16,7 @@ const {Task} = require("devtools/shared/task");
const events = require("sdk/event/core");
const protocol = require("devtools/shared/protocol");
const {Arg, Option, method, RetVal, types} = protocol;
const {LongStringActor} = require("devtools/server/actors/string");
const {LongStringActor, ShortLongString} = require("devtools/server/actors/string");
const {fetch} = require("devtools/shared/DevToolsUtils");
const {listenOnce} = require("devtools/shared/async-utils");
const {originalSourceSpec, mediaRuleSpec, styleSheetSpec,

Просмотреть файл

@ -6,7 +6,7 @@
const { Ci } = require("chrome");
require("devtools/shared/fronts/styles");
require("devtools/shared/fronts/highlighters");
const { SimpleStringFront } = require("devtools/server/actors/string");
const { ShortLongString } = require("devtools/server/actors/string");
const {
Front,
FrontClassWithSpec,
@ -321,7 +321,7 @@ const NodeFront = FrontClassWithSpec(nodeSpec, {
}
let str = this._form.nodeValue || "";
return promise.resolve(new SimpleStringFront(str));
return promise.resolve(new ShortLongString(str));
}, {
impl: "_getNodeValue"
}),

Просмотреть файл

@ -3,7 +3,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict";
const { SimpleStringFront } = require("devtools/server/actors/string");
const { ShortLongString } = require("devtools/server/actors/string");
const { Front, FrontClassWithSpec } = require("devtools/shared/protocol");
const { oldStyleSheetSpec } = require("devtools/shared/specs/styleeditor");
const promise = require("promise");
@ -43,7 +43,7 @@ const OldStyleSheetFront = FrontClassWithSpec(oldStyleSheetSpec, {
let deferred = promise.defer();
events.once(this, "source-load", (source) => {
let longStr = new SimpleStringFront(source);
let longStr = new ShortLongString(source);
deferred.resolve(longStr);
});
this.fetchSource();