This commit is contained in:
Tim Taubert 2013-04-11 17:14:38 +02:00
Родитель 512a13dbf8 cdbb4449b4
Коммит fc580f8dfe
23 изменённых файлов: 632 добавлений и 342 удалений

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

@ -1,7 +1,6 @@
# -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
# 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/.
/* 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/. */
//******** define a js object to implement nsITreeView
function pageInfoTreeView(treeid, copycol)

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

@ -4271,7 +4271,7 @@
this.mOverCloseButton = true;
let tab = event.target;
if (tab.selected)
if (tab.selected || tab.closing)
return;
let tabContainer = this.parentNode;

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

@ -65,7 +65,7 @@ browser.jar:
content/browser/newtab/newTab.css (content/newtab/newTab.css)
content/browser/newtab/preload.xhtml (content/newtab/preload.xhtml)
* content/browser/pageinfo/pageInfo.xul (content/pageinfo/pageInfo.xul)
* content/browser/pageinfo/pageInfo.js (content/pageinfo/pageInfo.js)
content/browser/pageinfo/pageInfo.js (content/pageinfo/pageInfo.js)
content/browser/pageinfo/pageInfo.css (content/pageinfo/pageInfo.css)
content/browser/pageinfo/pageInfo.xml (content/pageinfo/pageInfo.xml)
content/browser/pageinfo/feeds.js (content/pageinfo/feeds.js)

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

@ -137,7 +137,7 @@ let DebuggerController = {
if (!window._isChromeDebugger) {
let target = this._target;
let { client, form } = target;
let { client, form, threadActor } = target;
target.on("close", this._onTabDetached);
target.on("navigate", this._onTabNavigated);
target.on("will-navigate", this._onTabNavigated);
@ -145,7 +145,7 @@ let DebuggerController = {
if (target.chrome) {
this._startChromeDebugging(client, form.chromeDebugger, deferred.resolve);
} else {
this._startDebuggingTab(client, form, deferred.resolve);
this._startDebuggingTab(client, threadActor, deferred.resolve);
}
return deferred.promise;
@ -176,18 +176,17 @@ let DebuggerController = {
if (!this.client) {
return;
}
this.client.removeListener("tabNavigated", this._onTabNavigated);
this.client.removeListener("tabDetached", this._onTabDetached);
// When debugging local or a remote instance, the connection is closed by
// the RemoteTarget.
if (window._isChromeDebugger) {
this.client.removeListener("tabNavigated", this._onTabNavigated);
this.client.removeListener("tabDetached", this._onTabDetached);
this.client.close();
}
this._connection = null;
this.client = null;
this.tabClient = null;
this.activeThread = null;
},
@ -227,41 +226,33 @@ let DebuggerController = {
*
* @param DebuggerClient aClient
* The debugger client.
* @param object aTabGrip
* @param string aThreadActor
* The remote protocol grip of the tab.
* @param function aCallback
* A function to invoke once the client attached to the active thread.
*/
_startDebuggingTab: function DC__startDebuggingTab(aClient, aTabGrip, aCallback) {
_startDebuggingTab: function DC__startDebuggingTab(aClient, aThreadActor, aCallback) {
if (!aClient) {
Cu.reportError("No client found!");
return;
}
this.client = aClient;
aClient.attachTab(aTabGrip.actor, (aResponse, aTabClient) => {
if (!aTabClient) {
Cu.reportError("No tab client found!");
aClient.attachThread(aThreadActor, (aResponse, aThreadClient) => {
if (!aThreadClient) {
Cu.reportError("Couldn't attach to thread: " + aResponse.error);
return;
}
this.tabClient = aTabClient;
this.activeThread = aThreadClient;
aClient.attachThread(aResponse.threadActor, (aResponse, aThreadClient) => {
if (!aThreadClient) {
Cu.reportError("Couldn't attach to thread: " + aResponse.error);
return;
}
this.activeThread = aThreadClient;
this.ThreadState.connect();
this.StackFrames.connect();
this.SourceScripts.connect();
aThreadClient.resume(this._ensureResumptionOrder);
this.ThreadState.connect();
this.StackFrames.connect();
this.SourceScripts.connect();
aThreadClient.resume(this._ensureResumptionOrder);
if (aCallback) {
aCallback();
}
});
if (aCallback) {
aCallback();
}
});
},
@ -331,7 +322,6 @@ let DebuggerController = {
_shutdown: null,
_connection: null,
client: null,
tabClient: null,
activeThread: null
};
@ -1720,9 +1710,6 @@ Object.defineProperties(window, {
"gClient": {
get: function() DebuggerController.client
},
"gTabClient": {
get: function() DebuggerController.tabClient
},
"gThreadClient": {
get: function() DebuggerController.activeThread
},

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

@ -644,7 +644,6 @@ function testKeyboardAccessibility(callback) {
is(gVariablesView._parent.scrollTop, 0,
"The variables view shouldn't scroll when pressing the UP key.");
EventUtils.sendKey("PAGE_DOWN", gDebugger);
is(gVariablesView.getFocusedItem().name, "someProp5",
"The someProp5 item should be focused now.");
@ -658,18 +657,21 @@ function testKeyboardAccessibility(callback) {
"The foo item should be focused now.");
EventUtils.sendKey("DOWN", gDebugger);
is(gVariablesView.getFocusedItem().name, "bar",
"The bar item should be focused now.");
EventUtils.sendKey("UP", gDebugger);
is(gVariablesView.getFocusedItem().name, "foo",
"The foo item should still be focused now.");
"The foo item should be focused now.");
EventUtils.sendKey("RIGHT", gDebugger);
is(gVariablesView.getFocusedItem().name, "bar",
"The bar item should still be focused now.");
is(gVariablesView.getFocusedItem().name, "foo",
"The foo item should still be focused now.");
EventUtils.sendKey("PAGE_DOWN", gDebugger);
is(gVariablesView.getFocusedItem().name, "foo",
"The foo item should still be focused now.");
EventUtils.sendKey("PAGE_UP", gDebugger);
is(gVariablesView.getFocusedItem().name, "__proto__",
"The __proto__ item should be focused now.");
@ -702,10 +704,9 @@ function testKeyboardAccessibility(callback) {
is(gVariablesView.getFocusedItem().name, "someProp0",
"The someProp0 item should still be focused now.");
for (let i = 0; i < 16; i++) {
// Advance to the first collapsed __proto__ property.
EventUtils.sendKey("RIGHT", gDebugger);
EventUtils.sendKey("DOWN", gDebugger);
}
is(gVariablesView.getFocusedItem().name, "__proto__",
"The __proto__ item should be focused now.");
@ -718,7 +719,7 @@ function testKeyboardAccessibility(callback) {
is(gVariablesView.getFocusedItem().expanded, true,
"The __proto__ item should be expanded now.");
for (let i = 0; i < 2; i++) {
for (let i = 0; i < 3; i++) {
// Advance to the fifth top-level someProp5 property.
EventUtils.sendKey("LEFT", gDebugger);
}
@ -743,26 +744,30 @@ function testKeyboardAccessibility(callback) {
"The someProp5 item should not be expanded now.");
EventUtils.sendKey("LEFT", gDebugger);
is(gVariablesView.getFocusedItem().name, "someProp5",
"The someProp5 item should still be focused.");
EventUtils.sendKey("UP", gDebugger);
is(gVariablesView.getFocusedItem().name, "someProp4",
"The someProp4 item should be focused.");
EventUtils.sendKey("LEFT", gDebugger);
EventUtils.sendKey("UP", gDebugger);
is(gVariablesView.getFocusedItem().name, "someProp3",
"The someProp3 item should be focused.");
EventUtils.sendKey("LEFT", gDebugger);
EventUtils.sendKey("UP", gDebugger);
is(gVariablesView.getFocusedItem().name, "someProp2",
"The someProp2 item should be focused.");
EventUtils.sendKey("LEFT", gDebugger);
EventUtils.sendKey("UP", gDebugger);
is(gVariablesView.getFocusedItem().name, "someProp1",
"The someProp1 item should be focused.");
EventUtils.sendKey("LEFT", gDebugger);
EventUtils.sendKey("UP", gDebugger);
is(gVariablesView.getFocusedItem().name, "someProp0",
"The someProp0 item should be focused.");
EventUtils.sendKey("LEFT", gDebugger);
EventUtils.sendKey("UP", gDebugger);
is(gVariablesView.getFocusedItem().name, "someProp0",
"The someProp0 item should still be focused.");
@ -777,7 +782,7 @@ function testKeyboardAccessibility(callback) {
is(gVariablesView.getFocusedItem().name, "foo",
"The foo scope should be focused now.");
is(gVariablesView.getFocusedItem().expanded, true,
"The foo scope should already be expanded yet.");
"The foo scope should already be expanded.");
EventUtils.sendKey("LEFT", gDebugger);
is(gVariablesView.getFocusedItem().name, "foo",
@ -785,15 +790,9 @@ function testKeyboardAccessibility(callback) {
is(gVariablesView.getFocusedItem().expanded, false,
"The foo scope shouldn't be expanded now.");
EventUtils.sendKey("DOWN", gDebugger);
is(gVariablesView.getFocusedItem().name, "foo",
"The foo scope should still be focused.");
is(gVariablesView.getFocusedItem().expanded, true,
"The foo scope should be expanded now.");
EventUtils.sendKey("DOWN", gDebugger);
is(gVariablesView.getFocusedItem().name, "bar",
"The bar variable should still be focused.");
"The bar variable should be focused.");
is(gVariablesView.getFocusedItem().expanded, false,
"The bar variable shouldn't be expanded.");
is(gVariablesView.getFocusedItem().visible, true,
@ -814,6 +813,20 @@ function testKeyboardAccessibility(callback) {
EventUtils.sendKey("UP", gDebugger);
is(gVariablesView.getFocusedItem().name, "__proto__",
"The top-level __proto__ item should be focused.");
is(gVariablesView.getFocusedItem().expanded, false,
"The top-level __proto__ item should not be expanded.");
EventUtils.sendKey("RIGHT", gDebugger);
is(gVariablesView.getFocusedItem().name, "__proto__",
"The top-level __proto__ item should still be focused.");
is(gVariablesView.getFocusedItem().expanded, true,
"The top-level __proto__ item should be expanded.");
EventUtils.sendKey("LEFT", gDebugger);
is(gVariablesView.getFocusedItem().name, "__proto__",
"The top-level __proto__ item should still be focused.");
is(gVariablesView.getFocusedItem().expanded, false,
"The top-level __proto__ item should not be expanded.");
executeSoon(callback);
});

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

@ -280,12 +280,20 @@ TabTarget.prototype = {
// already initialized in the connection screen code.
this._remote.resolve(null);
} else {
this._client.connect(function(aType, aTraits) {
this._client.listTabs(function(aResponse) {
this._client.connect((aType, aTraits) => {
this._client.listTabs(aResponse => {
this._form = aResponse.tabs[aResponse.selected];
this._remote.resolve(null);
}.bind(this));
}.bind(this));
this._client.attachTab(this._form.actor, (aResponse, aTabClient) => {
if (!aTabClient) {
this._remote.reject("Unable to attach to the tab");
return;
}
this.threadActor = aResponse.threadActor;
this._remote.resolve(null);
});
});
});
}
return this._remote.promise;

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

@ -38,7 +38,6 @@ browser.jar:
content/browser/debugger-toolbar.js (debugger/debugger-toolbar.js)
content/browser/debugger-panes.js (debugger/debugger-panes.js)
content/browser/profiler.xul (profiler/profiler.xul)
content/browser/profiler.css (profiler/profiler.css)
content/browser/devtools/cleopatra.html (profiler/cleopatra/cleopatra.html)
content/browser/devtools/profiler/cleopatra/css/ui.css (profiler/cleopatra/css/ui.css)
content/browser/devtools/profiler/cleopatra/css/tree.css (profiler/cleopatra/css/tree.css)

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

@ -7,8 +7,8 @@
<?xml-stylesheet href="chrome://global/skin/global.css"?>
<?xml-stylesheet href="chrome://browser/skin/devtools/common.css"?>
<?xml-stylesheet href="chrome://browser/skin/devtools/splitview.css"?>
<?xml-stylesheet href="chrome://browser/skin/devtools/profiler.css"?>
<?xml-stylesheet href="chrome://browser/content/splitview.css"?>
<?xml-stylesheet href="chrome://browser/content/profiler.css"?>
<!DOCTYPE window [
<!ENTITY % profilerDTD SYSTEM "chrome://browser/locale/devtools/profiler.dtd">

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

@ -734,40 +734,27 @@ VariablesView.prototype = {
return;
case e.DOM_VK_DOWN:
// Only expand scopes before advancing focus.
if (!(item instanceof Variable) &&
!(item instanceof Property) &&
!item._isExpanded && item._isArrowVisible) {
item.expand();
} else {
this.focusNextItem(true);
}
// Always advance focus.
this.focusNextItem(true);
return;
case e.DOM_VK_LEFT:
// If this is a collapsed or un-expandable item that has an expandable
// variable or property parent, collapse and focus the owner view.
if (!item._isExpanded || !item._isArrowVisible) {
let ownerView = item.ownerView;
if ((ownerView instanceof Variable ||
ownerView instanceof Property) &&
ownerView._isExpanded && ownerView._isArrowVisible) {
if (this._focusItem(ownerView, true)) {
return;
}
}
}
// Collapse scopes, variables and properties before rewinding focus.
if (item._isExpanded && item._isArrowVisible) {
item.collapse();
} else {
this.focusPrevItem(true);
this._focusItem(item.ownerView);
}
return;
case e.DOM_VK_RIGHT:
// Nothing to do here if this item never expands.
if (!item._isArrowVisible) {
return;
}
// Expand scopes, variables and properties before advancing focus.
if (!item._isExpanded && item._isArrowVisible) {
if (!item._isExpanded) {
item.expand();
} else {
this.focusNextItem(true);

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

@ -4386,7 +4386,6 @@ function WebConsoleConnectionProxy(aWebConsole, aTarget)
this._onNetworkEventUpdate = this._onNetworkEventUpdate.bind(this);
this._onFileActivity = this._onFileActivity.bind(this);
this._onTabNavigated = this._onTabNavigated.bind(this);
this._onAttachTab = this._onAttachTab.bind(this);
this._onAttachConsole = this._onAttachConsole.bind(this);
this._onCachedMessages = this._onCachedMessages.bind(this);
this._connectionTimeout = this._connectionTimeout.bind(this);
@ -4423,12 +4422,6 @@ WebConsoleConnectionProxy.prototype = {
*/
webConsoleClient: null,
/**
* The TabClient instance we use.
* @type object
*/
tabClient: null,
/**
* Tells if the connection is established.
* @type boolean
@ -4453,14 +4446,6 @@ WebConsoleConnectionProxy.prototype = {
*/
_consoleActor: null,
/**
* The TabActor ID.
*
* @private
* @type string
*/
_tabActor: null,
/**
* Tells if the window.console object of the remote web page is the native
* object or not.
@ -4504,17 +4489,15 @@ WebConsoleConnectionProxy.prototype = {
client.addListener("networkEvent", this._onNetworkEvent);
client.addListener("networkEventUpdate", this._onNetworkEventUpdate);
client.addListener("fileActivity", this._onFileActivity);
client.addListener("tabNavigated", this._onTabNavigated);
this.target.on("will-navigate", this._onTabNavigated);
this.target.on("navigate", this._onTabNavigated);
this._consoleActor = this.target.form.consoleActor;
if (!this.target.chrome) {
// target.form is a TabActor grip
this._attachTab(this.target.form);
}
else {
// target.form is a RootActor grip
this._consoleActor = this.target.form.consoleActor;
this._attachConsole();
let tab = this.target.form;
this.owner.onLocationChange(tab.url, tab.title);
}
this._attachConsole();
return promise;
},
@ -4533,43 +4516,6 @@ WebConsoleConnectionProxy.prototype = {
this._connectDefer.reject(error);
},
/**
* Attach to the tab actor.
*
* @private
* @param object aTab
* Grip for the tab to attach to.
*/
_attachTab: function WCCP__attachTab(aTab)
{
this._consoleActor = aTab.consoleActor;
this._tabActor = aTab.actor;
this.owner.onLocationChange(aTab.url, aTab.title);
this.client.attachTab(this._tabActor, this._onAttachTab);
},
/**
* The "attachTab" response handler.
*
* @private
* @param object aResponse
* The JSON response object received from the server.
* @param object aTabClient
* The TabClient instance for the attached tab.
*/
_onAttachTab: function WCCP__onAttachTab(aResponse, aTabClient)
{
if (aResponse.error) {
Cu.reportError("attachTab failed: " + aResponse.error + " " +
aResponse.message);
this._connectDefer.reject(aResponse);
return;
}
this.tabClient = aTabClient;
this._attachConsole();
},
/**
* Attach to the Web Console actor.
* @private
@ -4739,7 +4685,7 @@ WebConsoleConnectionProxy.prototype = {
*/
_onTabNavigated: function WCCP__onTabNavigated(aType, aPacket)
{
if (!this.owner || aPacket.from != this._tabActor) {
if (!this.owner) {
return;
}
@ -4747,7 +4693,7 @@ WebConsoleConnectionProxy.prototype = {
this.owner.onLocationChange(aPacket.url, aPacket.title);
}
if (aPacket.state == "stop" && !aPacket.nativeConsoleAPI) {
if (aType == "navigate" && !aPacket.nativeConsoleAPI) {
this.owner.logWarningAboutReplacedAPI();
}
},
@ -4793,7 +4739,6 @@ WebConsoleConnectionProxy.prototype = {
this.client = null;
this.webConsoleClient = null;
this.tabClient = null;
this.target = null;
this.connected = false;
this.owner = null;

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

@ -33,7 +33,6 @@ this.RecentWindow = {
function isSuitableBrowserWindow(win) {
return (!win.closed &&
win.toolbar.visible &&
(allowPopups || win.toolbar.visible) &&
(!checkPrivacy ||
PrivateBrowsingUtils.permanentPrivateBrowsing ||

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

@ -0,0 +1,5 @@
/* 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/. */
%include ../../shared/devtools/profiler.inc.css

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

@ -166,6 +166,7 @@ browser.jar:
skin/classic/browser/devtools/splitview.css (devtools/splitview.css)
skin/classic/browser/devtools/styleeditor.css (devtools/styleeditor.css)
skin/classic/browser/devtools/debugger.css (devtools/debugger.css)
* skin/classic/browser/devtools/profiler.css (devtools/profiler.css)
skin/classic/browser/devtools/netmonitor.css (devtools/netmonitor.css)
skin/classic/browser/devtools/magnifying-glass.png (devtools/magnifying-glass.png)
skin/classic/browser/devtools/option-icon.png (devtools/option-icon.png)

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

@ -0,0 +1,5 @@
/* 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/. */
%include ../../shared/devtools/profiler.inc.css

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

@ -254,6 +254,7 @@ browser.jar:
skin/classic/browser/devtools/splitview.css (devtools/splitview.css)
skin/classic/browser/devtools/styleeditor.css (devtools/styleeditor.css)
* skin/classic/browser/devtools/debugger.css (devtools/debugger.css)
* skin/classic/browser/devtools/profiler.css (devtools/profiler.css)
skin/classic/browser/devtools/netmonitor.css (devtools/netmonitor.css)
skin/classic/browser/devtools/magnifying-glass.png (devtools/magnifying-glass.png)
skin/classic/browser/devtools/option-icon.png (devtools/option-icon.png)

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

@ -1,3 +1,9 @@
%if 0
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
%endif
.profile-name {
font-size: 13px;
padding: 8px;

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

@ -0,0 +1,5 @@
/* 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/. */
%include ../../shared/devtools/profiler.inc.css

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

@ -194,6 +194,7 @@ browser.jar:
skin/classic/browser/devtools/splitview.css (devtools/splitview.css)
skin/classic/browser/devtools/styleeditor.css (devtools/styleeditor.css)
skin/classic/browser/devtools/debugger.css (devtools/debugger.css)
* skin/classic/browser/devtools/profiler.css (devtools/profiler.css)
skin/classic/browser/devtools/netmonitor.css (devtools/netmonitor.css)
skin/classic/browser/devtools/magnifying-glass.png (devtools/magnifying-glass.png)
skin/classic/browser/devtools/option-icon.png (devtools/option-icon.png)
@ -437,6 +438,7 @@ browser.jar:
skin/classic/aero/browser/devtools/splitview.css (devtools/splitview.css)
skin/classic/aero/browser/devtools/styleeditor.css (devtools/styleeditor.css)
skin/classic/aero/browser/devtools/debugger.css (devtools/debugger.css)
* skin/classic/aero/browser/devtools/profiler.css (devtools/profiler.css)
skin/classic/aero/browser/devtools/netmonitor.css (devtools/netmonitor.css)
skin/classic/aero/browser/devtools/magnifying-glass.png (devtools/magnifying-glass.png)
skin/classic/aero/browser/devtools/option-icon.png (devtools/option-icon.png)

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

@ -3020,5 +3020,233 @@
"high": "80 * 25",
"n_buckets": "80 + 1",
"description": "The time (in milliseconds) after showing a PopupNotification that the mainAction was first triggered"
},
"DEVTOOLS_DEBUGGER_RDP_LOCAL_DETACH_MS": {
"kind": "exponential",
"high": "10000",
"n_buckets": "1000",
"description": "The time (in milliseconds) that it took a 'detach' request to go round trip."
},
"DEVTOOLS_DEBUGGER_RDP_REMOTE_DETACH_MS": {
"kind": "exponential",
"high": "10000",
"n_buckets": "1000",
"description": "The time (in milliseconds) that it took a 'detach' request to go round trip."
},
"DEVTOOLS_DEBUGGER_RDP_LOCAL_RESUME_MS": {
"kind": "exponential",
"high": "10000",
"n_buckets": "1000",
"description": "The time (in milliseconds) that it took a 'resume' request to go round trip."
},
"DEVTOOLS_DEBUGGER_RDP_REMOTE_RESUME_MS": {
"kind": "exponential",
"high": "10000",
"n_buckets": "1000",
"description": "The time (in milliseconds) that it took a 'resume' request to go round trip."
},
"DEVTOOLS_DEBUGGER_RDP_LOCAL_INTERRUPT_MS": {
"kind": "exponential",
"high": "10000",
"n_buckets": "1000",
"description": "The time (in milliseconds) that it took an 'interrupt' request to go round trip."
},
"DEVTOOLS_DEBUGGER_RDP_REMOTE_INTERRUPT_MS": {
"kind": "exponential",
"high": "10000",
"n_buckets": "1000",
"description": "The time (in milliseconds) that it took an 'interrupt' request to go round trip."
},
"DEVTOOLS_DEBUGGER_RDP_LOCAL_CLIENTEVALUATE_MS": {
"kind": "exponential",
"high": "10000",
"n_buckets": "1000",
"description": "The time (in milliseconds) that it took a 'clientEvaluate' request to go round trip."
},
"DEVTOOLS_DEBUGGER_RDP_REMOTE_CLIENTEVALUATE_MS": {
"kind": "exponential",
"high": "10000",
"n_buckets": "1000",
"description": "The time (in milliseconds) that it took a 'clientEvaluate' request to go round trip."
},
"DEVTOOLS_DEBUGGER_RDP_LOCAL_RELEASEMANY_MS": {
"kind": "exponential",
"high": "10000",
"n_buckets": "1000",
"description": "The time (in milliseconds) that it took a 'releaseMany' request to go round trip."
},
"DEVTOOLS_DEBUGGER_RDP_REMOTE_RELEASEMANY_MS": {
"kind": "exponential",
"high": "10000",
"n_buckets": "1000",
"description": "The time (in milliseconds) that it took a 'releaseMany' request to go round trip."
},
"DEVTOOLS_DEBUGGER_RDP_LOCAL_THREADGRIPS_MS": {
"kind": "exponential",
"high": "10000",
"n_buckets": "1000",
"description": "The time (in milliseconds) that it took a 'threadGrips' request to go round trip."
},
"DEVTOOLS_DEBUGGER_RDP_REMOTE_THREADGRIPS_MS": {
"kind": "exponential",
"high": "10000",
"n_buckets": "1000",
"description": "The time (in milliseconds) that it took a 'threadGrips' request to go round trip."
},
"DEVTOOLS_DEBUGGER_RDP_LOCAL_SOURCES_MS": {
"kind": "exponential",
"high": "10000",
"n_buckets": "1000",
"description": "The time (in milliseconds) that it took a 'sources' request to go round trip."
},
"DEVTOOLS_DEBUGGER_RDP_REMOTE_SOURCES_MS": {
"kind": "exponential",
"high": "10000",
"n_buckets": "1000",
"description": "The time (in milliseconds) that it took a 'sources' request to go round trip."
},
"DEVTOOLS_DEBUGGER_RDP_LOCAL_FRAMES_MS": {
"kind": "exponential",
"high": "10000",
"n_buckets": "1000",
"description": "The time (in milliseconds) that it took a 'frames' request to go round trip."
},
"DEVTOOLS_DEBUGGER_RDP_REMOTE_FRAMES_MS": {
"kind": "exponential",
"high": "10000",
"n_buckets": "1000",
"description": "The time (in milliseconds) that it took a 'frames' request to go round trip."
},
"DEVTOOLS_DEBUGGER_RDP_LOCAL_PARAMETERNAMES_MS": {
"kind": "exponential",
"high": "10000",
"n_buckets": "1000",
"description": "The time (in milliseconds) that it took a 'parameterNames' request to go round trip."
},
"DEVTOOLS_DEBUGGER_RDP_REMOTE_PARAMETERNAMES_MS": {
"kind": "exponential",
"high": "10000",
"n_buckets": "1000",
"description": "The time (in milliseconds) that it took a 'parameterNames' request to go round trip."
},
"DEVTOOLS_DEBUGGER_RDP_LOCAL_OWNPROPERTYNAMES_MS": {
"kind": "exponential",
"high": "10000",
"n_buckets": "1000",
"description": "The time (in milliseconds) that it took a 'ownPropertyNames' request to go round trip."
},
"DEVTOOLS_DEBUGGER_RDP_REMOTE_OWNPROPERTYNAMES_MS": {
"kind": "exponential",
"high": "10000",
"n_buckets": "1000",
"description": "The time (in milliseconds) that it took a 'ownPropertyNames' request to go round trip."
},
"DEVTOOLS_DEBUGGER_RDP_LOCAL_PROTOTYPEANDPROPERTIES_MS": {
"kind": "exponential",
"high": "10000",
"n_buckets": "1000",
"description": "The time (in milliseconds) that it took a 'prototypeAndProperties' request to go round trip."
},
"DEVTOOLS_DEBUGGER_RDP_REMOTE_PROTOTYPEANDPROPERTIES_MS": {
"kind": "exponential",
"high": "10000",
"n_buckets": "1000",
"description": "The time (in milliseconds) that it took a 'prototypeAndProperties' request to go round trip."
},
"DEVTOOLS_DEBUGGER_RDP_LOCAL_PROPERTY_MS": {
"kind": "exponential",
"high": "10000",
"n_buckets": "1000",
"description": "The time (in milliseconds) that it took a 'property' request to go round trip."
},
"DEVTOOLS_DEBUGGER_RDP_REMOTE_PROPERTY_MS": {
"kind": "exponential",
"high": "10000",
"n_buckets": "1000",
"description": "The time (in milliseconds) that it took a 'property' request to go round trip."
},
"DEVTOOLS_DEBUGGER_RDP_LOCAL_PROTOTYPE_MS": {
"kind": "exponential",
"high": "10000",
"n_buckets": "1000",
"description": "The time (in milliseconds) that it took a 'prototype' request to go round trip."
},
"DEVTOOLS_DEBUGGER_RDP_REMOTE_PROTOTYPE_MS": {
"kind": "exponential",
"high": "10000",
"n_buckets": "1000",
"description": "The time (in milliseconds) that it took a 'prototype' request to go round trip."
},
"DEVTOOLS_DEBUGGER_RDP_LOCAL_SUBSTRING_MS": {
"kind": "exponential",
"high": "10000",
"n_buckets": "1000",
"description": "The time (in milliseconds) that it took a 'substring' request to go round trip."
},
"DEVTOOLS_DEBUGGER_RDP_REMOTE_SUBSTRING_MS": {
"kind": "exponential",
"high": "10000",
"n_buckets": "1000",
"description": "The time (in milliseconds) that it took a 'substring' request to go round trip."
},
"DEVTOOLS_DEBUGGER_RDP_LOCAL_RELEASE_MS": {
"kind": "exponential",
"high": "10000",
"n_buckets": "1000",
"description": "The time (in milliseconds) that it took a 'release' request to go round trip."
},
"DEVTOOLS_DEBUGGER_RDP_REMOTE_RELEASE_MS": {
"kind": "exponential",
"high": "10000",
"n_buckets": "1000",
"description": "The time (in milliseconds) that it took a 'release' request to go round trip."
},
"DEVTOOLS_DEBUGGER_RDP_LOCAL_LISTTABS_MS": {
"kind": "exponential",
"high": "10000",
"n_buckets": "1000",
"description": "The time (in milliseconds) that it took a 'listTabs' request to go round trip."
},
"DEVTOOLS_DEBUGGER_RDP_REMOTE_LISTTABS_MS": {
"kind": "exponential",
"high": "10000",
"n_buckets": "1000",
"description": "The time (in milliseconds) that it took a 'listTabs' request to go round trip."
},
"DEVTOOLS_DEBUGGER_RDP_LOCAL_DELETE_MS": {
"kind": "exponential",
"high": "10000",
"n_buckets": "1000",
"description": "The time (in milliseconds) that it took a 'delete' request to go round trip."
},
"DEVTOOLS_DEBUGGER_RDP_REMOTE_DELETE_MS": {
"kind": "exponential",
"high": "10000",
"n_buckets": "1000",
"description": "The time (in milliseconds) that it took a 'delete' request to go round trip."
},
"DEVTOOLS_DEBUGGER_RDP_LOCAL_THREADDETACH_MS": {
"kind": "exponential",
"high": "10000",
"n_buckets": "1000",
"description": "The time (in milliseconds) that it took a 'detach' request to go round trip."
},
"DEVTOOLS_DEBUGGER_RDP_REMOTE_THREADDETACH_MS": {
"kind": "exponential",
"high": "10000",
"n_buckets": "1000",
"description": "The time (in milliseconds) that it took a 'detach' request to go round trip."
},
"DEVTOOLS_DEBUGGER_RDP_LOCAL_TABDETACH_MS": {
"kind": "exponential",
"high": "10000",
"n_buckets": "1000",
"description": "The time (in milliseconds) that it took a 'detach' request to go round trip."
},
"DEVTOOLS_DEBUGGER_RDP_REMOTE_TABDETACH_MS": {
"kind": "exponential",
"high": "10000",
"n_buckets": "1000",
"description": "The time (in milliseconds) that it took a 'detach' request to go round trip."
}
}

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

@ -60,6 +60,8 @@ XPCOMUtils.defineLazyGetter(this, "gUnicodeConverter", function () {
XPCOMUtils.defineLazyModuleGetter(this, "Task",
"resource://gre/modules/Task.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "Deprecated",
"resource://gre/modules/Deprecated.jsm");
/**
* Utilities for dealing with promises and Task.jsm
@ -521,6 +523,14 @@ this.PageThumbsStorage = {
for (let i = 0; i < aData.length; i++)
hex += ("0" + aData.charCodeAt(i).toString(16)).slice(-2);
return hex;
},
// Deprecated, please do not use
getFileForURL: function Storage_getFileForURL_DEPRECATED(aURL) {
Deprecated.warning("PageThumbs.getFileForURL is deprecated. Please use PageThumbs.getFilePathForURL and OS.File",
"https://developer.mozilla.org/docs/JavaScript_OS.File");
// Note: Once this method has been removed, we can get rid of the dependency towards FileUtils
return new FileUtils.File(PageThumbsStorage.getFilePathForURL(aURL));
}
};

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

@ -69,6 +69,15 @@ function runTests() {
// Check that our existing thumbnail wasn't overwritten.
is(getFileContents(file), "no-overwrite-plz",
"existing thumbnail was not overwritten");
// Sanity check: ensure that, until it is removed, deprecated
// function |getFileForURL| points to the same path as
// |getFilePathForURL|.
if ("getFileForURL" in PageThumbsStorage) {
let file = PageThumbsStorage.getFileForURL(URL);
is(file.path, PageThumbsStorage.getFilePathForURL(URL),
"Deprecated getFileForURL and getFilePathForURL return the same path");
}
}
function changeLocation(aLocation, aNewDir) {

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

@ -218,8 +218,99 @@ this.DebuggerClient = function DebuggerClient(aTransport)
this.compat = new ProtocolCompatibility(this, [
new SourcesShim(),
]);
this.request = this.request.bind(this);
}
/**
* A declarative helper for defining methods that send requests to the server.
*
* @param aPacketSkeleton
* The form of the packet to send. Can specify fields to be filled from
* the parameters by using the |args| function.
* @param telemetry
* The unique suffix of the telemetry histogram id.
* @param before
* The function to call before sending the packet. Is passed the packet,
* and the return value is used as the new packet. The |this| context is
* the instance of the client object we are defining a method for.
* @param after
* The function to call after the response is received. It is passed the
* response, and the return value is considered the new response that
* will be passed to the callback. The |this| context is the instance of
* the client object we are defining a method for.
*/
DebuggerClient.requester = function DC_requester(aPacketSkeleton, { telemetry,
before, after }) {
return function (...args) {
let histogram, startTime;
if (telemetry) {
let transportType = this._transport instanceof LocalDebuggerTransport
? "LOCAL_"
: "REMOTE_";
let histogramId = "DEVTOOLS_DEBUGGER_RDP_"
+ transportType + telemetry + "_MS";
histogram = Services.telemetry.getHistogramById(histogramId);
startTime = +new Date;
}
let outgoingPacket = {
to: aPacketSkeleton.to || this.actor
};
let maxPosition = -1;
for (let k of Object.keys(aPacketSkeleton)) {
if (aPacketSkeleton[k] instanceof DebuggerClient.Argument) {
let { position } = aPacketSkeleton[k];
outgoingPacket[k] = aPacketSkeleton[k].getArgument(args);
maxPosition = Math.max(position, maxPosition);
} else {
outgoingPacket[k] = aPacketSkeleton[k];
}
}
if (before) {
outgoingPacket = before.call(this, outgoingPacket);
}
this.request(outgoingPacket, function (aResponse) {
if (after) {
let { from } = aResponse;
aResponse = after.call(this, aResponse);
if (!aResponse.from) {
aResponse.from = from;
}
}
// The callback is always the last parameter.
let thisCallback = args[maxPosition + 1];
if (thisCallback) {
thisCallback(aResponse);
}
if (histogram) {
histogram.add(+new Date - startTime);
}
}.bind(this));
};
};
function args(aPos) {
return new DebuggerClient.Argument(aPos);
}
DebuggerClient.Argument = function DCP(aPosition) {
this.position = aPosition;
};
DebuggerClient.Argument.prototype.getArgument = function DCP_getArgument(aParams) {
if (!this.position in aParams) {
throw new Error("Bad index into params: " + this.position);
}
return aParams[this.position];
};
DebuggerClient.prototype = {
/**
* Connect to the server and start exchanging protocol messages.
@ -304,12 +395,12 @@ DebuggerClient.prototype = {
* @param function aOnResponse
* Called with the response packet.
*/
listTabs: function DC_listTabs(aOnResponse) {
let packet = { to: ROOT_ACTOR_NAME, type: "listTabs" };
this.request(packet, function(aResponse) {
aOnResponse(aResponse);
});
},
listTabs: DebuggerClient.requester({
to: ROOT_ACTOR_NAME,
type: "listTabs"
}, {
telemetry: "LISTTABS"
}),
/**
* Attach to a tab actor.
@ -395,13 +486,12 @@ DebuggerClient.prototype = {
* If specified, will be called with the response packet when
* debugging server responds.
*/
release: function DC_release(aActor, aOnResponse) {
let packet = {
to: aActor,
type: "release",
};
this.request(packet, aOnResponse);
},
release: DebuggerClient.requester({
to: args(0),
type: "release"
}, {
telemetry: "RELEASE"
}),
/**
* Send a request to the debugging server.
@ -736,28 +826,30 @@ SSProto.translatePacket = function SS_translatePacket(aPacket,
function TabClient(aClient, aActor) {
this._client = aClient;
this._actor = aActor;
this.request = this._client.request;
}
TabClient.prototype = {
get actor() { return this._actor },
/**
* Detach the client from the tab actor.
*
* @param function aOnResponse
* Called with the response packet.
*/
detach: function TabC_detach(aOnResponse) {
let self = this;
let packet = { to: this._actor, type: "detach" };
this._client.request(packet, function(aResponse) {
if (self.activeTab === self._client._tabClients[self._actor]) {
delete self.activeTab;
detach: DebuggerClient.requester({
type: "detach"
}, {
after: function (aResponse) {
if (this.activeTab === this._client._tabClients[this.actor]) {
delete this.activeTab;
}
delete self._client._tabClients[self._actor];
if (aOnResponse) {
aOnResponse(aResponse);
}
});
}
delete this._client._tabClients[this.actor];
return aResponse;
},
telemetry: "TABDETACH"
}),
};
eventSource(TabClient.prototype);
@ -779,6 +871,7 @@ function ThreadClient(aClient, aActor) {
this._scriptCache = {};
this._pauseGrips = {};
this._threadGrips = {};
this.request = this._client.request;
}
ThreadClient.prototype = {
@ -803,35 +896,42 @@ ThreadClient.prototype = {
* Resume a paused thread. If the optional aLimit parameter is present, then
* the thread will also pause when that limit is reached.
*
* @param function aOnResponse
* Called with the response packet.
* @param [optional] object aLimit
* An object with a type property set to the appropriate limit (next,
* step, or finish) per the remote debugging protocol specification.
* Use null to specify no limit.
* @param function aOnResponse
* Called with the response packet.
*/
resume: function TC_resume(aOnResponse, aLimit) {
this._assertPaused("resume");
_doResume: DebuggerClient.requester({
type: "resume",
resumeLimit: args(0)
}, {
before: function (aPacket) {
this._assertPaused("resume");
// Put the client in a tentative "resuming" state so we can prevent
// further requests that should only be sent in the paused state.
this._state = "resuming";
// Put the client in a tentative "resuming" state so we can prevent
// further requests that should only be sent in the paused state.
this._state = "resuming";
let self = this;
let packet = {
to: this._actor,
type: "resume",
resumeLimit: aLimit,
pauseOnExceptions: this._pauseOnExceptions
};
this._client.request(packet, function(aResponse) {
aPacket.pauseOnExceptions = this._pauseOnExceptions;
return aPacket;
},
after: function (aResponse) {
if (aResponse.error) {
// There was an error resuming, back to paused state.
self._state = "paused";
this._state = "paused";
}
if (aOnResponse) {
aOnResponse(aResponse);
}
});
return aResponse;
},
telemetry: "RESUME"
}),
/**
* Resume a paused thread.
*/
resume: function TC_resume(aOnResponse) {
this._doResume(null, aOnResponse);
},
/**
@ -841,7 +941,7 @@ ThreadClient.prototype = {
* Called with the response packet.
*/
stepOver: function TC_stepOver(aOnResponse) {
this.resume(aOnResponse, { type: "next" });
this._doResume({ type: "next" }, aOnResponse);
},
/**
@ -851,7 +951,7 @@ ThreadClient.prototype = {
* Called with the response packet.
*/
stepIn: function TC_stepIn(aOnResponse) {
this.resume(aOnResponse, { type: "step" });
this._doResume({ type: "step" }, aOnResponse);
},
/**
@ -861,7 +961,7 @@ ThreadClient.prototype = {
* Called with the response packet.
*/
stepOut: function TC_stepOut(aOnResponse) {
this.resume(aOnResponse, { type: "finish" });
this._doResume({ type: "finish" }, aOnResponse);
},
/**
@ -870,14 +970,11 @@ ThreadClient.prototype = {
* @param function aOnResponse
* Called with the response packet.
*/
interrupt: function TC_interrupt(aOnResponse) {
let packet = { to: this._actor, type: "interrupt" };
this._client.request(packet, function(aResponse) {
if (aOnResponse) {
aOnResponse(aResponse);
}
});
},
interrupt: DebuggerClient.requester({
type: "interrupt"
}, {
telemetry: "INTERRUPT"
}),
/**
* Enable or disable pausing when an exception is thrown.
@ -916,27 +1013,27 @@ ThreadClient.prototype = {
* @param function aOnResponse
* Called with the response packet.
*/
eval: function TC_eval(aFrame, aExpression, aOnResponse) {
this._assertPaused("eval");
// Put the client in a tentative "resuming" state so we can prevent
// further requests that should only be sent in the paused state.
this._state = "resuming";
let self = this;
let request = { to: this._actor, type: "clientEvaluate",
frame: aFrame, expression: aExpression };
this._client.request(request, function(aResponse) {
eval: DebuggerClient.requester({
type: "clientEvaluate",
frame: args(0),
expression: args(1)
}, {
before: function (aPacket) {
this._assertPaused("eval");
// Put the client in a tentative "resuming" state so we can prevent
// further requests that should only be sent in the paused state.
this._state = "resuming";
return aPacket;
},
after: function (aResponse) {
if (aResponse.error) {
// There was an error resuming, back to paused state.
self._state = "paused";
}
if (aOnResponse) {
aOnResponse(aResponse);
}
});
},
return aResponse;
},
telemetry: "CLIENTEVALUATE"
}),
/**
* Detach from the thread actor.
@ -944,19 +1041,18 @@ ThreadClient.prototype = {
* @param function aOnResponse
* Called with the response packet.
*/
detach: function TC_detach(aOnResponse) {
let self = this;
let packet = { to: this._actor, type: "detach" };
this._client.request(packet, function(aResponse) {
if (self.activeThread === self._client._threadClients[self._actor]) {
delete self.activeThread;
detach: DebuggerClient.requester({
type: "detach"
}, {
after: function (aResponse) {
if (this.activeThread === this._client._threadClients[this.actor]) {
delete this.activeThread;
}
delete self._client._threadClients[self._actor];
if (aOnResponse) {
aOnResponse(aResponse);
}
});
},
delete this._client._threadClients[this.actor];
return aResponse;
},
telemetry: "THREADDETACH"
}),
/**
* Request to set a breakpoint in the specified location.
@ -1007,32 +1103,28 @@ ThreadClient.prototype = {
* actors are included in the request, a |notReleasable| error will return,
* but all the thread-lifetime ones will have been released.
*
* @param array aActors
* @param array actors
* An array with actor IDs to release.
*/
releaseMany: function TC_releaseMany(aActors, aOnResponse) {
let packet = {
to: this._actor,
type: "releaseMany",
actors: aActors
};
this._client.request(packet, aOnResponse);
},
releaseMany: DebuggerClient.requester({
type: "releaseMany",
actors: args(0),
}, {
telemetry: "RELEASEMANY"
}),
/**
* Promote multiple pause-lifetime object actors to thread-lifetime ones.
*
* @param array aActors
* @param array actors
* An array with actor IDs to promote.
*/
threadGrips: function TC_threadGrips(aActors, aOnResponse) {
let packet = {
to: this._actor,
type: "threadGrips",
actors: aActors
};
this._client.request(packet, aOnResponse);
},
threadGrips: DebuggerClient.requester({
type: "threadGrips",
actors: args(0)
}, {
telemetry: "THREADGRIPS"
}),
/**
* Request the loaded sources for the current thread.
@ -1043,34 +1135,37 @@ ThreadClient.prototype = {
getSources: function TC_getSources(aOnResponse) {
// This is how we should get sources if the server supports "sources"
// requests.
function getSources(aOnResponse) {
let packet = { to: this._actor, type: "sources" };
this._client.request(packet, aOnResponse);
}
let getSources = DebuggerClient.requester({
type: "sources"
}, {
telemetry: "SOURCES"
});
// This is how we should deduct what sources exist from the existing scripts
// when the server does not support "sources" requests.
function getSourcesBackwardsCompat(aOnResponse) {
this._client.request({
to: this._actor,
type: "scripts"
}, function (aResponse) {
let getSourcesBackwardsCompat = DebuggerClient.requester({
type: "scripts"
}, {
after: function (aResponse) {
if (aResponse.error) {
aOnResponse(aResponse);
return;
return aResponse;
}
let sourceActorsByURL = aResponse.scripts.reduce(function (aSourceActorsByURL, aScript) {
aSourceActorsByURL[aScript.url] = aScript.source;
return aSourceActorsByURL;
}, {});
aOnResponse({
let sourceActorsByURL = aResponse.scripts
.reduce(function (aSourceActorsByURL, aScript) {
aSourceActorsByURL[aScript.url] = aScript.source;
return aSourceActorsByURL;
}, {});
return {
sources: [
{ url: url, actor: sourceActorsByURL[url] }
for (url of Object.keys(sourceActorsByURL))
]
});
});
}
}
},
telemetry: "SOURCES"
});
// On the first time `getSources` is called, patch the thread client with
// the best method for the server's capabilities.
@ -1095,7 +1190,7 @@ ThreadClient.prototype = {
return;
}
aAction();
this.resume(function() {});
this.resume();
}.bind(this));
},
@ -1122,13 +1217,13 @@ ThreadClient.prototype = {
* @param aOnResponse function
* Called with the thread's response.
*/
getFrames: function TC_getFrames(aStart, aCount, aOnResponse) {
this._assertPaused("frames");
let packet = { to: this._actor, type: "frames",
start: aStart, count: aCount ? aCount : undefined };
this._client.request(packet, aOnResponse);
},
getFrames: DebuggerClient.requester({
type: "frames",
start: args(0),
count: args(1)
}, {
telemetry: "FRAMES"
}),
/**
* An array of cached frames. Clients can observe the framesadded and
@ -1310,6 +1405,7 @@ function GripClient(aClient, aGrip)
{
this._grip = aGrip;
this._client = aClient;
this.request = this._client.request;
}
GripClient.prototype = {
@ -1325,18 +1421,17 @@ GripClient.prototype = {
* { parameterNames:[<parameterName>, ...] }
* where each <parameterName> is the name of a parameter.
*/
getParameterNames: function GC_getParameterNames(aOnResponse) {
if (this._grip["class"] !== "Function") {
throw "getParameterNames is only valid for function grips.";
}
let packet = { to: this.actor, type: "parameterNames" };
this._client.request(packet, function (aResponse) {
if (aOnResponse) {
aOnResponse(aResponse);
}
});
},
getParameterNames: DebuggerClient.requester({
type: "parameterNames"
}, {
before: function (aPacket) {
if (this._grip["class"] !== "Function") {
throw new Error("getParameterNames is only valid for function grips.");
}
return aPacket;
},
telemetry: "PARAMETERNAMES"
}),
/**
* Request the names of the properties defined on the object and not its
@ -1344,29 +1439,22 @@ GripClient.prototype = {
*
* @param aOnResponse function Called with the request's response.
*/
getOwnPropertyNames: function GC_getOwnPropertyNames(aOnResponse) {
let packet = { to: this.actor, type: "ownPropertyNames" };
this._client.request(packet, function (aResponse) {
if (aOnResponse) {
aOnResponse(aResponse);
}
});
},
getOwnPropertyNames: DebuggerClient.requester({
type: "ownPropertyNames"
}, {
telemetry: "OWNPROPERTYNAMES"
}),
/**
* Request the prototype and own properties of the object.
*
* @param aOnResponse function Called with the request's response.
*/
getPrototypeAndProperties: function GC_getPrototypeAndProperties(aOnResponse) {
let packet = { to: this.actor,
type: "prototypeAndProperties" };
this._client.request(packet, function (aResponse) {
if (aOnResponse) {
aOnResponse(aResponse);
}
});
},
getPrototypeAndProperties: DebuggerClient.requester({
type: "prototypeAndProperties"
}, {
telemetry: "PROTOTYPEANDPROPERTIES"
}),
/**
* Request the property descriptor of the object's specified property.
@ -1374,29 +1462,23 @@ GripClient.prototype = {
* @param aName string The name of the requested property.
* @param aOnResponse function Called with the request's response.
*/
getProperty: function GC_getProperty(aName, aOnResponse) {
let packet = { to: this.actor, type: "property",
name: aName };
this._client.request(packet, function (aResponse) {
if (aOnResponse) {
aOnResponse(aResponse);
}
});
},
getProperty: DebuggerClient.requester({
type: "property",
name: args(0)
}, {
telemetry: "PROPERTY"
}),
/**
* Request the prototype of the object.
*
* @param aOnResponse function Called with the request's response.
*/
getPrototype: function GC_getPrototype(aOnResponse) {
let packet = { to: this.actor, type: "prototype" };
this._client.request(packet, function (aResponse) {
if (aOnResponse) {
aOnResponse(aResponse);
}
});
}
getPrototype: DebuggerClient.requester({
type: "prototype"
}, {
telemetry: "PROTOTYPE"
}),
};
/**
@ -1411,6 +1493,7 @@ GripClient.prototype = {
function LongStringClient(aClient, aGrip) {
this._grip = aGrip;
this._client = aClient;
this.request = this._client.request;
}
LongStringClient.prototype = {
@ -1430,13 +1513,13 @@ LongStringClient.prototype = {
* @param aCallback Function
* The function called when we receive the substring.
*/
substring: function LSC_substring(aStart, aEnd, aCallback) {
let packet = { to: this.actor,
type: "substring",
start: aStart,
end: aEnd };
this._client.request(packet, aCallback);
}
substring: DebuggerClient.requester({
type: "substring",
start: args(0),
end: args(1)
}, {
telemetry: "SUBSTRING"
}),
};
/**
@ -1503,6 +1586,7 @@ function BreakpointClient(aClient, aActor, aLocation) {
this._client = aClient;
this._actor = aActor;
this.location = aLocation;
this.request = this._client.request;
}
BreakpointClient.prototype = {
@ -1513,14 +1597,11 @@ BreakpointClient.prototype = {
/**
* Remove the breakpoint from the server.
*/
remove: function BC_remove(aOnResponse) {
let packet = { to: this._actor, type: "delete" };
this._client.request(packet, function(aResponse) {
if (aOnResponse) {
aOnResponse(aResponse);
}
});
}
remove: DebuggerClient.requester({
type: "delete"
}, {
telemetry: "DELETE"
}),
};
eventSource(BreakpointClient.prototype);

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

@ -201,7 +201,7 @@ DebuggerTransport.prototype = {
*
* @see DebuggerTransport
*/
function LocalDebuggerTransport(aOther)
this.LocalDebuggerTransport = function LocalDebuggerTransport(aOther)
{
this.other = aOther;
this.hooks = null;