Bug 1311506 - Remove promise debugger. r=gl

MozReview-Commit-ID: 4xPoheUWZJc
This commit is contained in:
J. Ryan Stinnett
2016-10-26 15:47:39 -05:00
parent 0b94516312
commit 9f27fd28fb
17 changed files with 2 additions and 286 deletions

View File

@@ -191,7 +191,6 @@ SourcesView.prototype = Heritage.extend(WidgetMethods, {
unBlackBoxButton: () => this._onStopBlackBoxing(),
prettyPrintCommand: () => this.togglePrettyPrint(),
toggleBreakpointsCommand: () =>this.toggleBreakpoints(),
togglePromiseDebuggerCommand: () => this.togglePromiseDebugger(),
nextSourceCommand: () => this.selectNextItem(),
prevSourceCommand: () => this.selectPrevItem()
});
@@ -614,17 +613,6 @@ SourcesView.prototype = Heritage.extend(WidgetMethods, {
}
},
togglePromiseDebugger: function () {
if (Prefs.promiseDebuggerEnabled) {
let promisePane = this.DebuggerView._promisePane;
promisePane.hidden = !promisePane.hidden;
if (!this.DebuggerView._promiseDebuggerIframe) {
this.DebuggerView._initializePromiseDebugger();
}
}
},
hidePrettyPrinting: function () {
this._prettyPrintButton.style.display = "none";

View File

@@ -1211,7 +1211,6 @@ var Prefs = new PrefsHelper("devtools", {
workersEnabled: ["Bool", "debugger.workers"],
editorTabSize: ["Int", "editor.tabsize"],
autoBlackBox: ["Bool", "debugger.auto-black-box"],
promiseDebuggerEnabled: ["Bool", "debugger.promise"]
});
/**

View File

@@ -23,8 +23,6 @@ const SEARCH_VARIABLE_FLAG = "*";
const SEARCH_AUTOFILL = [SEARCH_GLOBAL_FLAG, SEARCH_FUNCTION_FLAG, SEARCH_TOKEN_FLAG];
const TOOLBAR_ORDER_POPUP_POSITION = "topcenter bottomleft";
const RESIZE_REFRESH_RATE = 50; // ms
const PROMISE_DEBUGGER_URL =
"chrome://devtools/content/promisedebugger/promise-debugger.xhtml";
const EventListenersView = require("./content/views/event-listeners-view");
const SourcesView = require("./content/views/sources-view");
@@ -135,7 +133,6 @@ var DebuggerView = {
this.WatchExpressions.destroy();
this.EventListeners.destroy();
this.GlobalSearch.destroy();
this._destroyPromiseDebugger();
this._destroyPanes();
this.editor.destroy();
@@ -155,7 +152,6 @@ var DebuggerView = {
this._workersAndSourcesPane = document.getElementById("workers-and-sources-pane");
this._instrumentsPane = document.getElementById("instruments-pane");
this._instrumentsPaneToggleButton = document.getElementById("instruments-pane-toggle");
this._promisePane = document.getElementById("promise-debugger-pane");
this.showEditor = this.showEditor.bind(this);
this.showBlackBoxMessage = this.showBlackBoxMessage.bind(this);
@@ -191,7 +187,6 @@ var DebuggerView = {
this._workersAndSourcesPane = null;
this._instrumentsPane = null;
this._instrumentsPaneToggleButton = null;
this._promisePane = null;
},
/**
@@ -238,41 +233,6 @@ var DebuggerView = {
});
},
/**
* Initialie the Promise Debugger instance.
*/
_initializePromiseDebugger: function () {
let iframe = this._promiseDebuggerIframe = document.createElement("iframe");
iframe.setAttribute("flex", 1);
let onLoad = (event) => {
iframe.removeEventListener("load", onLoad, true);
let doc = event.target;
let win = doc.defaultView;
win.setPanel(DebuggerController._toolbox);
};
iframe.addEventListener("load", onLoad, true);
iframe.setAttribute("src", PROMISE_DEBUGGER_URL);
this._promisePane.appendChild(iframe);
},
/**
* Destroy the Promise Debugger instance.
*/
_destroyPromiseDebugger: function () {
if (this._promiseDebuggerIframe) {
this._promiseDebuggerIframe.contentWindow.destroy();
this._promiseDebuggerIframe.parentNode.removeChild(
this._promiseDebuggerIframe);
this._promiseDebuggerIframe = null;
}
},
/**
* Initializes the Editor instance.
*

View File

@@ -341,11 +341,6 @@
class="devtools-toolbarbutton"
tooltiptext="&debuggerUI.sources.toggleBreakpoints;"
command="toggleBreakpointsCommand"/>
<toolbarbutton id="toggle-promise-debugger"
class="devtools-toolbarbutton"
tooltiptext="&debuggerUI.sources.togglePromiseDebugger;"
command="togglePromiseDebuggerCommand"
hidden="true"/>
</toolbar>
</tabpanel>
<tabpanel id="callstack-tabpanel">
@@ -403,12 +398,6 @@
</tabpanels>
</tabbox>
</hbox>
<splitter id="editor-and-promise-splitter"
class="devtools-horizontal-splitter"/>
<vbox id="promise-debugger-pane"
flex="1"
hidden="true">
</vbox>
</vbox>
<splitter id="vertical-layout-splitter"
class="devtools-horizontal-splitter"/>

View File

@@ -125,17 +125,11 @@ function testHost(aPanel, aHostType, aLayoutType) {
"The workers and sources pane's parent is correct for the horizontal layout.");
is(gView._instrumentsPane.parentNode.id, "editor-and-instruments-pane",
"The instruments pane's parent is correct for the horizontal layout.");
is(gDebugger.document.getElementById("promise-debugger-pane").parentNode.id,
"debugger-content",
"The promise pane's parent is correct for the horizontal layout.");
} else {
is(gView._workersAndSourcesPane.parentNode.id, "vertical-layout-panes-container",
"The workers and sources pane's parent is correct for the vertical layout.");
is(gView._instrumentsPane.parentNode.id, "vertical-layout-panes-container",
"The instruments pane's parent is correct for the vertical layout.");
is(gDebugger.document.getElementById("promise-debugger-pane").parentNode.id,
"debugger-content",
"The promise pane's parent is correct for the horizontal layout.");
}
let widgets = gDebugger.document.getElementById("debugger-widgets").childNodes;
@@ -148,7 +142,7 @@ function testHost(aPanel, aHostType, aLayoutType) {
if (aLayoutType == "horizontal") {
is(widgets.length, 5, // 1 pane, 1 content box, 2 splitters and a phantom box.
"Found the correct number of debugger widgets.");
is(content.length, 3, // 2 panes, 1 splitter.
is(content.length, 1, // 1 pane
"Found the correct number of debugger content.");
is(editorPane.length, 3, // 2 panes, 1 splitter
"Found the correct number of debugger panes.");
@@ -157,7 +151,7 @@ function testHost(aPanel, aHostType, aLayoutType) {
} else {
is(widgets.length, 4, // 1 content box, 2 splitters and a phantom box.
"Found the correct number of debugger widgets.");
is(content.length, 3, // 2 panes, 1 splitter.
is(content.length, 1, // 1 pane
"Found the correct number of debugger content.");
is(editorPane.length, 2, // 1 pane, 1 splitter
"Found the correct number of debugger panes.");

View File

@@ -101,9 +101,6 @@ devtools.jar:
content/performance/views/recordings.js (performance/views/recordings.js)
content/memory/memory.xhtml (memory/memory.xhtml)
content/memory/initializer.js (memory/initializer.js)
content/promisedebugger/promise-controller.js (promisedebugger/promise-controller.js)
content/promisedebugger/promise-panel.js (promisedebugger/promise-panel.js)
content/promisedebugger/promise-debugger.xhtml (promisedebugger/promise-debugger.xhtml)
content/commandline/commandline.css (commandline/commandline.css)
content/commandline/commandlineoutput.xhtml (commandline/commandlineoutput.xhtml)
content/commandline/commandlinetooltip.xhtml (commandline/commandlinetooltip.xhtml)

View File

@@ -50,10 +50,6 @@
- button that toggles all breakpoints for all sources. -->
<!ENTITY debuggerUI.sources.toggleBreakpoints "Enable/disable all breakpoints">
<!-- LOCALIZATION NOTE (debuggerUI.sources.togglePromiseDebugger): This is the
- tooltip for the button that toggles the promise debugger. -->
<!ENTITY debuggerUI.sources.togglePromiseDebugger "Toggle Promise Debugger">
<!-- LOCALIZATION NOTE (debuggerUI.clearButton): This is the label for
- the button that clears the collected tracing data in the tracing tab. -->
<!ENTITY debuggerUI.clearButton "Clear">

View File

@@ -1,15 +0,0 @@
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<!-- LOCALIZATION NOTE : FILE This file contains the Promise debugger panel
strings. The Promise debugger panel is part of the debugger -->
<!-- LOCALIZATION NOTE : FILE Do not translate commandkey -->
<!-- LOCALIZATION NOTE : FILE The correct localization of this file might be to
- keep it in English, or another language commonly spoken among web developers.
- You want to make that choice consistent across the developer tools.
- A good criteria is the language in which you'd find the best
- documentation on web development on the web. -->
<!ENTITY title "Promise Debugger">

View File

@@ -22,7 +22,6 @@ DIRS += [
'performance',
'preferences',
'projecteditor',
'promisedebugger',
'responsive.html',
'responsivedesign',
'scratchpad',

View File

@@ -100,7 +100,6 @@ pref("devtools.debugger.pretty-print-enabled", true);
pref("devtools.debugger.auto-pretty-print", false);
pref("devtools.debugger.auto-black-box", true);
pref("devtools.debugger.workers", false);
pref("devtools.debugger.promise", false);
#if defined(NIGHTLY_BUILD)
pref("devtools.debugger.new-debugger-frontend", true);

View File

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

View File

@@ -1,102 +0,0 @@
/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
/* 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/. */
/* global PromisesPanel */
"use strict";
var { utils: Cu } = Components;
const { loader, require } =
Cu.import("resource://devtools/shared/Loader.jsm", {});
const { Task } = require("devtools/shared/task");
loader.lazyRequireGetter(this, "promise");
loader.lazyRequireGetter(this, "EventEmitter",
"devtools/shared/event-emitter");
loader.lazyRequireGetter(this, "DevToolsUtils",
"devtools/shared/DevToolsUtils");
loader.lazyRequireGetter(this, "PromisesFront",
"devtools/server/actors/promises", true);
// Global toolbox, set when startup is called.
var gToolbox;
/**
* Initialize the promise debugger controller and view upon loading the iframe.
*/
var startup = Task.async(function* (toolbox) {
gToolbox = toolbox;
yield PromisesController.initialize(toolbox);
yield PromisesPanel.initialize();
});
/**
* Destroy the promise debugger controller and view when unloading the iframe.
*/
var shutdown = Task.async(function* () {
yield PromisesController.destroy();
yield PromisesPanel.destroy();
gToolbox = null;
});
function setPanel(toolbox) {
return startup(toolbox).catch(e =>
DevToolsUtils.reportException("setPanel", e));
}
function destroy() {
return shutdown().catch(e => DevToolsUtils.reportException("destroy", e));
}
/**
* The promisedebugger controller's job is to retrieve PromisesFronts from the
* server.
*/
var PromisesController = {
initialize: Task.async(function* () {
if (this.initialized) {
return this.initialized.promise;
}
this.initialized = promise.defer();
let target = gToolbox.target;
this.promisesFront = new PromisesFront(target.client, target.form);
yield this.promisesFront.attach();
if (this.destroyed) {
console.warn("Could not fully initialize the PromisesController");
return null;
}
this.initialized.resolve();
}),
destroy: Task.async(function* () {
if (!this.initialized) {
return null;
}
if (this.destroyed) {
return this.destroyed.promise;
}
this.destroyed = promise.defer();
if (this.promisesFront) {
yield this.promisesFront.detach();
this.promisesFront.destroy();
this.promisesFront = null;
}
this.destroyed.resolve();
}),
};
EventEmitter.decorate(PromisesController);

View File

@@ -1,21 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- This Source Code Form is subject to the terms of the Mkozilla 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/. -->
<!DOCTYPE html [
<!ENTITY % promisedebuggerDTD SYSTEM "chrome://devtools/locale/promisedebugger.dtd">
%promisedebuggerDTD;
]>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>&title;</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<script type="application/javascript;version=1.8" src="chrome://devtools/content/shared/theme-switching.js"/>
</head>
<body class="devtools-monospace" role="application">
<script type="application/javascript;version=1.8" src="promise-controller.js"></script>
<script type="application/javascript;version=1.8" src="promise-panel.js"></script>
</body>
</html>

View File

@@ -1,45 +0,0 @@
/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
/* 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/. */
/* global PromisesController, promise */
/* import-globals-from promise-controller.js */
"use strict";
/**
* The main promise debugger UI.
*/
var PromisesPanel = {
PANEL_INITIALIZED: "panel-initialized",
initialize: Task.async(function* () {
if (PromisesController.destroyed) {
return null;
}
if (this.initialized) {
return this.initialized.promise;
}
this.initialized = promise.defer();
this.initialized.resolve();
this.emit(this.PANEL_INITIALIZED);
}),
destroy: Task.async(function* () {
if (!this.initialized) {
return null;
}
if (this.destroyed) {
return this.destroyed.promise;
}
this.destroyed = promise.defer();
this.destroyed.resolve();
}),
};
EventEmitter.decorate(PromisesPanel);

View File

@@ -1,6 +0,0 @@
"use strict";
module.exports = {
// Extend from the shared list of defined globals for mochitests.
"extends": "../../../.eslintrc.mochitests.js"
};

View File

@@ -1,4 +0,0 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";

View File

@@ -129,10 +129,6 @@
filter: none;
}
#toggle-promise-debugger {
/* TODO Bug 1186119: Add a toggle promise debugger image */
}
#sources .black-boxed {
color: rgba(128,128,128,0.4);
}