зеркало из https://github.com/mozilla/gecko-dev.git
Merge fx-team to m-c. a=merge
This commit is contained in:
Коммит
738e1f1ef3
|
@ -40,7 +40,7 @@ var test = Task.async(function* () {
|
|||
obj.expand();
|
||||
yield expanded;
|
||||
|
||||
let values = [" ", "\r", "\n", "\t", "\f", "\uFEFF", "\xA0"];
|
||||
let values = ["", " ", "\r", "\n", "\t", "\f", "\uFEFF", "\xA0"];
|
||||
let count = values.length;
|
||||
|
||||
for (let [property, value] of obj) {
|
||||
|
|
|
@ -89,7 +89,7 @@ function testHierarchy() {
|
|||
"There should be 1 scope, 1 var, 1 proto, 8 props, 1 getter and 1 setter.");
|
||||
|
||||
gScope = gVariablesView._currHierarchy.get("");
|
||||
gVariable = gVariablesView._currHierarchy.get("[\"\"]");
|
||||
gVariable = gVariablesView._currHierarchy.get("[]");
|
||||
|
||||
is(gVariablesView._store.length, 1,
|
||||
"There should be only one scope in the view.");
|
||||
|
|
|
@ -10,17 +10,17 @@
|
|||
|
||||
<body>
|
||||
<script>
|
||||
window.obj = {
|
||||
" ": 0,
|
||||
"\r": 1,
|
||||
"\n": 2,
|
||||
"\t": 3,
|
||||
"\f": 4,
|
||||
"\uFEFF": 5,
|
||||
"\xA0": 6
|
||||
};
|
||||
window.doPause = function () {
|
||||
var obj = window.obj;
|
||||
var obj = {
|
||||
"": 0,
|
||||
" ": 1,
|
||||
"\r": 2,
|
||||
"\n": 3,
|
||||
"\t": 4,
|
||||
"\f": 5,
|
||||
"\uFEFF": 6,
|
||||
"\xA0": 7
|
||||
};
|
||||
debugger;
|
||||
};
|
||||
</script>
|
||||
|
|
|
@ -154,6 +154,7 @@ InspectorSearch.prototype = {
|
|||
this.searchBox.classList.remove("devtools-style-searchbox-no-match");
|
||||
this.searchBox.value = "";
|
||||
this.searchClearButton.hidden = true;
|
||||
this.emit("search-cleared");
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
// by NodeActor actor (see 'onNodeActorForm' method).
|
||||
|
||||
const Events = require("sdk/event/core");
|
||||
const {ActorClass, Actor, FrontClass, Front, generateActorSpec} =
|
||||
const {ActorClassWithSpec, Actor, FrontClassWithSpec, Front, generateActorSpec} =
|
||||
require("devtools/shared/protocol");
|
||||
|
||||
const {NodeActor} = require("devtools/server/actors/inspector");
|
||||
|
@ -28,7 +28,7 @@ var eventsSpec = generateActorSpec({
|
|||
}
|
||||
});
|
||||
|
||||
var EventsFormActor = ActorClass(eventsSpec, {
|
||||
var EventsFormActor = ActorClassWithSpec(eventsSpec, {
|
||||
initialize: function () {
|
||||
Actor.prototype.initialize.apply(this, arguments);
|
||||
},
|
||||
|
@ -50,7 +50,7 @@ var EventsFormActor = ActorClass(eventsSpec, {
|
|||
}
|
||||
});
|
||||
|
||||
var EventsFormFront = FrontClass(eventsSpec, {
|
||||
var EventsFormFront = FrontClassWithSpec(eventsSpec, {
|
||||
initialize: function (client, form) {
|
||||
Front.prototype.initialize.apply(this, arguments);
|
||||
|
||||
|
|
|
@ -470,8 +470,8 @@ function createTestHTTPServer() {
|
|||
*
|
||||
* - moduleUrl {String}: URL of the module that contains actor implementation.
|
||||
* - prefix {String}: prefix of the actor.
|
||||
* - actorClass {ActorClass}: Constructor object for the actor.
|
||||
* - frontClass {FrontClass}: Constructor object for the front part
|
||||
* - actorClass {ActorClassWithSpec}: Constructor object for the actor.
|
||||
* - frontClass {FrontClassWithSpec}: Constructor object for the front part
|
||||
* of the registered actor.
|
||||
*
|
||||
* @returns {Promise} A promise that is resolved when the actor is registered.
|
||||
|
|
|
@ -146,6 +146,7 @@ skip-if = os == "mac" # Full keyboard navigation on OSX only works if Full Keybo
|
|||
[browser_inspector_search-08.js]
|
||||
[browser_inspector_search-filter_context-menu.js]
|
||||
[browser_inspector_search_keyboard_trap.js]
|
||||
[browser_inspector_search-label.js]
|
||||
[browser_inspector_search-reserved.js]
|
||||
[browser_inspector_search-selection.js]
|
||||
[browser_inspector_search-sidebar.js]
|
||||
|
|
|
@ -0,0 +1,33 @@
|
|||
/* 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";
|
||||
|
||||
// Check that search label updated correctcly based on the search result.
|
||||
|
||||
const TEST_URL = URL_ROOT + "doc_inspector_search.html";
|
||||
|
||||
add_task(function* () {
|
||||
let { inspector } = yield openInspectorForURL(TEST_URL);
|
||||
let { panelWin, searchResultsLabel } = inspector;
|
||||
|
||||
info("Searching for test node #d1");
|
||||
// Expect the label shows 1 result
|
||||
yield focusSearchBoxUsingShortcut(panelWin);
|
||||
synthesizeKeys("#d1", panelWin);
|
||||
EventUtils.synthesizeKey("VK_RETURN", {}, panelWin);
|
||||
|
||||
yield inspector.search.once("search-result");
|
||||
is(searchResultsLabel.textContent, "1 of 1");
|
||||
|
||||
info("Click the clear button");
|
||||
// Expect the label is cleared after clicking the clear button.
|
||||
|
||||
inspector.searchClearButton.click();
|
||||
is(searchResultsLabel.textContent, "");
|
||||
|
||||
// Catch-all event for remaining server requests when searching for the new
|
||||
// node.
|
||||
yield inspector.once("inspector-updated");
|
||||
});
|
|
@ -43,7 +43,11 @@ let App = createClass({
|
|||
},
|
||||
|
||||
onChangeViewportDevice(id, device) {
|
||||
this.props.dispatch(changeDevice(id, device));
|
||||
window.postMessage({
|
||||
type: "update-user-agent",
|
||||
userAgent: device.userAgent
|
||||
}, "*");
|
||||
this.props.dispatch(changeDevice(id, device.name));
|
||||
},
|
||||
|
||||
onContentResize({ width, height }) {
|
||||
|
|
|
@ -36,17 +36,15 @@ module.exports = createClass({
|
|||
onUpdateDeviceModalOpen(true);
|
||||
return;
|
||||
}
|
||||
|
||||
for (let type of devices.types) {
|
||||
for (let device of devices[type]) {
|
||||
if (device.name === target.value) {
|
||||
onResizeViewport(device.width, device.height);
|
||||
break;
|
||||
onChangeViewportDevice(device);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
onChangeViewportDevice(target.value);
|
||||
},
|
||||
|
||||
render() {
|
||||
|
|
|
@ -107,7 +107,7 @@ module.exports = createClass({
|
|||
// Update the viewport store with the new width and height.
|
||||
this.props.onResizeViewport(width, height);
|
||||
// Change the device selector back to an unselected device
|
||||
this.props.onChangeViewportDevice("");
|
||||
this.props.onChangeViewportDevice({ name: "" });
|
||||
|
||||
this.setState({
|
||||
lastClientX,
|
||||
|
|
|
@ -114,7 +114,7 @@ module.exports = createClass({
|
|||
}
|
||||
|
||||
// Change the device selector back to an unselected device
|
||||
this.props.onChangeViewportDevice("");
|
||||
this.props.onChangeViewportDevice({ name: "" });
|
||||
this.props.onResizeViewport(parseInt(this.state.width, 10),
|
||||
parseInt(this.state.height, 10));
|
||||
},
|
||||
|
|
|
@ -398,6 +398,10 @@ ResponsiveUI.prototype = {
|
|||
let { enabled } = event.data;
|
||||
this.updateTouchSimulation(enabled);
|
||||
break;
|
||||
case "update-user-agent":
|
||||
let { userAgent } = event.data;
|
||||
this.updateUserAgent(userAgent);
|
||||
break;
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -414,6 +418,14 @@ ResponsiveUI.prototype = {
|
|||
}
|
||||
}),
|
||||
|
||||
updateUserAgent: function (userAgent) {
|
||||
if (userAgent) {
|
||||
this.emulationFront.setUserAgentOverride(userAgent);
|
||||
} else {
|
||||
this.emulationFront.clearUserAgentOverride();
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Helper for tests. Assumes a single viewport for now.
|
||||
*/
|
||||
|
|
|
@ -15,6 +15,7 @@ support-files =
|
|||
!/devtools/client/shared/test/test-actor.js
|
||||
!/devtools/client/shared/test/test-actor-registry.js
|
||||
|
||||
[browser_device_change.js]
|
||||
[browser_device_modal_error.js]
|
||||
[browser_device_modal_exit.js]
|
||||
[browser_device_modal_submit.js]
|
||||
|
|
|
@ -0,0 +1,57 @@
|
|||
/* Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
"use strict";
|
||||
|
||||
// Tests changing viewport device
|
||||
const TEST_URL = "data:text/html;charset=utf-8,Device list test";
|
||||
const DEFAULT_UA = Cc["@mozilla.org/network/protocol;1?name=http"]
|
||||
.getService(Ci.nsIHttpProtocolHandler)
|
||||
.userAgent;
|
||||
const NOKIA_UA = "Mozilla/5.0 (compatible; MSIE 10.0; Windows Phone 8.0; " +
|
||||
"Trident/6.0; IEMobile/10.0; ARM; Touch; NOKIA; Lumia 520)";
|
||||
|
||||
addRDMTask(TEST_URL, function* ({ ui, manager }) {
|
||||
// Test defaults
|
||||
testViewportDimensions(ui, 320, 480);
|
||||
yield testUserAgent(ui, DEFAULT_UA);
|
||||
testViewportSelectLabel(ui, "no device selected");
|
||||
|
||||
// Test device with custom UA
|
||||
switchDevice(ui, "Nokia Lumia 520");
|
||||
yield waitForViewportResizeTo(ui, 320, 533);
|
||||
yield testUserAgent(ui, NOKIA_UA);
|
||||
|
||||
// Test resetting device when resizing viewport
|
||||
yield testViewportResize(ui, ".viewport-vertical-resize-handle",
|
||||
[-10, -10], [320, 523], [0, -10], ui);
|
||||
yield testUserAgent(ui, DEFAULT_UA);
|
||||
testViewportSelectLabel(ui, "no device selected");
|
||||
|
||||
// Test device where UA field is blank
|
||||
switchDevice(ui, "Laptop (1366 x 768)");
|
||||
yield waitForViewportResizeTo(ui, 1366, 768);
|
||||
yield testUserAgent(ui, DEFAULT_UA);
|
||||
});
|
||||
|
||||
function testViewportDimensions(ui, w, h) {
|
||||
let viewport = ui.toolWindow.document.querySelector(".viewport-content");
|
||||
|
||||
is(ui.toolWindow.getComputedStyle(viewport).getPropertyValue("width"),
|
||||
`${w}px`, `Viewport should have width of ${w}px`);
|
||||
is(ui.toolWindow.getComputedStyle(viewport).getPropertyValue("height"),
|
||||
`${h}px`, `Viewport should have height of ${h}px`);
|
||||
}
|
||||
|
||||
function testViewportSelectLabel(ui, label) {
|
||||
let select = ui.toolWindow.document.querySelector(".viewport-device-selector");
|
||||
is(select.selectedOptions[0].textContent, label,
|
||||
`Select label should be changed to ${label}`);
|
||||
}
|
||||
|
||||
function* testUserAgent(ui, value) {
|
||||
let ua = yield ContentTask.spawn(ui.getViewportBrowser(), {}, function* () {
|
||||
return content.navigator.userAgent;
|
||||
});
|
||||
is(ua, value, `UA should be set to ${value}`);
|
||||
}
|
|
@ -5,42 +5,6 @@ http://creativecommons.org/publicdomain/zero/1.0/ */
|
|||
|
||||
const TEST_URL = "data:text/html;charset=utf-8,";
|
||||
|
||||
function getElRect(selector, win) {
|
||||
let el = win.document.querySelector(selector);
|
||||
return el.getBoundingClientRect();
|
||||
}
|
||||
|
||||
/**
|
||||
* Drag an element identified by 'selector' by [x,y] amount. Returns
|
||||
* the rect of the dragged element as it was before drag.
|
||||
*/
|
||||
function dragElementBy(selector, x, y, win) {
|
||||
let rect = getElRect(selector, win);
|
||||
let startPoint = [ rect.left + rect.width / 2, rect.top + rect.height / 2 ];
|
||||
let endPoint = [ startPoint[0] + x, startPoint[1] + y ];
|
||||
|
||||
EventUtils.synthesizeMouseAtPoint(...startPoint, { type: "mousedown" }, win);
|
||||
EventUtils.synthesizeMouseAtPoint(...endPoint, { type: "mousemove" }, win);
|
||||
EventUtils.synthesizeMouseAtPoint(...endPoint, { type: "mouseup" }, win);
|
||||
|
||||
return rect;
|
||||
}
|
||||
|
||||
function* testViewportResize(ui, selector, moveBy,
|
||||
expectedViewportSize, expectedHandleMove) {
|
||||
let win = ui.toolWindow;
|
||||
|
||||
let resized = waitForViewportResizeTo(ui, ...expectedViewportSize);
|
||||
let startRect = dragElementBy(selector, ...moveBy, win);
|
||||
yield resized;
|
||||
|
||||
let endRect = getElRect(selector, win);
|
||||
is(endRect.left - startRect.left, expectedHandleMove[0],
|
||||
`The x move of ${selector} is as expected`);
|
||||
is(endRect.top - startRect.top, expectedHandleMove[1],
|
||||
`The y move of ${selector} is as expected`);
|
||||
}
|
||||
|
||||
addRDMTask(TEST_URL, function* ({ ui, manager }) {
|
||||
ok(ui, "An instance of the RDM should be attached to the tab.");
|
||||
yield setViewportSize(ui, manager, 300, 300);
|
||||
|
|
|
@ -147,6 +147,42 @@ var setViewportSize = Task.async(function* (ui, manager, width, height) {
|
|||
}
|
||||
});
|
||||
|
||||
function getElRect(selector, win) {
|
||||
let el = win.document.querySelector(selector);
|
||||
return el.getBoundingClientRect();
|
||||
}
|
||||
|
||||
/**
|
||||
* Drag an element identified by 'selector' by [x,y] amount. Returns
|
||||
* the rect of the dragged element as it was before drag.
|
||||
*/
|
||||
function dragElementBy(selector, x, y, win) {
|
||||
let rect = getElRect(selector, win);
|
||||
let startPoint = [ rect.left + rect.width / 2, rect.top + rect.height / 2 ];
|
||||
let endPoint = [ startPoint[0] + x, startPoint[1] + y ];
|
||||
|
||||
EventUtils.synthesizeMouseAtPoint(...startPoint, { type: "mousedown" }, win);
|
||||
EventUtils.synthesizeMouseAtPoint(...endPoint, { type: "mousemove" }, win);
|
||||
EventUtils.synthesizeMouseAtPoint(...endPoint, { type: "mouseup" }, win);
|
||||
|
||||
return rect;
|
||||
}
|
||||
|
||||
function* testViewportResize(ui, selector, moveBy,
|
||||
expectedViewportSize, expectedHandleMove) {
|
||||
let win = ui.toolWindow;
|
||||
|
||||
let resized = waitForViewportResizeTo(ui, ...expectedViewportSize);
|
||||
let startRect = dragElementBy(selector, ...moveBy, win);
|
||||
yield resized;
|
||||
|
||||
let endRect = getElRect(selector, win);
|
||||
is(endRect.left - startRect.left, expectedHandleMove[0],
|
||||
`The x move of ${selector} is as expected`);
|
||||
is(endRect.top - startRect.top, expectedHandleMove[1],
|
||||
`The y move of ${selector} is as expected`);
|
||||
}
|
||||
|
||||
function openDeviceModal(ui) {
|
||||
let { document } = ui.toolWindow;
|
||||
let select = document.querySelector(".viewport-device-selector");
|
||||
|
@ -169,6 +205,20 @@ function openDeviceModal(ui) {
|
|||
"The device modal is displayed.");
|
||||
}
|
||||
|
||||
function switchDevice(ui, device) {
|
||||
let { document } = ui.toolWindow;
|
||||
let select = document.querySelector(".viewport-device-selector");
|
||||
select.scrollIntoView();
|
||||
let deviceOption = [...select.options].filter(o => {
|
||||
return o.value === device;
|
||||
})[0];
|
||||
EventUtils.synthesizeMouseAtCenter(select, {type: "mousedown"},
|
||||
ui.toolWindow);
|
||||
EventUtils.synthesizeMouseAtCenter(deviceOption, {type: "mouseup"},
|
||||
ui.toolWindow);
|
||||
is(select.selectedOptions[0], deviceOption, "Device should be selected");
|
||||
}
|
||||
|
||||
function getSessionHistory(browser) {
|
||||
return ContentTask.spawn(browser, {}, function* () {
|
||||
/* eslint-disable no-undef */
|
||||
|
|
|
@ -19,6 +19,7 @@ var Services = require("Services");
|
|||
var EventEmitter = require("devtools/shared/event-emitter");
|
||||
var {ViewHelpers} = require("devtools/client/shared/widgets/view-helpers");
|
||||
var { LocalizationHelper } = require("devtools/client/shared/l10n");
|
||||
var { EmulationFront } = require("devtools/shared/fronts/emulation");
|
||||
|
||||
loader.lazyImporter(this, "SystemAppProxy",
|
||||
"resource://gre/modules/SystemAppProxy.jsm");
|
||||
|
@ -274,11 +275,8 @@ ResponsiveUI.prototype = {
|
|||
this.client = new DebuggerClient(DebuggerServer.connectPipe());
|
||||
yield this.client.connect();
|
||||
let {tab} = yield this.client.getTab();
|
||||
let [response, tabClient] = yield this.client.attachTab(tab.actor);
|
||||
this.tabClient = tabClient;
|
||||
if (!tabClient) {
|
||||
console.error(new Error("Responsive Mode: failed to attach tab"));
|
||||
}
|
||||
yield this.client.attachTab(tab.actor);
|
||||
this.emulationFront = EmulationFront(this.client, tab);
|
||||
}),
|
||||
|
||||
loadPresets: function () {
|
||||
|
@ -392,7 +390,7 @@ ResponsiveUI.prototype = {
|
|||
|
||||
yield new Promise((resolve, reject) => {
|
||||
this.client.close(resolve);
|
||||
this.client = this.tabClient = null;
|
||||
this.client = this.emulationFront = null;
|
||||
});
|
||||
|
||||
this._telemetry.toolClosed("responsive");
|
||||
|
@ -974,18 +972,19 @@ ResponsiveUI.prototype = {
|
|||
*/
|
||||
changeUA: Task.async(function* () {
|
||||
let value = this.userAgentInput.value;
|
||||
let changed;
|
||||
if (value) {
|
||||
changed = yield this.emulationFront.setUserAgentOverride(value);
|
||||
this.userAgentInput.setAttribute("attention", "true");
|
||||
} else {
|
||||
changed = yield this.emulationFront.clearUserAgentOverride();
|
||||
this.userAgentInput.removeAttribute("attention");
|
||||
}
|
||||
|
||||
// Changing the UA triggers an automatic reload. Ensure we wait for this to
|
||||
// complete before emitting the changed event, so that tests wait for the
|
||||
// reload.
|
||||
let reloaded = this.waitForReload();
|
||||
yield this.tabClient.reconfigure({customUserAgent: value});
|
||||
yield reloaded;
|
||||
if (changed) {
|
||||
let reloaded = this.waitForReload();
|
||||
this.tab.linkedBrowser.reload();
|
||||
yield reloaded;
|
||||
}
|
||||
ResponsiveUIManager.emit("userAgentChanged", { tab: this.tab });
|
||||
}),
|
||||
|
||||
|
|
|
@ -264,7 +264,7 @@ var testSpec = protocol.generateActorSpec({
|
|||
}
|
||||
});
|
||||
|
||||
var TestActor = exports.TestActor = protocol.ActorClass(testSpec, {
|
||||
var TestActor = exports.TestActor = protocol.ActorClassWithSpec(testSpec, {
|
||||
initialize: function (conn, tabActor, options) {
|
||||
this.conn = conn;
|
||||
this.tabActor = tabActor;
|
||||
|
@ -728,7 +728,7 @@ var TestActor = exports.TestActor = protocol.ActorClass(testSpec, {
|
|||
}
|
||||
});
|
||||
|
||||
var TestActorFront = exports.TestActorFront = protocol.FrontClass(testSpec, {
|
||||
var TestActorFront = exports.TestActorFront = protocol.FrontClassWithSpec(testSpec, {
|
||||
initialize: function (client, { testActor }, toolbox) {
|
||||
protocol.Front.prototype.initialize.call(this, client, { actor: testActor });
|
||||
this.manage(this);
|
||||
|
|
|
@ -117,7 +117,7 @@ VariablesView.prototype = {
|
|||
set rawObject(aObject) {
|
||||
this.empty();
|
||||
this.addScope()
|
||||
.addItem("", { enumerable: true })
|
||||
.addItem(undefined, { enumerable: true })
|
||||
.populate(aObject, { sorted: true });
|
||||
},
|
||||
|
||||
|
@ -561,7 +561,7 @@ VariablesView.prototype = {
|
|||
_doSearch: function (aToken) {
|
||||
if (this.controller && this.controller.supportsSearch()) {
|
||||
// Retrieve the main Scope in which we add attributes
|
||||
let scope = this._store[0]._store.get("");
|
||||
let scope = this._store[0]._store.get(undefined);
|
||||
if (!aToken) {
|
||||
// Prune the view from old previous content
|
||||
// so that we delete the intermediate search results
|
||||
|
@ -1113,7 +1113,7 @@ VariablesView.simpleValueEvalMacro = function (aItem, aCurrentString, aPrefix =
|
|||
* The string to be evaluated.
|
||||
*/
|
||||
VariablesView.overrideValueEvalMacro = function (aItem, aCurrentString, aPrefix = "") {
|
||||
let property = "\"" + aItem._nameString + "\"";
|
||||
let property = escapeString(aItem._nameString);
|
||||
let parent = aPrefix + aItem.ownerView.symbolicName || "this";
|
||||
|
||||
return "Object.defineProperty(" + parent + "," + property + "," +
|
||||
|
@ -1140,7 +1140,7 @@ VariablesView.getterOrSetterEvalMacro = function (aItem, aCurrentString, aPrefix
|
|||
let type = aItem._nameString;
|
||||
let propertyObject = aItem.ownerView;
|
||||
let parentObject = propertyObject.ownerView;
|
||||
let property = "\"" + propertyObject._nameString + "\"";
|
||||
let property = escapeString(propertyObject._nameString);
|
||||
let parent = aPrefix + parentObject.symbolicName || "this";
|
||||
|
||||
switch (aCurrentString) {
|
||||
|
@ -1325,7 +1325,7 @@ Scope.prototype = {
|
|||
* @return Variable
|
||||
* The newly created Variable instance, null if it already exists.
|
||||
*/
|
||||
addItem: function (aName = "", aDescriptor = {}, aOptions = {}) {
|
||||
addItem: function (aName, aDescriptor = {}, aOptions = {}) {
|
||||
let {relaxed} = aOptions;
|
||||
if (this._store.has(aName) && !relaxed) {
|
||||
return this._store.get(aName);
|
||||
|
@ -1335,7 +1335,7 @@ Scope.prototype = {
|
|||
this._store.set(aName, child);
|
||||
this._variablesView._itemsByElement.set(child._target, child);
|
||||
this._variablesView._currHierarchy.set(child.absoluteName, child);
|
||||
child.header = !!aName;
|
||||
child.header = aName !== undefined;
|
||||
|
||||
return child;
|
||||
},
|
||||
|
@ -1811,7 +1811,7 @@ Scope.prototype = {
|
|||
* @param string aTitleClassName [optional]
|
||||
* A custom class name for this scope's title element.
|
||||
*/
|
||||
_displayScope: function (aName, aTargetClassName, aTitleClassName = "") {
|
||||
_displayScope: function (aName = "", aTargetClassName, aTitleClassName = "") {
|
||||
let document = this.document;
|
||||
|
||||
let element = this._target = document.createElement("vbox");
|
||||
|
@ -2360,7 +2360,7 @@ Variable.prototype = Heritage.extend(Scope.prototype, {
|
|||
* @return string
|
||||
*/
|
||||
get symbolicName() {
|
||||
return this._nameString;
|
||||
return this._nameString || "";
|
||||
},
|
||||
|
||||
/**
|
||||
|
@ -2372,7 +2372,7 @@ Variable.prototype = Heritage.extend(Scope.prototype, {
|
|||
return this._absoluteName;
|
||||
}
|
||||
|
||||
this._absoluteName = this.ownerView._nameString + "[\"" + this._nameString + "\"]";
|
||||
this._absoluteName = this.ownerView._nameString + "[" + escapeString(this._nameString) + "]";
|
||||
return this._absoluteName;
|
||||
},
|
||||
|
||||
|
@ -2449,7 +2449,7 @@ Variable.prototype = Heritage.extend(Scope.prototype, {
|
|||
setGrip: function (aGrip) {
|
||||
// Don't allow displaying grip information if there's no name available
|
||||
// or the grip is malformed.
|
||||
if (!this._nameString || aGrip === undefined || aGrip === null) {
|
||||
if (this._nameString === undefined || aGrip === undefined || aGrip === null) {
|
||||
return;
|
||||
}
|
||||
// Getters and setters should display grip information in sub-properties.
|
||||
|
@ -3096,7 +3096,7 @@ Property.prototype = Heritage.extend(Variable.prototype, {
|
|||
return this._symbolicName;
|
||||
}
|
||||
|
||||
this._symbolicName = this.ownerView.symbolicName + "[\"" + this._nameString + "\"]";
|
||||
this._symbolicName = this.ownerView.symbolicName + "[" + escapeString(this._nameString) + "]";
|
||||
return this._symbolicName;
|
||||
},
|
||||
|
||||
|
@ -3109,7 +3109,7 @@ Property.prototype = Heritage.extend(Variable.prototype, {
|
|||
return this._absoluteName;
|
||||
}
|
||||
|
||||
this._absoluteName = this.ownerView.absoluteName + "[\"" + this._nameString + "\"]";
|
||||
this._absoluteName = this.ownerView.absoluteName + "[" + escapeString(this._nameString) + "]";
|
||||
return this._absoluteName;
|
||||
}
|
||||
});
|
||||
|
@ -3909,6 +3909,17 @@ var generateId = (function () {
|
|||
};
|
||||
})();
|
||||
|
||||
/**
|
||||
* Serialize a string to JSON. The result can be inserted in a string evaluated by `eval`.
|
||||
*
|
||||
* @param string aString
|
||||
* The string to be escaped. If undefined, the function returns the empty string.
|
||||
* @return string
|
||||
*/
|
||||
function escapeString(aString) {
|
||||
return JSON.stringify(aString) || "";
|
||||
}
|
||||
|
||||
/**
|
||||
* Escape some HTML special characters. We do not need full HTML serialization
|
||||
* here, we just want to make strings safe to display in HTML attributes, for
|
||||
|
|
|
@ -762,7 +762,7 @@ VariablesViewController.prototype = {
|
|||
scope.expanded = true; // Expand the scope by default.
|
||||
scope.locked = true; // Prevent collapsing the scope.
|
||||
|
||||
let variable = scope.addItem("", { enumerable: true });
|
||||
let variable = scope.addItem(undefined, { enumerable: true });
|
||||
let populated;
|
||||
|
||||
if (options.objectActor) {
|
||||
|
|
|
@ -25,7 +25,7 @@ add_task(function* () {
|
|||
|
||||
// The single variable view contains a scope with the variable name
|
||||
// and unnamed subitem that contains the properties
|
||||
let variable = view.getScopeAtIndex(0).get("");
|
||||
let variable = view.getScopeAtIndex(0).get(undefined);
|
||||
ok(variable, "variable object");
|
||||
|
||||
yield findVariableViewProperties(variable, [
|
||||
|
|
|
@ -17,7 +17,7 @@ const { actorActorSpec, actorRegistrySpec } = require("devtools/shared/specs/act
|
|||
* The ActorActor gives you a handle to an actor you've dynamically
|
||||
* registered and allows you to unregister it.
|
||||
*/
|
||||
const ActorActor = protocol.ActorClass(actorActorSpec, {
|
||||
const ActorActor = protocol.ActorClassWithSpec(actorActorSpec, {
|
||||
initialize: function (conn, options) {
|
||||
protocol.Actor.prototype.initialize.call(this, conn);
|
||||
|
||||
|
@ -33,7 +33,7 @@ const ActorActor = protocol.ActorClass(actorActorSpec, {
|
|||
* The ActorRegistryActor allows clients to define new actors on the
|
||||
* server. This is particularly useful for addons.
|
||||
*/
|
||||
const ActorRegistryActor = protocol.ActorClass(actorRegistrySpec, {
|
||||
const ActorRegistryActor = protocol.ActorClassWithSpec(actorRegistrySpec, {
|
||||
initialize: function (conn) {
|
||||
protocol.Actor.prototype.initialize.call(this, conn);
|
||||
},
|
||||
|
|
|
@ -10,7 +10,7 @@ const {FileUtils} = require("resource://gre/modules/FileUtils.jsm");
|
|||
const {Task} = require("devtools/shared/task");
|
||||
const {addonsSpec} = require("devtools/shared/specs/addons");
|
||||
|
||||
const AddonsActor = protocol.ActorClass(addonsSpec, {
|
||||
const AddonsActor = protocol.ActorClassWithSpec(addonsSpec, {
|
||||
|
||||
initialize: function (conn) {
|
||||
protocol.Actor.prototype.initialize.call(this, conn);
|
||||
|
|
|
@ -29,7 +29,7 @@ const {Cu} = require("chrome");
|
|||
const promise = require("promise");
|
||||
const {Task} = require("devtools/shared/task");
|
||||
const protocol = require("devtools/shared/protocol");
|
||||
const {Actor, ActorClass} = protocol;
|
||||
const {Actor, ActorClassWithSpec} = protocol;
|
||||
const {animationPlayerSpec, animationsSpec} = require("devtools/shared/specs/animation");
|
||||
const events = require("sdk/event/core");
|
||||
|
||||
|
@ -51,7 +51,7 @@ exports.ANIMATION_TYPES = ANIMATION_TYPES;
|
|||
*
|
||||
* This actor also allows playing, pausing and seeking the animation.
|
||||
*/
|
||||
var AnimationPlayerActor = protocol.ActorClass(animationPlayerSpec, {
|
||||
var AnimationPlayerActor = protocol.ActorClassWithSpec(animationPlayerSpec, {
|
||||
/**
|
||||
* @param {AnimationsActor} The main AnimationsActor instance
|
||||
* @param {AnimationPlayer} The player object returned by getAnimationPlayers
|
||||
|
@ -433,7 +433,7 @@ exports.AnimationPlayerActor = AnimationPlayerActor;
|
|||
/**
|
||||
* The Animations actor lists animation players for a given node.
|
||||
*/
|
||||
var AnimationsActor = exports.AnimationsActor = protocol.ActorClass(animationsSpec, {
|
||||
var AnimationsActor = exports.AnimationsActor = protocol.ActorClassWithSpec(animationsSpec, {
|
||||
initialize: function(conn, tabActor) {
|
||||
Actor.prototype.initialize.call(this, conn);
|
||||
this.tabActor = tabActor;
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
const { ActorClass } = require("devtools/shared/protocol");
|
||||
const { ActorClassWithSpec } = require("devtools/shared/protocol");
|
||||
const { breakpointSpec } = require("devtools/shared/specs/breakpoint");
|
||||
|
||||
/**
|
||||
|
@ -34,7 +34,7 @@ exports.setBreakpointAtEntryPoints = setBreakpointAtEntryPoints;
|
|||
* responsible for deleting breakpoints, handling breakpoint hits and
|
||||
* associating breakpoints with scripts.
|
||||
*/
|
||||
let BreakpointActor = ActorClass(breakpointSpec, {
|
||||
let BreakpointActor = ActorClassWithSpec(breakpointSpec, {
|
||||
/**
|
||||
* Create a Breakpoint actor.
|
||||
*
|
||||
|
|
|
@ -18,7 +18,7 @@ const { CallWatcherFront } = require("devtools/shared/fronts/call-watcher");
|
|||
* This actor contains information about a function call, like the function
|
||||
* type, name, stack, arguments, returned value etc.
|
||||
*/
|
||||
var FunctionCallActor = protocol.ActorClass(functionCallSpec, {
|
||||
var FunctionCallActor = protocol.ActorClassWithSpec(functionCallSpec, {
|
||||
/**
|
||||
* Creates the function call actor.
|
||||
*
|
||||
|
@ -226,7 +226,7 @@ var FunctionCallActor = protocol.ActorClass(functionCallSpec, {
|
|||
/**
|
||||
* This actor observes function calls on certain objects or globals.
|
||||
*/
|
||||
var CallWatcherActor = exports.CallWatcherActor = protocol.ActorClass(callWatcherSpec, {
|
||||
var CallWatcherActor = exports.CallWatcherActor = protocol.ActorClassWithSpec(callWatcherSpec, {
|
||||
initialize: function (conn, tabActor) {
|
||||
protocol.Actor.prototype.initialize.call(this, conn);
|
||||
this.tabActor = tabActor;
|
||||
|
|
|
@ -30,7 +30,7 @@ const {method, custom, Arg, Option, RetVal} = protocol;
|
|||
* all the corresponding canvas' context methods invoked in that frame,
|
||||
* thumbnails for each draw call and a screenshot of the end result.
|
||||
*/
|
||||
var FrameSnapshotActor = protocol.ActorClass(frameSnapshotSpec, {
|
||||
var FrameSnapshotActor = protocol.ActorClassWithSpec(frameSnapshotSpec, {
|
||||
/**
|
||||
* Creates the frame snapshot call actor.
|
||||
*
|
||||
|
@ -120,7 +120,7 @@ var FrameSnapshotActor = protocol.ActorClass(frameSnapshotSpec, {
|
|||
* of a 2D or WebGL context, to provide information regarding all the calls
|
||||
* made when drawing frame inside an animation loop.
|
||||
*/
|
||||
var CanvasActor = exports.CanvasActor = protocol.ActorClass(canvasSpec, {
|
||||
var CanvasActor = exports.CanvasActor = protocol.ActorClassWithSpec(canvasSpec, {
|
||||
// Reset for each recording, boolean indicating whether or not
|
||||
// any draw calls were called for a recording.
|
||||
_animationContainsDrawCall: false,
|
||||
|
|
|
@ -511,7 +511,7 @@ exports.actorBridge = actorBridge;
|
|||
|
||||
/**
|
||||
* Like `actorBridge`, but without a spec definition, for when the actor is
|
||||
* created with `ActorClass` rather than vanilla `ActorClass`.
|
||||
* created with `ActorClassWithSpec` rather than vanilla `ActorClass`.
|
||||
*/
|
||||
function actorBridgeWithSpec (methodName) {
|
||||
return method(function () {
|
||||
|
|
|
@ -15,12 +15,12 @@ loader.lazyGetter(this, "appInfo", () => {
|
|||
});
|
||||
|
||||
const protocol = require("devtools/shared/protocol");
|
||||
const { ActorClass, Actor } = protocol;
|
||||
const { ActorClassWithSpec, Actor } = protocol;
|
||||
const { cssPropertiesSpec } = require("devtools/shared/specs/css-properties");
|
||||
const { CSS_PROPERTIES, CSS_TYPES } = require("devtools/shared/css-properties-db");
|
||||
const { cssColors } = require("devtools/shared/css-color-db");
|
||||
|
||||
exports.CssPropertiesActor = ActorClass(cssPropertiesSpec, {
|
||||
exports.CssPropertiesActor = ActorClassWithSpec(cssPropertiesSpec, {
|
||||
typeName: "cssProperties",
|
||||
|
||||
initialize(conn, parent) {
|
||||
|
|
|
@ -67,7 +67,7 @@ const l10n = exports.l10n = {
|
|||
* }, ...
|
||||
* });
|
||||
*/
|
||||
var CSSUsageActor = protocol.ActorClass(cssUsageSpec, {
|
||||
var CSSUsageActor = protocol.ActorClassWithSpec(cssUsageSpec, {
|
||||
initialize: function (conn, tabActor) {
|
||||
protocol.Actor.prototype.initialize.call(this, conn);
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@ const {deviceSpec} = require("devtools/shared/specs/device");
|
|||
const FileReader = require("FileReader");
|
||||
const {PermissionsTable} = require("resource://gre/modules/PermissionsTable.jsm");
|
||||
|
||||
var DeviceActor = exports.DeviceActor = protocol.ActorClass(deviceSpec, {
|
||||
var DeviceActor = exports.DeviceActor = protocol.ActorClassWithSpec(deviceSpec, {
|
||||
_desc: null,
|
||||
|
||||
getDescription: function () {
|
||||
|
|
|
@ -38,7 +38,7 @@ const ERR_DIRECTOR_UNINSTALLED_SCRIPTID = "uninstalled director-script id";
|
|||
* A MessagePort Actor allowing communication through messageport events
|
||||
* over the remote debugging protocol.
|
||||
*/
|
||||
var MessagePortActor = exports.MessagePortActor = protocol.ActorClass(messagePortSpec, {
|
||||
var MessagePortActor = exports.MessagePortActor = protocol.ActorClassWithSpec(messagePortSpec, {
|
||||
/**
|
||||
* Create a MessagePort actor.
|
||||
*
|
||||
|
@ -149,7 +149,7 @@ var MessagePortActor = exports.MessagePortActor = protocol.ActorClass(messagePor
|
|||
* directly connect the debugger client and the content script using a MessageChannel) on tab
|
||||
* navigation.
|
||||
*/
|
||||
var DirectorScriptActor = exports.DirectorScriptActor = protocol.ActorClass(directorScriptSpec, {
|
||||
var DirectorScriptActor = exports.DirectorScriptActor = protocol.ActorClassWithSpec(directorScriptSpec, {
|
||||
/**
|
||||
* Creates the director script actor
|
||||
*
|
||||
|
@ -337,7 +337,7 @@ var DirectorScriptActor = exports.DirectorScriptActor = protocol.ActorClass(dire
|
|||
/**
|
||||
* The DirectorManager Actor is a tab actor which manages enabling/disabling director scripts.
|
||||
*/
|
||||
const DirectorManagerActor = exports.DirectorManagerActor = protocol.ActorClass(directorManagerSpec, {
|
||||
const DirectorManagerActor = exports.DirectorManagerActor = protocol.ActorClassWithSpec(directorManagerSpec, {
|
||||
/* init & destroy methods */
|
||||
initialize: function (conn, tabActor) {
|
||||
protocol.Actor.prototype.initialize.call(this, conn);
|
||||
|
|
|
@ -148,7 +148,7 @@ exports.setupParentProcess = function setupParentProcess({ mm, prefix }) {
|
|||
* The DirectorRegistry Actor is a global actor which manages install/uninstall of
|
||||
* director scripts definitions.
|
||||
*/
|
||||
const DirectorRegistryActor = exports.DirectorRegistryActor = protocol.ActorClass(directorRegistrySpec, {
|
||||
const DirectorRegistryActor = exports.DirectorRegistryActor = protocol.ActorClassWithSpec(directorRegistrySpec, {
|
||||
/* init & destroy methods */
|
||||
initialize: function (conn, parentActor) {
|
||||
protocol.Actor.prototype.initialize.call(this, conn);
|
||||
|
|
|
@ -9,13 +9,15 @@ const protocol = require("devtools/shared/protocol");
|
|||
const { emulationSpec } = require("devtools/shared/specs/emulation");
|
||||
const { SimulatorCore } = require("devtools/shared/touch/simulator-core");
|
||||
|
||||
let EmulationActor = protocol.ActorClass(emulationSpec, {
|
||||
let EmulationActor = protocol.ActorClassWithSpec(emulationSpec, {
|
||||
initialize(conn, tabActor) {
|
||||
protocol.Actor.prototype.initialize.call(this, conn);
|
||||
this.docShell = tabActor.docShell;
|
||||
this.simulatorCore = new SimulatorCore(tabActor.chromeEventHandler);
|
||||
},
|
||||
|
||||
/* Touch events override */
|
||||
|
||||
_previousTouchEventsOverride: null,
|
||||
|
||||
setTouchEventsOverride(flag) {
|
||||
|
@ -43,8 +45,35 @@ let EmulationActor = protocol.ActorClass(emulationSpec, {
|
|||
|
||||
clearTouchEventsOverride() {
|
||||
if (this._previousTouchEventsOverride !== null) {
|
||||
this.setTouchEventsOverride(this._previousTouchEventsOverride);
|
||||
return this.setTouchEventsOverride(this._previousTouchEventsOverride);
|
||||
}
|
||||
return false;
|
||||
},
|
||||
|
||||
/* User agent override */
|
||||
|
||||
_previousUserAgentOverride: null,
|
||||
|
||||
setUserAgentOverride(userAgent) {
|
||||
if (this.docShell.customUserAgent == userAgent) {
|
||||
return false;
|
||||
}
|
||||
if (this._previousUserAgentOverride === null) {
|
||||
this._previousUserAgentOverride = this.docShell.customUserAgent;
|
||||
}
|
||||
this.docShell.customUserAgent = userAgent;
|
||||
return true;
|
||||
},
|
||||
|
||||
getUserAgentOverride() {
|
||||
return this.docShell.customUserAgent;
|
||||
},
|
||||
|
||||
clearUserAgentOverride() {
|
||||
if (this._previousUserAgentOverride !== null) {
|
||||
return this.setUserAgentOverride(this._previousUserAgentOverride);
|
||||
}
|
||||
return false;
|
||||
},
|
||||
|
||||
disconnect() {
|
||||
|
@ -53,6 +82,7 @@ let EmulationActor = protocol.ActorClass(emulationSpec, {
|
|||
|
||||
destroy() {
|
||||
this.clearTouchEventsOverride();
|
||||
this.clearUserAgentOverride();
|
||||
this.docShell = null;
|
||||
this.simulatorCore = null;
|
||||
protocol.Actor.prototype.destroy.call(this);
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
"use strict";
|
||||
|
||||
const { ActorClass } = require("devtools/shared/protocol");
|
||||
const { ActorClassWithSpec } = require("devtools/shared/protocol");
|
||||
const { createValueGrip } = require("devtools/server/actors/object");
|
||||
const { environmentSpec } = require("devtools/shared/specs/environment");
|
||||
|
||||
|
@ -19,7 +19,7 @@ const { environmentSpec } = require("devtools/shared/specs/environment");
|
|||
* @param ThreadActor aThreadActor
|
||||
* The parent thread actor that contains this environment.
|
||||
*/
|
||||
let EnvironmentActor = ActorClass(environmentSpec, {
|
||||
let EnvironmentActor = ActorClassWithSpec(environmentSpec, {
|
||||
initialize: function (environment, threadActor) {
|
||||
this.obj = environment;
|
||||
this.threadActor = threadActor;
|
||||
|
|
|
@ -13,11 +13,11 @@
|
|||
const {Ci} = require("chrome");
|
||||
const Services = require("Services");
|
||||
const {XPCOMUtils} = require("resource://gre/modules/XPCOMUtils.jsm");
|
||||
const {Actor, ActorClass} = require("devtools/shared/protocol");
|
||||
const {Actor, ActorClassWithSpec} = require("devtools/shared/protocol");
|
||||
const events = require("sdk/event/core");
|
||||
const {eventLoopLagSpec} = require("devtools/shared/specs/eventlooplag");
|
||||
|
||||
var EventLoopLagActor = exports.EventLoopLagActor = ActorClass(eventLoopLagSpec, {
|
||||
var EventLoopLagActor = exports.EventLoopLagActor = ActorClassWithSpec(eventLoopLagSpec, {
|
||||
_observerAdded: false,
|
||||
|
||||
/**
|
||||
|
|
|
@ -8,13 +8,13 @@
|
|||
|
||||
const { ActorPool } = require("devtools/server/actors/common");
|
||||
const { createValueGrip } = require("devtools/server/actors/object");
|
||||
const { ActorClass } = require("devtools/shared/protocol");
|
||||
const { ActorClassWithSpec } = require("devtools/shared/protocol");
|
||||
const { frameSpec } = require("devtools/shared/specs/frame");
|
||||
|
||||
/**
|
||||
* An actor for a specified stack frame.
|
||||
*/
|
||||
let FrameActor = ActorClass(frameSpec, {
|
||||
let FrameActor = ActorClassWithSpec(frameSpec, {
|
||||
/**
|
||||
* Creates the Frame actor.
|
||||
*
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
"use strict";
|
||||
|
||||
const { Actor, ActorClass } = require("devtools/shared/protocol");
|
||||
const { Actor, ActorClassWithSpec } = require("devtools/shared/protocol");
|
||||
const { actorBridgeWithSpec } = require("devtools/server/actors/common");
|
||||
const { on, once, off, emit } = require("sdk/event/core");
|
||||
const { Framerate } = require("devtools/server/performance/framerate");
|
||||
|
@ -15,7 +15,7 @@ const { framerateSpec } = require("devtools/shared/specs/framerate");
|
|||
*
|
||||
* @see devtools/server/performance/framerate.js for documentation.
|
||||
*/
|
||||
var FramerateActor = exports.FramerateActor = ActorClass(framerateSpec, {
|
||||
var FramerateActor = exports.FramerateActor = ActorClassWithSpec(framerateSpec, {
|
||||
initialize: function (conn, tabActor) {
|
||||
Actor.prototype.initialize.call(this, conn);
|
||||
this.bridge = new Framerate(tabActor);
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
const { Task } = require("devtools/shared/task");
|
||||
const {
|
||||
method, Arg, Option, RetVal, Actor, ActorClass
|
||||
method, Arg, Option, RetVal, Actor, ActorClassWithSpec
|
||||
} = require("devtools/shared/protocol");
|
||||
const { gcliSpec } = require("devtools/shared/specs/gcli");
|
||||
const events = require("sdk/event/core");
|
||||
|
@ -15,7 +15,7 @@ const { createSystem } = require("gcli/system");
|
|||
/**
|
||||
* Manage remote connections that want to talk to GCLI
|
||||
*/
|
||||
const GcliActor = ActorClass(gcliSpec, {
|
||||
const GcliActor = ActorClassWithSpec(gcliSpec, {
|
||||
initialize: function (conn, tabActor) {
|
||||
Actor.prototype.initialize.call(this, conn);
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@ loader.lazyRequireGetter(this, "HeapSnapshotFileUtils",
|
|||
* because child processes are sandboxed and do not have access to the file
|
||||
* system.
|
||||
*/
|
||||
exports.HeapSnapshotFileActor = protocol.ActorClass(heapSnapshotFileSpec, {
|
||||
exports.HeapSnapshotFileActor = protocol.ActorClassWithSpec(heapSnapshotFileSpec, {
|
||||
initialize: function (conn, parent) {
|
||||
if (Services.appinfo.processType !== Services.appinfo.PROCESS_TYPE_DEFAULT) {
|
||||
const err = new Error("Attempt to create a HeapSnapshotFileActor in a " +
|
||||
|
|
|
@ -82,7 +82,7 @@ exports.register = register;
|
|||
/**
|
||||
* The HighlighterActor class
|
||||
*/
|
||||
var HighlighterActor = exports.HighlighterActor = protocol.ActorClass(highlighterSpec, {
|
||||
var HighlighterActor = exports.HighlighterActor = protocol.ActorClassWithSpec(highlighterSpec, {
|
||||
initialize: function (inspector, autohide) {
|
||||
protocol.Actor.prototype.initialize.call(this, null);
|
||||
|
||||
|
@ -407,7 +407,7 @@ var HighlighterActor = exports.HighlighterActor = protocol.ActorClass(highlighte
|
|||
* A generic highlighter actor class that instantiate a highlighter given its
|
||||
* type name and allows to show/hide it.
|
||||
*/
|
||||
var CustomHighlighterActor = exports.CustomHighlighterActor = protocol.ActorClass(customHighlighterSpec, {
|
||||
var CustomHighlighterActor = exports.CustomHighlighterActor = protocol.ActorClassWithSpec(customHighlighterSpec, {
|
||||
/**
|
||||
* Create a highlighter instance given its typename
|
||||
* The typename must be one of HIGHLIGHTER_CLASSES and the class must
|
||||
|
|
|
@ -143,7 +143,7 @@ CssGridHighlighter.prototype = extend(AutoRefreshHighlighter.prototype, {
|
|||
},
|
||||
|
||||
clearCanvas() {
|
||||
let ratio = this.win.devicePixelRatio || 1;
|
||||
let ratio = parseFloat((this.win.devicePixelRatio || 1).toFixed(2));
|
||||
let width = this.win.innerWidth;
|
||||
let height = this.win.innerHeight;
|
||||
|
||||
|
|
|
@ -197,7 +197,7 @@ exports.getNodeDisplayName = getNodeDisplayName;
|
|||
/**
|
||||
* Server side of the node actor.
|
||||
*/
|
||||
var NodeActor = exports.NodeActor = protocol.ActorClass(nodeSpec, {
|
||||
var NodeActor = exports.NodeActor = protocol.ActorClassWithSpec(nodeSpec, {
|
||||
initialize: function (walker, node) {
|
||||
protocol.Actor.prototype.initialize.call(this, null);
|
||||
this.walker = walker;
|
||||
|
@ -708,7 +708,7 @@ var NodeActor = exports.NodeActor = protocol.ActorClass(nodeSpec, {
|
|||
/**
|
||||
* Server side of a node list as returned by querySelectorAll()
|
||||
*/
|
||||
var NodeListActor = exports.NodeListActor = protocol.ActorClass(nodeListSpec, {
|
||||
var NodeListActor = exports.NodeListActor = protocol.ActorClassWithSpec(nodeListSpec, {
|
||||
typeName: "domnodelist",
|
||||
|
||||
initialize: function (walker, nodeList) {
|
||||
|
@ -766,7 +766,7 @@ var NodeListActor = exports.NodeListActor = protocol.ActorClass(nodeListSpec, {
|
|||
/**
|
||||
* Server side of the DOM walker.
|
||||
*/
|
||||
var WalkerActor = protocol.ActorClass(walkerSpec, {
|
||||
var WalkerActor = protocol.ActorClassWithSpec(walkerSpec, {
|
||||
/**
|
||||
* Create the WalkerActor
|
||||
* @param DebuggerServerConnection conn
|
||||
|
@ -2578,7 +2578,7 @@ var WalkerActor = protocol.ActorClass(walkerSpec, {
|
|||
* Server side of the inspector actor, which is used to create
|
||||
* inspector-related actors, including the walker.
|
||||
*/
|
||||
exports.InspectorActor = protocol.ActorClass(inspectorSpec, {
|
||||
exports.InspectorActor = protocol.ActorClassWithSpec(inspectorSpec, {
|
||||
initialize: function (conn, tabActor) {
|
||||
protocol.Actor.prototype.initialize.call(this, conn);
|
||||
this.tabActor = tabActor;
|
||||
|
|
|
@ -36,7 +36,7 @@ const {reflowSpec} = require("devtools/shared/specs/layout");
|
|||
/**
|
||||
* The reflow actor tracks reflows and emits events about them.
|
||||
*/
|
||||
var ReflowActor = exports.ReflowActor = protocol.ActorClass(reflowSpec, {
|
||||
var ReflowActor = exports.ReflowActor = protocol.ActorClassWithSpec(reflowSpec, {
|
||||
initialize: function (conn, tabActor) {
|
||||
protocol.Actor.prototype.initialize.call(this, conn);
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@ loader.lazyRequireGetter(this, "StackFrameCache",
|
|||
*
|
||||
* @see devtools/server/performance/memory.js for documentation.
|
||||
*/
|
||||
exports.MemoryActor = protocol.ActorClass(memorySpec, {
|
||||
exports.MemoryActor = protocol.ActorClassWithSpec(memorySpec, {
|
||||
initialize: function (conn, parent, frameCache = new StackFrameCache()) {
|
||||
protocol.Actor.prototype.initialize.call(this, conn);
|
||||
|
||||
|
|
|
@ -9,11 +9,11 @@
|
|||
* epoch of the performance entry.
|
||||
*/
|
||||
|
||||
const { Actor, ActorClass } = require("devtools/shared/protocol");
|
||||
const { Actor, ActorClassWithSpec } = require("devtools/shared/protocol");
|
||||
const performanceSpec = require("devtools/shared/specs/performance-entries");
|
||||
const events = require("sdk/event/core");
|
||||
|
||||
var PerformanceEntriesActor = ActorClass(performanceSpec, {
|
||||
var PerformanceEntriesActor = ActorClassWithSpec(performanceSpec, {
|
||||
listenerAdded: false,
|
||||
|
||||
initialize: function (conn, tabActor) {
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
"use strict";
|
||||
|
||||
const { Cu } = require("chrome");
|
||||
const { Actor, ActorClass } = require("devtools/shared/protocol");
|
||||
const { Actor, ActorClassWithSpec } = require("devtools/shared/protocol");
|
||||
const { performanceRecordingSpec } = require("devtools/shared/specs/performance-recording");
|
||||
|
||||
loader.lazyRequireGetter(this, "merge", "sdk/util/object", true);
|
||||
|
@ -20,7 +20,7 @@ loader.lazyRequireGetter(this, "PerformanceRecordingCommon",
|
|||
*
|
||||
* @see devtools/shared/shared/performance.js for documentation.
|
||||
*/
|
||||
const PerformanceRecordingActor = ActorClass(performanceRecordingSpec, merge({
|
||||
const PerformanceRecordingActor = ActorClassWithSpec(performanceRecordingSpec, merge({
|
||||
form: function (detail) {
|
||||
if (detail === "actorid") {
|
||||
return this.actorID;
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
const { Cu } = require("chrome");
|
||||
const { Task } = require("devtools/shared/task");
|
||||
const { Actor, ActorClass } = require("devtools/shared/protocol");
|
||||
const { Actor, ActorClassWithSpec } = require("devtools/shared/protocol");
|
||||
const { actorBridgeWithSpec } = require("devtools/server/actors/common");
|
||||
const { performanceSpec } = require("devtools/shared/specs/performance");
|
||||
|
||||
|
@ -33,7 +33,7 @@ const RECORDING_STATE_CHANGE_EVENTS = new Set([
|
|||
*
|
||||
* @see devtools/shared/shared/performance.js for documentation.
|
||||
*/
|
||||
var PerformanceActor = ActorClass(performanceSpec, {
|
||||
var PerformanceActor = ActorClassWithSpec(performanceSpec, {
|
||||
traits: {
|
||||
features: {
|
||||
withMarkers: true,
|
||||
|
|
|
@ -15,7 +15,7 @@ exports.register = function (handle) {
|
|||
exports.unregister = function (handle) {
|
||||
};
|
||||
|
||||
var PreferenceActor = exports.PreferenceActor = protocol.ActorClass(preferenceSpec, {
|
||||
var PreferenceActor = exports.PreferenceActor = protocol.ActorClassWithSpec(preferenceSpec, {
|
||||
typeName: "preference",
|
||||
|
||||
getBoolPref: function (name) {
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
"use strict";
|
||||
|
||||
const { Actor, ActorClass } = require("devtools/shared/protocol");
|
||||
const { Actor, ActorClassWithSpec } = require("devtools/shared/protocol");
|
||||
const { Profiler } = require("devtools/server/performance/profiler");
|
||||
const { actorBridgeWithSpec } = require("devtools/server/actors/common");
|
||||
const { profilerSpec } = require("devtools/shared/specs/profiler");
|
||||
|
@ -16,7 +16,7 @@ loader.lazyRequireGetter(this, "events", "sdk/event/core");
|
|||
*
|
||||
* @see devtools/server/performance/profiler.js for documentation.
|
||||
*/
|
||||
var ProfilerActor = exports.ProfilerActor = ActorClass(profilerSpec, {
|
||||
var ProfilerActor = exports.ProfilerActor = ActorClassWithSpec(profilerSpec, {
|
||||
initialize: function (conn) {
|
||||
Actor.prototype.initialize.call(this, conn);
|
||||
this._onProfilerEvent = this._onProfilerEvent.bind(this);
|
||||
|
|
|
@ -15,7 +15,7 @@ loader.lazyRequireGetter(this, "events", "sdk/event/core");
|
|||
* The Promises Actor provides support for getting the list of live promises and
|
||||
* observing changes to their settlement state.
|
||||
*/
|
||||
var PromisesActor = protocol.ActorClass(promisesSpec, {
|
||||
var PromisesActor = protocol.ActorClassWithSpec(promisesSpec, {
|
||||
/**
|
||||
* @param conn DebuggerServerConnection.
|
||||
* @param parent TabActor|RootActor
|
||||
|
|
|
@ -15,7 +15,7 @@ const { FrameActor } = require("devtools/server/actors/frame");
|
|||
const { ObjectActor, createValueGrip, longStringGrip } = require("devtools/server/actors/object");
|
||||
const { SourceActor, getSourceURL } = require("devtools/server/actors/source");
|
||||
const { DebuggerServer } = require("devtools/server/main");
|
||||
const { ActorClass } = require("devtools/shared/protocol");
|
||||
const { ActorClassWithSpec } = require("devtools/shared/protocol");
|
||||
const DevToolsUtils = require("devtools/shared/DevToolsUtils");
|
||||
const flags = require("devtools/shared/flags");
|
||||
const { assert, dumpn, update, fetch } = DevToolsUtils;
|
||||
|
@ -408,7 +408,7 @@ EventLoop.prototype = {
|
|||
* An optional (for content debugging only) reference to the content
|
||||
* window.
|
||||
*/
|
||||
const ThreadActor = ActorClass(threadSpec, {
|
||||
const ThreadActor = ActorClassWithSpec(threadSpec, {
|
||||
initialize: function (aParent, aGlobal) {
|
||||
this._state = "detached";
|
||||
this._frameActors = [];
|
||||
|
|
|
@ -64,7 +64,7 @@ function loadSettingsFile() {
|
|||
}
|
||||
}
|
||||
|
||||
var SettingsActor = exports.SettingsActor = protocol.ActorClass(settingsSpec, {
|
||||
var SettingsActor = exports.SettingsActor = protocol.ActorClassWithSpec(settingsSpec, {
|
||||
_getSettingsService: function () {
|
||||
let win = Services.wm.getMostRecentWindow(DebuggerServer.chromeWindowType);
|
||||
return win.navigator.mozSettings;
|
||||
|
|
|
@ -11,7 +11,7 @@ const Services = require("Services");
|
|||
const { BreakpointActor, setBreakpointAtEntryPoints } = require("devtools/server/actors/breakpoint");
|
||||
const { OriginalLocation, GeneratedLocation } = require("devtools/server/actors/common");
|
||||
const { createValueGrip } = require("devtools/server/actors/object");
|
||||
const { ActorClass, Arg, RetVal, method } = require("devtools/shared/protocol");
|
||||
const { ActorClassWithSpec, Arg, RetVal, method } = require("devtools/shared/protocol");
|
||||
const DevToolsUtils = require("devtools/shared/DevToolsUtils");
|
||||
const { assert, fetch } = DevToolsUtils;
|
||||
const { joinURI } = require("devtools/shared/path");
|
||||
|
@ -141,7 +141,7 @@ function resolveURIToLocalPath(aURI) {
|
|||
* @param String contentType
|
||||
* Optional. The content type of this source, if immediately available.
|
||||
*/
|
||||
let SourceActor = ActorClass(sourceSpec, {
|
||||
let SourceActor = ActorClassWithSpec(sourceSpec, {
|
||||
typeName: "source",
|
||||
|
||||
initialize: function ({ source, thread, originalUrl, generatedSource,
|
||||
|
|
|
@ -377,7 +377,7 @@ StorageActors.createActor = function (options = {}, overrides = {}) {
|
|||
}
|
||||
|
||||
let actorSpec = specs.childSpecs[options.typeName];
|
||||
let actor = protocol.ActorClass(actorSpec, actorObject);
|
||||
let actor = protocol.ActorClassWithSpec(actorSpec, actorObject);
|
||||
storageTypePool.set(actorObject.typeName, actor);
|
||||
};
|
||||
|
||||
|
@ -2162,7 +2162,7 @@ exports.setupParentProcessForIndexedDB = function ({ mm, prefix }) {
|
|||
/**
|
||||
* The main Storage Actor.
|
||||
*/
|
||||
let StorageActor = protocol.ActorClass(specs.storageSpec, {
|
||||
let StorageActor = protocol.ActorClassWithSpec(specs.storageSpec, {
|
||||
typeName: "storage",
|
||||
|
||||
get window() {
|
||||
|
|
|
@ -11,7 +11,7 @@ var promise = require("promise");
|
|||
var protocol = require("devtools/shared/protocol");
|
||||
const {longStringSpec} = require("devtools/shared/specs/string");
|
||||
|
||||
exports.LongStringActor = protocol.ActorClass(longStringSpec, {
|
||||
exports.LongStringActor = protocol.ActorClassWithSpec(longStringSpec, {
|
||||
initialize: function (conn, str) {
|
||||
protocol.Actor.prototype.initialize.call(this, conn);
|
||||
this.str = str;
|
||||
|
|
|
@ -28,7 +28,7 @@ transition-property: all !important;\
|
|||
|
||||
var LOAD_ERROR = "error-load";
|
||||
|
||||
var OldStyleSheetActor = protocol.ActorClass(oldStyleSheetSpec, {
|
||||
var OldStyleSheetActor = protocol.ActorClassWithSpec(oldStyleSheetSpec, {
|
||||
toString: function() {
|
||||
return "[OldStyleSheetActor " + this.actorID + "]";
|
||||
},
|
||||
|
@ -321,7 +321,7 @@ exports.OldStyleSheetActor = OldStyleSheetActor;
|
|||
* Creates a StyleEditorActor. StyleEditorActor provides remote access to the
|
||||
* stylesheets of a document.
|
||||
*/
|
||||
var StyleEditorActor = exports.StyleEditorActor = protocol.ActorClass(styleEditorSpec, {
|
||||
var StyleEditorActor = exports.StyleEditorActor = protocol.ActorClassWithSpec(styleEditorSpec, {
|
||||
/**
|
||||
* The window we work with, taken from the parent actor.
|
||||
*/
|
||||
|
|
|
@ -39,7 +39,7 @@ const FONT_PREVIEW_OFFSET = 4;
|
|||
* The PageStyle actor lets the client look at the styles on a page, as
|
||||
* they are applied to a given node.
|
||||
*/
|
||||
var PageStyleActor = protocol.ActorClass(pageStyleSpec, {
|
||||
var PageStyleActor = protocol.ActorClassWithSpec(pageStyleSpec, {
|
||||
/**
|
||||
* Create a PageStyleActor.
|
||||
*
|
||||
|
@ -925,7 +925,7 @@ exports.PageStyleActor = PageStyleActor;
|
|||
* (which have a CSSStyle but no CSSRule) we create a StyleRuleActor
|
||||
* with a special rule type (100).
|
||||
*/
|
||||
var StyleRuleActor = protocol.ActorClass(styleRuleSpec, {
|
||||
var StyleRuleActor = protocol.ActorClassWithSpec(styleRuleSpec, {
|
||||
initialize: function (pageStyle, item) {
|
||||
protocol.Actor.prototype.initialize.call(this, null);
|
||||
this.pageStyle = pageStyle;
|
||||
|
|
|
@ -60,7 +60,7 @@ let modifiedStyleSheets = new WeakMap();
|
|||
* Actor representing an original source of a style sheet that was specified
|
||||
* in a source map.
|
||||
*/
|
||||
var OriginalSourceActor = protocol.ActorClass(originalSourceSpec, {
|
||||
var OriginalSourceActor = protocol.ActorClassWithSpec(originalSourceSpec, {
|
||||
initialize: function (aUrl, aSourceMap, aParentActor) {
|
||||
protocol.Actor.prototype.initialize.call(this, null);
|
||||
|
||||
|
@ -113,7 +113,7 @@ var OriginalSourceActor = protocol.ActorClass(originalSourceSpec, {
|
|||
* A MediaRuleActor lives on the server and provides access to properties
|
||||
* of a DOM @media rule and emits events when it changes.
|
||||
*/
|
||||
var MediaRuleActor = protocol.ActorClass(mediaRuleSpec, {
|
||||
var MediaRuleActor = protocol.ActorClassWithSpec(mediaRuleSpec, {
|
||||
get window() {
|
||||
return this.parentActor.window;
|
||||
},
|
||||
|
@ -183,7 +183,7 @@ var MediaRuleActor = protocol.ActorClass(mediaRuleSpec, {
|
|||
/**
|
||||
* A StyleSheetActor represents a stylesheet on the server.
|
||||
*/
|
||||
var StyleSheetActor = protocol.ActorClass(styleSheetSpec, {
|
||||
var StyleSheetActor = protocol.ActorClassWithSpec(styleSheetSpec, {
|
||||
/* List of original sources that generated this stylesheet */
|
||||
_originalSources: null,
|
||||
|
||||
|
@ -786,7 +786,7 @@ exports.StyleSheetActor = StyleSheetActor;
|
|||
* Creates a StyleSheetsActor. StyleSheetsActor provides remote access to the
|
||||
* stylesheets of a document.
|
||||
*/
|
||||
var StyleSheetsActor = protocol.ActorClass(styleSheetsSpec, {
|
||||
var StyleSheetsActor = protocol.ActorClassWithSpec(styleSheetsSpec, {
|
||||
/**
|
||||
* The window we work with, taken from the parent actor.
|
||||
*/
|
||||
|
|
|
@ -26,7 +26,7 @@ const events = require("sdk/event/core");
|
|||
/**
|
||||
* The timeline actor pops and forwards timeline markers registered in docshells.
|
||||
*/
|
||||
var TimelineActor = exports.TimelineActor = protocol.ActorClass(timelineSpec, {
|
||||
var TimelineActor = exports.TimelineActor = protocol.ActorClassWithSpec(timelineSpec, {
|
||||
/**
|
||||
* Initializes this actor with the provided connection and tab actor.
|
||||
*/
|
||||
|
|
|
@ -38,7 +38,7 @@ const AUDIO_GLOBALS = [
|
|||
* An Audio Node actor allowing communication to a specific audio node in the
|
||||
* Audio Context graph.
|
||||
*/
|
||||
var AudioNodeActor = exports.AudioNodeActor = protocol.ActorClass(audionodeSpec, {
|
||||
var AudioNodeActor = exports.AudioNodeActor = protocol.ActorClassWithSpec(audionodeSpec, {
|
||||
form: function (detail) {
|
||||
if (detail === "actorid") {
|
||||
return this.actorID;
|
||||
|
@ -404,7 +404,7 @@ var AudioNodeActor = exports.AudioNodeActor = protocol.ActorClass(audionodeSpec,
|
|||
* high-level methods. After instantiating this actor, you'll need to set it
|
||||
* up by calling setup().
|
||||
*/
|
||||
var WebAudioActor = exports.WebAudioActor = protocol.ActorClass(webAudioSpec, {
|
||||
var WebAudioActor = exports.WebAudioActor = protocol.ActorClassWithSpec(webAudioSpec, {
|
||||
initialize: function (conn, tabActor) {
|
||||
protocol.Actor.prototype.initialize.call(this, conn);
|
||||
this.tabActor = tabActor;
|
||||
|
|
|
@ -1677,12 +1677,6 @@ TabActor.prototype = {
|
|||
);
|
||||
}
|
||||
|
||||
if ((typeof options.customUserAgent !== "undefined") &&
|
||||
options.customUserAgent !== this._getCustomUserAgent()) {
|
||||
this._setCustomUserAgent(options.customUserAgent);
|
||||
reload = true;
|
||||
}
|
||||
|
||||
// Reload if:
|
||||
// - there's an explicit `performReload` flag and it's true
|
||||
// - there's no `performReload` flag, but it makes sense to do so
|
||||
|
@ -1701,7 +1695,6 @@ TabActor.prototype = {
|
|||
this._restoreJavascript();
|
||||
this._setCacheDisabled(false);
|
||||
this._setServiceWorkersTestingEnabled(false);
|
||||
this._restoreUserAgent();
|
||||
},
|
||||
|
||||
/**
|
||||
|
@ -1785,38 +1778,6 @@ TabActor.prototype = {
|
|||
return windowUtils.serviceWorkersTestingEnabled;
|
||||
},
|
||||
|
||||
_previousCustomUserAgent: null,
|
||||
|
||||
/**
|
||||
* Return custom user agent.
|
||||
*/
|
||||
_getCustomUserAgent() {
|
||||
if (!this.docShell) {
|
||||
// The tab is already closed.
|
||||
return null;
|
||||
}
|
||||
return this.docShell.customUserAgent;
|
||||
},
|
||||
|
||||
/**
|
||||
* Sets custom user agent for the current tab
|
||||
*/
|
||||
_setCustomUserAgent(userAgent) {
|
||||
if (this._previousCustomUserAgent === null) {
|
||||
this._previousCustomUserAgent = this.docShell.customUserAgent;
|
||||
}
|
||||
this.docShell.customUserAgent = userAgent;
|
||||
},
|
||||
|
||||
/**
|
||||
* Restore the user agent, before the actor modified it
|
||||
*/
|
||||
_restoreUserAgent() {
|
||||
if (this._previousCustomUserAgent !== null) {
|
||||
this.docShell.customUserAgent = this._previousCustomUserAgent;
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Prepare to enter a nested event loop by disabling debuggee events.
|
||||
*/
|
||||
|
|
|
@ -28,7 +28,7 @@ const PROGRAM_HIGHLIGHT_TRAIT = 2;
|
|||
* You can either retrieve, or compile the source of a shader, which will
|
||||
* automatically inflict the necessary changes to the WebGL state.
|
||||
*/
|
||||
var ShaderActor = protocol.ActorClass(shaderSpec, {
|
||||
var ShaderActor = protocol.ActorClassWithSpec(shaderSpec, {
|
||||
/**
|
||||
* Create the shader actor.
|
||||
*
|
||||
|
@ -83,7 +83,7 @@ var ShaderActor = protocol.ActorClass(shaderSpec, {
|
|||
* A WebGL program is composed (at the moment, analogue to OpenGL ES 2.0)
|
||||
* of two shaders: a vertex shader and a fragment shader.
|
||||
*/
|
||||
var ProgramActor = protocol.ActorClass(programSpec, {
|
||||
var ProgramActor = protocol.ActorClassWithSpec(programSpec, {
|
||||
/**
|
||||
* Create the program actor.
|
||||
*
|
||||
|
@ -184,7 +184,7 @@ var ProgramActor = protocol.ActorClass(programSpec, {
|
|||
* high-level methods. After instantiating this actor, you'll need to set it
|
||||
* up by calling setup().
|
||||
*/
|
||||
var WebGLActor = exports.WebGLActor = protocol.ActorClass(webGLSpec, {
|
||||
var WebGLActor = exports.WebGLActor = protocol.ActorClassWithSpec(webGLSpec, {
|
||||
initialize: function (conn, tabActor) {
|
||||
protocol.Actor.prototype.initialize.call(this, conn);
|
||||
this.tabActor = tabActor;
|
||||
|
|
|
@ -55,7 +55,7 @@ function matchWorkerDebugger(dbg, options) {
|
|||
return true;
|
||||
}
|
||||
|
||||
let WorkerActor = protocol.ActorClass(workerSpec, {
|
||||
let WorkerActor = protocol.ActorClassWithSpec(workerSpec, {
|
||||
initialize(conn, dbg) {
|
||||
protocol.Actor.prototype.initialize.call(this, conn);
|
||||
this._dbg = dbg;
|
||||
|
@ -313,7 +313,7 @@ WorkerActorList.prototype = {
|
|||
|
||||
exports.WorkerActorList = WorkerActorList;
|
||||
|
||||
let PushSubscriptionActor = protocol.ActorClass(pushSubscriptionSpec, {
|
||||
let PushSubscriptionActor = protocol.ActorClassWithSpec(pushSubscriptionSpec, {
|
||||
initialize(conn, subscription) {
|
||||
protocol.Actor.prototype.initialize.call(this, conn);
|
||||
this._subscription = subscription;
|
||||
|
@ -343,7 +343,7 @@ let PushSubscriptionActor = protocol.ActorClass(pushSubscriptionSpec, {
|
|||
let _serviceWorkerProcessScriptLoaded = false;
|
||||
|
||||
let ServiceWorkerRegistrationActor =
|
||||
protocol.ActorClass(serviceWorkerRegistrationSpec, {
|
||||
protocol.ActorClassWithSpec(serviceWorkerRegistrationSpec, {
|
||||
/**
|
||||
* Create the ServiceWorkerRegistrationActor
|
||||
* @param DebuggerServerConnection conn
|
||||
|
|
|
@ -14,7 +14,7 @@ const helloSpec = protocol.generateActorSpec({
|
|||
}
|
||||
});
|
||||
|
||||
var HelloActor = protocol.ActorClass(helloSpec, {
|
||||
var HelloActor = protocol.ActorClassWithSpec(helloSpec, {
|
||||
initialize: function () {
|
||||
protocol.Actor.prototype.initialize.apply(this, arguments);
|
||||
this.counter = 0;
|
||||
|
|
|
@ -11,7 +11,7 @@ const helloSpec = protocol.generateActorSpec({
|
|||
}
|
||||
});
|
||||
|
||||
var HelloActor = protocol.ActorClass(helloSpec, {
|
||||
var HelloActor = protocol.ActorClassWithSpec(helloSpec, {
|
||||
hello: function () {
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/* Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
var {method, RetVal, Actor, ActorClass, Front, FrontClass,
|
||||
var {method, RetVal, Actor, ActorClassWithSpec, Front, FrontClassWithSpec,
|
||||
generateActorSpec} = require("devtools/shared/protocol");
|
||||
var Services = require("Services");
|
||||
|
||||
|
@ -15,7 +15,7 @@ const lazySpec = generateActorSpec({
|
|||
}
|
||||
});
|
||||
|
||||
exports.LazyActor = ActorClass(lazySpec, {
|
||||
exports.LazyActor = ActorClassWithSpec(lazySpec, {
|
||||
initialize: function (conn, id) {
|
||||
Actor.prototype.initialize.call(this, conn);
|
||||
|
||||
|
@ -29,7 +29,7 @@ exports.LazyActor = ActorClass(lazySpec, {
|
|||
|
||||
Services.obs.notifyObservers(null, "actor", "loaded");
|
||||
|
||||
exports.LazyFront = FrontClass(lazySpec, {
|
||||
exports.LazyFront = FrontClassWithSpec(lazySpec, {
|
||||
initialize: function (client, form) {
|
||||
Front.prototype.initialize.call(this, client);
|
||||
this.actorID = form.lazyActor;
|
||||
|
|
|
@ -28,7 +28,7 @@ const rootSpec = protocol.generateActorSpec({
|
|||
}
|
||||
});
|
||||
|
||||
var RootActor = protocol.ActorClass(rootSpec, {
|
||||
var RootActor = protocol.ActorClassWithSpec(rootSpec, {
|
||||
typeName: "root",
|
||||
initialize: function (conn) {
|
||||
protocol.Actor.prototype.initialize.call(this, conn);
|
||||
|
@ -45,7 +45,7 @@ var RootActor = protocol.ActorClass(rootSpec, {
|
|||
}
|
||||
});
|
||||
|
||||
var RootFront = protocol.FrontClass(rootSpec, {
|
||||
var RootFront = protocol.FrontClassWithSpec(rootSpec, {
|
||||
initialize: function (client) {
|
||||
this.actorID = "root";
|
||||
protocol.Front.prototype.initialize.call(this, client);
|
||||
|
|
|
@ -39,7 +39,7 @@ const rootSpec = protocol.generateActorSpec({
|
|||
}
|
||||
});
|
||||
|
||||
var RootActor = protocol.ActorClass(rootSpec, {
|
||||
var RootActor = protocol.ActorClassWithSpec(rootSpec, {
|
||||
initialize: function (conn) {
|
||||
protocol.Actor.prototype.initialize.call(this, conn);
|
||||
// Root actor owns itself.
|
||||
|
@ -89,7 +89,7 @@ var RootActor = protocol.ActorClass(rootSpec, {
|
|||
}
|
||||
});
|
||||
|
||||
var RootFront = protocol.FrontClass(rootSpec, {
|
||||
var RootFront = protocol.FrontClassWithSpec(rootSpec, {
|
||||
initialize: function (client) {
|
||||
this.actorID = "root";
|
||||
protocol.Front.prototype.initialize.call(this, client);
|
||||
|
|
|
@ -88,7 +88,7 @@ const childSpec = protocol.generateActorSpec({
|
|||
}
|
||||
});
|
||||
|
||||
var ChildActor = protocol.ActorClass(childSpec, {
|
||||
var ChildActor = protocol.ActorClassWithSpec(childSpec, {
|
||||
// Actors returned by this actor should be owned by the root actor.
|
||||
marshallPool: function () { return this.parent(); },
|
||||
|
||||
|
@ -156,7 +156,7 @@ var ChildActor = protocol.ActorClass(childSpec, {
|
|||
release: function () { },
|
||||
});
|
||||
|
||||
var ChildFront = protocol.FrontClass(childSpec, {
|
||||
var ChildFront = protocol.FrontClassWithSpec(childSpec, {
|
||||
initialize: function (client, form) {
|
||||
protocol.Front.prototype.initialize.call(this, client, form);
|
||||
},
|
||||
|
@ -226,7 +226,7 @@ const rootSpec = protocol.generateActorSpec({
|
|||
});
|
||||
|
||||
var rootActor = null;
|
||||
var RootActor = protocol.ActorClass(rootSpec, {
|
||||
var RootActor = protocol.ActorClassWithSpec(rootSpec, {
|
||||
toString: function () { return "[root actor]"; },
|
||||
|
||||
initialize: function (conn) {
|
||||
|
@ -287,7 +287,7 @@ var RootActor = protocol.ActorClass(rootSpec, {
|
|||
}
|
||||
});
|
||||
|
||||
var RootFront = protocol.FrontClass(rootSpec, {
|
||||
var RootFront = protocol.FrontClassWithSpec(rootSpec, {
|
||||
toString: function () { return "[root front]"; },
|
||||
initialize: function (client) {
|
||||
this.actorID = "root";
|
||||
|
|
|
@ -15,7 +15,7 @@ const childSpec = protocol.generateActorSpec({
|
|||
});
|
||||
|
||||
// The child actor doesn't provide a form description
|
||||
var ChildActor = protocol.ActorClass(childSpec, {
|
||||
var ChildActor = protocol.ActorClassWithSpec(childSpec, {
|
||||
initialize(conn) {
|
||||
protocol.Actor.prototype.initialize.call(this, conn);
|
||||
},
|
||||
|
@ -32,7 +32,7 @@ var ChildActor = protocol.ActorClass(childSpec, {
|
|||
}
|
||||
});
|
||||
|
||||
var ChildFront = protocol.FrontClass(childSpec, {
|
||||
var ChildFront = protocol.FrontClassWithSpec(childSpec, {
|
||||
initialize(client) {
|
||||
protocol.Front.prototype.initialize.call(this, client);
|
||||
},
|
||||
|
@ -77,7 +77,7 @@ const rootSpec = protocol.generateActorSpec({
|
|||
});
|
||||
|
||||
// The root actor does provide a form description.
|
||||
var RootActor = protocol.ActorClass(rootSpec, {
|
||||
var RootActor = protocol.ActorClassWithSpec(rootSpec, {
|
||||
initialize(conn) {
|
||||
protocol.Actor.prototype.initialize.call(this, conn);
|
||||
this.manage(this);
|
||||
|
@ -125,7 +125,7 @@ var RootActor = protocol.ActorClass(rootSpec, {
|
|||
}
|
||||
});
|
||||
|
||||
var RootFront = protocol.FrontClass(rootSpec, {
|
||||
var RootFront = protocol.FrontClassWithSpec(rootSpec, {
|
||||
initialize(client) {
|
||||
this.actorID = "root";
|
||||
protocol.Front.prototype.initialize.call(this, client);
|
||||
|
|
|
@ -52,7 +52,7 @@ const rootSpec = protocol.generateActorSpec({
|
|||
}
|
||||
});
|
||||
|
||||
var RootActor = protocol.ActorClass(rootSpec, {
|
||||
var RootActor = protocol.ActorClassWithSpec(rootSpec, {
|
||||
initialize: function (conn) {
|
||||
rootActor = this;
|
||||
protocol.Actor.prototype.initialize.call(this, conn);
|
||||
|
@ -80,7 +80,7 @@ var RootActor = protocol.ActorClass(rootSpec, {
|
|||
},
|
||||
});
|
||||
|
||||
var RootFront = protocol.FrontClass(rootSpec, {
|
||||
var RootFront = protocol.FrontClassWithSpec(rootSpec, {
|
||||
initialize: function (client) {
|
||||
this.actorID = "root";
|
||||
protocol.Front.prototype.initialize.call(this, client);
|
||||
|
|
|
@ -101,7 +101,7 @@ const rootSpec = protocol.generateActorSpec({
|
|||
}
|
||||
});
|
||||
|
||||
var RootActor = protocol.ActorClass(rootSpec, {
|
||||
var RootActor = protocol.ActorClassWithSpec(rootSpec, {
|
||||
initialize: function (conn) {
|
||||
protocol.Actor.prototype.initialize.call(this, conn);
|
||||
// Root actor owns itself.
|
||||
|
@ -164,7 +164,7 @@ var RootActor = protocol.ActorClass(rootSpec, {
|
|||
}
|
||||
});
|
||||
|
||||
var RootFront = protocol.FrontClass(rootSpec, {
|
||||
var RootFront = protocol.FrontClassWithSpec(rootSpec, {
|
||||
initialize: function (client) {
|
||||
this.actorID = "root";
|
||||
protocol.Front.prototype.initialize.call(this, client);
|
||||
|
@ -181,7 +181,7 @@ function run_test()
|
|||
DebuggerServer.init();
|
||||
|
||||
check_except(() => {
|
||||
let badActor = ActorClass({}, {
|
||||
let badActor = ActorClassWithSpec({}, {
|
||||
missing: preEvent("missing-event", function () {
|
||||
})
|
||||
});
|
||||
|
|
|
@ -32,7 +32,7 @@ const rootSpec = protocol.generateActorSpec({
|
|||
}
|
||||
});
|
||||
|
||||
var RootActor = protocol.ActorClass(rootSpec, {
|
||||
var RootActor = protocol.ActorClassWithSpec(rootSpec, {
|
||||
initialize: function (conn) {
|
||||
protocol.Actor.prototype.initialize.call(this, conn);
|
||||
// Root actor owns itself.
|
||||
|
@ -48,7 +48,7 @@ var RootActor = protocol.ActorClass(rootSpec, {
|
|||
}
|
||||
});
|
||||
|
||||
var RootFront = protocol.FrontClass(rootSpec, {
|
||||
var RootFront = protocol.FrontClassWithSpec(rootSpec, {
|
||||
initialize: function (client) {
|
||||
this.actorID = "root";
|
||||
protocol.Front.prototype.initialize.call(this, client);
|
||||
|
|
|
@ -11,7 +11,7 @@ const { custom } = protocol;
|
|||
|
||||
loader.lazyImporter(this, "NetUtil", "resource://gre/modules/NetUtil.jsm");
|
||||
|
||||
const ActorActorFront = protocol.FrontClass(actorActorSpec, {
|
||||
const ActorActorFront = protocol.FrontClassWithSpec(actorActorSpec, {
|
||||
initialize: function (client, form) {
|
||||
protocol.Front.prototype.initialize.call(this, client, form);
|
||||
}
|
||||
|
@ -46,7 +46,7 @@ function request(uri) {
|
|||
});
|
||||
}
|
||||
|
||||
const ActorRegistryFront = protocol.FrontClass(actorRegistrySpec, {
|
||||
const ActorRegistryFront = protocol.FrontClassWithSpec(actorRegistrySpec, {
|
||||
initialize: function (client, form) {
|
||||
protocol.Front.prototype.initialize.call(this, client,
|
||||
{ actor: form.actorRegistryActor });
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
const {addonsSpec} = require("devtools/shared/specs/addons");
|
||||
const protocol = require("devtools/shared/protocol");
|
||||
|
||||
const AddonsFront = protocol.FrontClass(addonsSpec, {
|
||||
const AddonsFront = protocol.FrontClassWithSpec(addonsSpec, {
|
||||
initialize: function (client, {addonsActor}) {
|
||||
protocol.Front.prototype.initialize.call(this, client);
|
||||
this.actorID = addonsActor;
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
const {
|
||||
Front,
|
||||
FrontClass,
|
||||
FrontClassWithSpec,
|
||||
custom,
|
||||
preEvent
|
||||
} = require("devtools/shared/protocol");
|
||||
|
@ -15,7 +15,7 @@ const {
|
|||
} = require("devtools/shared/specs/animation");
|
||||
const { Task } = require("devtools/shared/task");
|
||||
|
||||
const AnimationPlayerFront = FrontClass(animationPlayerSpec, {
|
||||
const AnimationPlayerFront = FrontClassWithSpec(animationPlayerSpec, {
|
||||
initialize: function (conn, form, detail, ctx) {
|
||||
Front.prototype.initialize.call(this, conn, form, detail, ctx);
|
||||
|
||||
|
@ -123,7 +123,7 @@ const AnimationPlayerFront = FrontClass(animationPlayerSpec, {
|
|||
|
||||
exports.AnimationPlayerFront = AnimationPlayerFront;
|
||||
|
||||
const AnimationsFront = FrontClass(animationsSpec, {
|
||||
const AnimationsFront = FrontClassWithSpec(animationsSpec, {
|
||||
initialize: function (client, {animationsActor}) {
|
||||
Front.prototype.initialize.call(this, client, {actor: animationsActor});
|
||||
this.manage(this);
|
||||
|
|
|
@ -9,7 +9,7 @@ const protocol = require("devtools/shared/protocol");
|
|||
/**
|
||||
* The corresponding Front object for the FunctionCallActor.
|
||||
*/
|
||||
const FunctionCallFront = protocol.FrontClass(functionCallSpec, {
|
||||
const FunctionCallFront = protocol.FrontClassWithSpec(functionCallSpec, {
|
||||
initialize: function (client, form) {
|
||||
protocol.Front.prototype.initialize.call(this, client, form);
|
||||
},
|
||||
|
@ -38,7 +38,7 @@ exports.FunctionCallFront = FunctionCallFront;
|
|||
*/
|
||||
var CallWatcherFront =
|
||||
exports.CallWatcherFront =
|
||||
protocol.FrontClass(callWatcherSpec, {
|
||||
protocol.FrontClassWithSpec(callWatcherSpec, {
|
||||
initialize: function (client, { callWatcherActor }) {
|
||||
protocol.Front.prototype.initialize.call(this, client, { actor: callWatcherActor });
|
||||
this.manage(this);
|
||||
|
|
|
@ -18,7 +18,7 @@ const promise = require("promise");
|
|||
/**
|
||||
* The corresponding Front object for the FrameSnapshotActor.
|
||||
*/
|
||||
const FrameSnapshotFront = protocol.FrontClass(frameSnapshotSpec, {
|
||||
const FrameSnapshotFront = protocol.FrontClassWithSpec(frameSnapshotSpec, {
|
||||
initialize: function (client, form) {
|
||||
protocol.Front.prototype.initialize.call(this, client, form);
|
||||
this._animationFrameEndScreenshot = null;
|
||||
|
@ -64,7 +64,7 @@ exports.FrameSnapshotFront = FrameSnapshotFront;
|
|||
/**
|
||||
* The corresponding Front object for the CanvasActor.
|
||||
*/
|
||||
const CanvasFront = protocol.FrontClass(canvasSpec, {
|
||||
const CanvasFront = protocol.FrontClassWithSpec(canvasSpec, {
|
||||
initialize: function (client, { canvasActor }) {
|
||||
protocol.Front.prototype.initialize.call(this, client, { actor: canvasActor });
|
||||
this.manage(this);
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
"use strict";
|
||||
|
||||
const { FrontClass, Front } = require("devtools/shared/protocol");
|
||||
const { FrontClassWithSpec, Front } = require("devtools/shared/protocol");
|
||||
const { cssPropertiesSpec } = require("devtools/shared/specs/css-properties");
|
||||
const { Task } = require("devtools/shared/task");
|
||||
const { CSS_PROPERTIES_DB } = require("devtools/shared/css-properties-db");
|
||||
|
@ -39,7 +39,7 @@ var cachedCssProperties = new WeakMap();
|
|||
* interface that provides synchronous methods for finding out what CSS
|
||||
* properties the current server supports.
|
||||
*/
|
||||
const CssPropertiesFront = FrontClass(cssPropertiesSpec, {
|
||||
const CssPropertiesFront = FrontClassWithSpec(cssPropertiesSpec, {
|
||||
initialize: function (client, { cssPropertiesActor }) {
|
||||
Front.prototype.initialize.call(this, client, {actor: cssPropertiesActor});
|
||||
this.manage(this);
|
||||
|
|
|
@ -36,7 +36,7 @@ var chromeWindow;
|
|||
/**
|
||||
* Front for CSSUsageActor
|
||||
*/
|
||||
const CSSUsageFront = protocol.FrontClass(cssUsageSpec, {
|
||||
const CSSUsageFront = protocol.FrontClassWithSpec(cssUsageSpec, {
|
||||
initialize: function (client, form) {
|
||||
protocol.Front.prototype.initialize.call(this, client, form);
|
||||
this.actorID = form.cssUsageActor;
|
||||
|
|
|
@ -8,7 +8,7 @@ const {deviceSpec} = require("devtools/shared/specs/device");
|
|||
const protocol = require("devtools/shared/protocol");
|
||||
const defer = require("devtools/shared/defer");
|
||||
|
||||
const DeviceFront = protocol.FrontClass(deviceSpec, {
|
||||
const DeviceFront = protocol.FrontClassWithSpec(deviceSpec, {
|
||||
initialize: function (client, form) {
|
||||
protocol.Front.prototype.initialize.call(this, client);
|
||||
this.actorID = form.deviceActor;
|
||||
|
|
|
@ -13,7 +13,7 @@ const protocol = require("devtools/shared/protocol");
|
|||
/**
|
||||
* The corresponding Front object for the MessagePortActor.
|
||||
*/
|
||||
const MessagePortFront = protocol.FrontClass(messagePortSpec, {
|
||||
const MessagePortFront = protocol.FrontClassWithSpec(messagePortSpec, {
|
||||
initialize: function (client, form) {
|
||||
protocol.Front.prototype.initialize.call(this, client, form);
|
||||
}
|
||||
|
@ -24,7 +24,7 @@ exports.MessagePortFront = MessagePortFront;
|
|||
/**
|
||||
* The corresponding Front object for the DirectorScriptActor.
|
||||
*/
|
||||
const DirectorScriptFront = protocol.FrontClass(directorScriptSpec, {
|
||||
const DirectorScriptFront = protocol.FrontClassWithSpec(directorScriptSpec, {
|
||||
initialize: function (client, form) {
|
||||
protocol.Front.prototype.initialize.call(this, client, form);
|
||||
}
|
||||
|
@ -35,7 +35,7 @@ exports.DirectorScriptFront = DirectorScriptFront;
|
|||
/**
|
||||
* The corresponding Front object for the DirectorManagerActor.
|
||||
*/
|
||||
const DirectorManagerFront = protocol.FrontClass(directorManagerSpec, {
|
||||
const DirectorManagerFront = protocol.FrontClassWithSpec(directorManagerSpec, {
|
||||
initialize: function (client, { directorManagerActor }) {
|
||||
protocol.Front.prototype.initialize.call(this, client, {
|
||||
actor: directorManagerActor
|
||||
|
|
|
@ -9,7 +9,7 @@ const protocol = require("devtools/shared/protocol");
|
|||
/**
|
||||
* The corresponding Front object for the DirectorRegistryActor.
|
||||
*/
|
||||
const DirectorRegistryFront = protocol.FrontClass(directorRegistrySpec, {
|
||||
const DirectorRegistryFront = protocol.FrontClassWithSpec(directorRegistrySpec, {
|
||||
initialize: function (client, { directorRegistryActor }) {
|
||||
protocol.Front.prototype.initialize.call(this, client, {
|
||||
actor: directorRegistryActor
|
||||
|
|
|
@ -3,13 +3,13 @@
|
|||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
"use strict";
|
||||
|
||||
const { Front, FrontClass } = require("devtools/shared/protocol");
|
||||
const { Front, FrontClassWithSpec } = require("devtools/shared/protocol");
|
||||
const { emulationSpec } = require("devtools/shared/specs/emulation");
|
||||
|
||||
/**
|
||||
* The corresponding Front object for the EmulationActor.
|
||||
*/
|
||||
const EmulationFront = FrontClass(emulationSpec, {
|
||||
const EmulationFront = FrontClassWithSpec(emulationSpec, {
|
||||
initialize: function (client, form) {
|
||||
Front.prototype.initialize.call(this, client);
|
||||
this.actorID = form.emulationActor;
|
||||
|
|
|
@ -3,10 +3,10 @@
|
|||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
"use strict";
|
||||
|
||||
const { Front, FrontClass } = require("devtools/shared/protocol");
|
||||
const { Front, FrontClassWithSpec } = require("devtools/shared/protocol");
|
||||
const { eventLoopLagSpec } = require("devtools/shared/specs/eventlooplag");
|
||||
|
||||
exports.EventLoopLagFront = FrontClass(eventLoopLagSpec, {
|
||||
exports.EventLoopLagFront = FrontClassWithSpec(eventLoopLagSpec, {
|
||||
initialize: function (client, form) {
|
||||
Front.prototype.initialize.call(this, client);
|
||||
this.actorID = form.eventLoopLagActor;
|
||||
|
|
|
@ -3,13 +3,13 @@
|
|||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
"use strict";
|
||||
|
||||
const { Front, FrontClass } = require("devtools/shared/protocol");
|
||||
const { Front, FrontClassWithSpec } = require("devtools/shared/protocol");
|
||||
const { framerateSpec } = require("devtools/shared/specs/framerate");
|
||||
|
||||
/**
|
||||
* The corresponding Front object for the FramerateActor.
|
||||
*/
|
||||
var FramerateFront = exports.FramerateFront = FrontClass(framerateSpec, {
|
||||
var FramerateFront = exports.FramerateFront = FrontClassWithSpec(framerateSpec, {
|
||||
initialize: function (client, { framerateActor }) {
|
||||
Front.prototype.initialize.call(this, client, { actor: framerateActor });
|
||||
this.manage(this);
|
||||
|
|
|
@ -3,13 +3,13 @@
|
|||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
"use strict";
|
||||
|
||||
const { Front, FrontClass } = require("devtools/shared/protocol");
|
||||
const { Front, FrontClassWithSpec } = require("devtools/shared/protocol");
|
||||
const { gcliSpec } = require("devtools/shared/specs/gcli");
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
const GcliFront = exports.GcliFront = FrontClass(gcliSpec, {
|
||||
const GcliFront = exports.GcliFront = FrontClassWithSpec(gcliSpec, {
|
||||
initialize: function (client, tabForm) {
|
||||
Front.prototype.initialize.call(this, client);
|
||||
this.actorID = tabForm.gcliActor;
|
||||
|
|
|
@ -3,13 +3,13 @@
|
|||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
"use strict";
|
||||
|
||||
const { FrontClass } = require("devtools/shared/protocol");
|
||||
const { FrontClassWithSpec } = require("devtools/shared/protocol");
|
||||
const {
|
||||
customHighlighterSpec,
|
||||
highlighterSpec
|
||||
} = require("devtools/shared/specs/highlighters");
|
||||
|
||||
const HighlighterFront = FrontClass(highlighterSpec, {
|
||||
const HighlighterFront = FrontClassWithSpec(highlighterSpec, {
|
||||
// Update the object given a form representation off the wire.
|
||||
form: function (json) {
|
||||
this.actorID = json.actor;
|
||||
|
@ -20,6 +20,6 @@ const HighlighterFront = FrontClass(highlighterSpec, {
|
|||
|
||||
exports.HighlighterFront = HighlighterFront;
|
||||
|
||||
const CustomHighlighterFront = FrontClass(customHighlighterSpec, {});
|
||||
const CustomHighlighterFront = FrontClassWithSpec(customHighlighterSpec, {});
|
||||
|
||||
exports.CustomHighlighterFront = CustomHighlighterFront;
|
||||
|
|
|
@ -8,7 +8,7 @@ require("devtools/shared/fronts/highlighters");
|
|||
const { SimpleStringFront } = require("devtools/shared/fronts/string");
|
||||
const {
|
||||
Front,
|
||||
FrontClass,
|
||||
FrontClassWithSpec,
|
||||
custom,
|
||||
preEvent,
|
||||
types
|
||||
|
@ -84,7 +84,7 @@ const AttributeModificationList = Class({
|
|||
* the parent node from clients, but the `children` request should be used
|
||||
* to traverse children.
|
||||
*/
|
||||
const NodeFront = FrontClass(nodeSpec, {
|
||||
const NodeFront = FrontClassWithSpec(nodeSpec, {
|
||||
initialize: function (conn, form, detail, ctx) {
|
||||
// The parent node
|
||||
this._parent = null;
|
||||
|
@ -444,7 +444,7 @@ exports.NodeFront = NodeFront;
|
|||
/**
|
||||
* Client side of a node list as returned by querySelectorAll()
|
||||
*/
|
||||
const NodeListFront = FrontClass(nodeListSpec, {
|
||||
const NodeListFront = FrontClassWithSpec(nodeListSpec, {
|
||||
initialize: function (client, form) {
|
||||
Front.prototype.initialize.call(this, client, form);
|
||||
},
|
||||
|
@ -484,7 +484,7 @@ exports.NodeListFront = NodeListFront;
|
|||
/**
|
||||
* Client side of the DOM walker.
|
||||
*/
|
||||
const WalkerFront = FrontClass(walkerSpec, {
|
||||
const WalkerFront = FrontClassWithSpec(walkerSpec, {
|
||||
// Set to true if cleanup should be requested after every mutation list.
|
||||
autoCleanup: true,
|
||||
|
||||
|
@ -940,7 +940,7 @@ exports.WalkerFront = WalkerFront;
|
|||
* Client side of the inspector actor, which is used to create
|
||||
* inspector-related actors, including the walker.
|
||||
*/
|
||||
var InspectorFront = FrontClass(inspectorSpec, {
|
||||
var InspectorFront = FrontClassWithSpec(inspectorSpec, {
|
||||
initialize: function (client, tabForm) {
|
||||
Front.prototype.initialize.call(this, client);
|
||||
this.actorID = tabForm.inspectorActor;
|
||||
|
|
|
@ -14,7 +14,7 @@ const protocol = require("devtools/shared/protocol");
|
|||
* front.start();
|
||||
* // now wait for events to come
|
||||
*/
|
||||
const ReflowFront = protocol.FrontClass(reflowSpec, {
|
||||
const ReflowFront = protocol.FrontClassWithSpec(reflowSpec, {
|
||||
initialize: function (client, {reflowActor}) {
|
||||
protocol.Front.prototype.initialize.call(this, client, {actor: reflowActor});
|
||||
this.manage(this);
|
||||
|
|
|
@ -12,7 +12,7 @@ loader.lazyRequireGetter(this, "FileUtils",
|
|||
loader.lazyRequireGetter(this, "HeapSnapshotFileUtils",
|
||||
"devtools/shared/heapsnapshot/HeapSnapshotFileUtils");
|
||||
|
||||
const MemoryFront = protocol.FrontClass(memorySpec, {
|
||||
const MemoryFront = protocol.FrontClassWithSpec(memorySpec, {
|
||||
initialize: function (client, form, rootForm = null) {
|
||||
protocol.Front.prototype.initialize.call(this, client, form);
|
||||
this._client = client;
|
||||
|
|
|
@ -3,10 +3,10 @@
|
|||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
"use strict";
|
||||
|
||||
const { Front, FrontClass } = require("devtools/shared/protocol");
|
||||
const { Front, FrontClassWithSpec } = require("devtools/shared/protocol");
|
||||
const performanceSpec = require("devtools/shared/specs/performance-entries");
|
||||
|
||||
var PerformanceEntriesFront = FrontClass(performanceSpec, {
|
||||
var PerformanceEntriesFront = FrontClassWithSpec(performanceSpec, {
|
||||
initialize: function (client, form) {
|
||||
Front.prototype.initialize.call(this, client);
|
||||
this.actorID = form.performanceEntriesActor;
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
"use strict";
|
||||
|
||||
const { Front, FrontClass } = require("devtools/shared/protocol");
|
||||
const { Front, FrontClassWithSpec } = require("devtools/shared/protocol");
|
||||
const { performanceRecordingSpec } = require("devtools/shared/specs/performance-recording");
|
||||
|
||||
loader.lazyRequireGetter(this, "PerformanceIO",
|
||||
|
@ -18,7 +18,7 @@ loader.lazyRequireGetter(this, "merge", "sdk/util/object", true);
|
|||
* This can be used on older Profiler implementations, but the methods cannot
|
||||
* be changed -- you must introduce a new method, and detect the server.
|
||||
*/
|
||||
const PerformanceRecordingFront = FrontClass(performanceRecordingSpec, merge({
|
||||
const PerformanceRecordingFront = FrontClassWithSpec(performanceRecordingSpec, merge({
|
||||
form: function (form, detail) {
|
||||
if (detail === "actorid") {
|
||||
this.actorID = form;
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
"use strict";
|
||||
|
||||
const { Cu } = require("chrome");
|
||||
const { Front, FrontClass, custom, preEvent } = require("devtools/shared/protocol");
|
||||
const { Front, FrontClassWithSpec, custom, preEvent } = require("devtools/shared/protocol");
|
||||
const { PerformanceRecordingFront } = require("devtools/shared/fronts/performance-recording");
|
||||
const { performanceSpec } = require("devtools/shared/specs/performance");
|
||||
const { Task } = require("devtools/shared/task");
|
||||
|
@ -16,7 +16,7 @@ loader.lazyRequireGetter(this, "LegacyPerformanceFront",
|
|||
loader.lazyRequireGetter(this, "getSystemInfo",
|
||||
"devtools/shared/system", true);
|
||||
|
||||
const PerformanceFront = FrontClass(performanceSpec, {
|
||||
const PerformanceFront = FrontClassWithSpec(performanceSpec, {
|
||||
initialize: function (client, form) {
|
||||
Front.prototype.initialize.call(this, client, form);
|
||||
this.actorID = form.performanceActor;
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
const {preferenceSpec} = require("devtools/shared/specs/preference");
|
||||
const protocol = require("devtools/shared/protocol");
|
||||
|
||||
const PreferenceFront = protocol.FrontClass(preferenceSpec, {
|
||||
const PreferenceFront = protocol.FrontClassWithSpec(preferenceSpec, {
|
||||
initialize: function (client, form) {
|
||||
protocol.Front.prototype.initialize.call(this, client);
|
||||
this.actorID = form.preferenceActor;
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
const { Cu } = require("chrome");
|
||||
const {
|
||||
Front,
|
||||
FrontClass,
|
||||
FrontClassWithSpec,
|
||||
custom
|
||||
} = require("devtools/shared/protocol");
|
||||
const { profilerSpec } = require("devtools/shared/specs/profiler");
|
||||
|
@ -18,7 +18,7 @@ loader.lazyRequireGetter(this, "extend", "sdk/util/object", true);
|
|||
* This can be used on older Profiler implementations, but the methods cannot
|
||||
* be changed -- you must introduce a new method, and detect the server.
|
||||
*/
|
||||
exports.ProfilerFront = FrontClass(profilerSpec, {
|
||||
exports.ProfilerFront = FrontClassWithSpec(profilerSpec, {
|
||||
initialize: function (client, form) {
|
||||
Front.prototype.initialize.call(this, client, form);
|
||||
this.actorID = form.profilerActor;
|
||||
|
|
|
@ -5,14 +5,14 @@
|
|||
|
||||
const {
|
||||
Front,
|
||||
FrontClass,
|
||||
FrontClassWithSpec,
|
||||
} = require("devtools/shared/protocol");
|
||||
const { promisesSpec } = require("devtools/shared/specs/promises");
|
||||
|
||||
/**
|
||||
* PromisesFront, the front for the PromisesActor.
|
||||
*/
|
||||
const PromisesFront = FrontClass(promisesSpec, {
|
||||
const PromisesFront = FrontClassWithSpec(promisesSpec, {
|
||||
initialize: function (client, form) {
|
||||
Front.prototype.initialize.call(this, client, form);
|
||||
this.actorID = form.promisesActor;
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
const {settingsSpec} = require("devtools/shared/specs/settings");
|
||||
const protocol = require("devtools/shared/protocol");
|
||||
|
||||
const SettingsFront = protocol.FrontClass(settingsSpec, {
|
||||
const SettingsFront = protocol.FrontClassWithSpec(settingsSpec, {
|
||||
initialize: function (client, form) {
|
||||
protocol.Front.prototype.initialize.call(this, client);
|
||||
this.actorID = form.settingsActor;
|
||||
|
|
Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше
Загрузка…
Ссылка в новой задаче