Backed out changeset 0714a2e98d5e (bug 900763) for suspicion of causing widespread devtools leaks on a CLOSED TREE.
authorRyan VanderMeulen <ryanvm@gmail.com>
Tue, 22 Mar 2016 23:46:38 -0400
changeset 289935 5fb327f00d9379e4771bfb313fdd93439824518e
parent 289934 76d23219d38e5c37a91d2f12bb69692d9eead5d9
child 289936 7a3f8d12197fdff514ef2289ea6a1e7758f180b5
push id19656
push usergwagner@mozilla.com
push dateMon, 04 Apr 2016 13:43:23 +0000
treeherderb2g-inbound@e99061fde28a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs900763
milestone48.0a1
backs out0714a2e98d5e090b310742d588ac6f53c125a8dd
Backed out changeset 0714a2e98d5e (bug 900763) for suspicion of causing widespread devtools leaks on a CLOSED TREE.
devtools/client/debugger/content/views/sources-view.js
devtools/client/debugger/debugger-view.js
devtools/client/debugger/debugger.xul
devtools/client/locales/en-US/debugger.dtd
devtools/client/sourceeditor/editor.js
--- a/devtools/client/debugger/content/views/sources-view.js
+++ b/devtools/client/debugger/content/views/sources-view.js
@@ -58,17 +58,16 @@ function SourcesView(controller, Debugge
   this._onStopBlackBoxing = this._onStopBlackBoxing.bind(this);
   this._onBreakpointRemoved = this._onBreakpointRemoved.bind(this);
   this._onBreakpointClick = this._onBreakpointClick.bind(this);
   this._onBreakpointCheckboxClick = this._onBreakpointCheckboxClick.bind(this);
   this._onConditionalPopupShowing = this._onConditionalPopupShowing.bind(this);
   this._onConditionalPopupShown = this._onConditionalPopupShown.bind(this);
   this._onConditionalPopupHiding = this._onConditionalPopupHiding.bind(this);
   this._onConditionalTextboxKeyPress = this._onConditionalTextboxKeyPress.bind(this);
-  this._onEditorContextMenuOpen = this._onEditorContextMenuOpen.bind(this);
   this._onCopyUrlCommand = this._onCopyUrlCommand.bind(this);
   this._onNewTabCommand = this._onNewTabCommand.bind(this);
 }
 
 SourcesView.prototype = Heritage.extend(WidgetMethods, {
   /**
    * Initialization function, called when the debugger is started.
    */
@@ -130,18 +129,16 @@ SourcesView.prototype = Heritage.extend(
     // Sort known source groups towards the end of the list
     this.widget.groupSortPredicate = function(a, b) {
       if ((a in KNOWN_SOURCE_GROUPS) == (b in KNOWN_SOURCE_GROUPS)) {
         return a.localeCompare(b);
       }
       return (a in KNOWN_SOURCE_GROUPS) ? 1 : -1;
     };
 
-    this.DebuggerView.editor.on("onPopupOpen", this._onEditorContextMenuOpen);
-
     this._addCommands();
   },
 
   /**
    * Destruction function, called when the debugger is closed.
    */
   destroy: function() {
     dumpn("Destroying the SourcesView");
@@ -149,17 +146,16 @@ SourcesView.prototype = Heritage.extend(
     this.widget.removeEventListener("select", this._onSourceSelect, false);
     this._stopBlackBoxButton.removeEventListener("click", this._onStopBlackBoxing, false);
     this._cbPanel.removeEventListener("popupshowing", this._onConditionalPopupShowing, false);
     this._cbPanel.removeEventListener("popupshowing", this._onConditionalPopupShown, false);
     this._cbPanel.removeEventListener("popuphiding", this._onConditionalPopupHiding, false);
     this._cbTextbox.removeEventListener("keypress", this._onConditionalTextboxKeyPress, false);
     this._copyUrlMenuItem.removeEventListener("command", this._onCopyUrlCommand, false);
     this._newTabMenuItem.removeEventListener("command", this._onNewTabCommand, false);
-    this.DebuggerView.editor.removeEventListener("onPopupOpen", this._onEditorContextMenuOpen, false);
   },
 
   empty: function() {
     WidgetMethods.empty.call(this);
     this._unnamedSourceIndex = 0;
     this._selectedBreakpoint = null;
   },
 
@@ -1077,39 +1073,16 @@ SourcesView.prototype = Heritage.extend(
   /**
    * The click listener for the "stop black boxing" button.
    */
   _onStopBlackBoxing: Task.async(function*() {
     this.actions.blackbox(getSelectedSource(this.getState()), false);
   }),
 
   /**
-   * The source editor's contextmenu handler.
-   * - Toggles "Add Conditional Breakpoint" and "Edit Conditional Breakpoint" items
-   */
-  _onEditorContextMenuOpen: function(message, ev, popup) {
-    let actor = this.selectedValue;
-    let line = this.DebuggerView.editor.getCursor().line + 1;
-    let location = { actor, line };
-
-    let breakpoint = getBreakpoint(this.getState(), location);
-    let addConditionalBreakpointMenuItem = popup.querySelector("#se-dbg-cMenu-addConditionalBreakpoint");
-    let editConditionalBreakpointMenuItem = popup.querySelector("#se-dbg-cMenu-editConditionalBreakpoint");
-
-    if (breakpoint && !!breakpoint.condition) {
-      editConditionalBreakpointMenuItem.removeAttribute("hidden");
-      addConditionalBreakpointMenuItem.setAttribute("hidden", true);
-    }
-    else {
-      addConditionalBreakpointMenuItem.removeAttribute("hidden");
-      editConditionalBreakpointMenuItem.setAttribute("hidden", true);
-    }
-  },
-
-  /**
    * The click listener for a breakpoint container.
    */
   _onBreakpointClick: function(e) {
     let sourceItem = this.getItemForElement(e.target);
     let breakpointItem = this.getItemForElement.call(sourceItem, e.target);
     let attachment = breakpointItem.attachment;
     let bp = getBreakpoint(this.getState(), attachment);
     if (bp) {
--- a/devtools/client/debugger/debugger-view.js
+++ b/devtools/client/debugger/debugger-view.js
@@ -62,30 +62,30 @@ var DebuggerView = {
   initialize: function() {
     if (this._startup) {
       return this._startup;
     }
     const deferred = promise.defer();
     this._startup = deferred.promise;
 
     this._initializePanes();
-    this._initializeEditor(deferred.resolve);
     this.Toolbar.initialize();
     this.Options.initialize();
     this.Filtering.initialize();
     this.StackFrames.initialize();
     this.StackFramesClassicList.initialize();
     this.Workers.initialize();
     this.Sources.initialize();
     this.VariableBubble.initialize();
     this.WatchExpressions.initialize();
     this.EventListeners.initialize();
     this.GlobalSearch.initialize();
     this._initializeVariablesView();
 
+    this._initializeEditor(deferred.resolve);
     this._editorSource = {};
 
     document.title = L10N.getStr("DebuggerWindowTitle");
 
     this.editor.on("cursorActivity", this.Sources._onEditorCursorActivity);
 
     this.controller = DebuggerController;
     const getState = this.controller.getState;
--- a/devtools/client/debugger/debugger.xul
+++ b/devtools/client/debugger/debugger.xul
@@ -49,20 +49,16 @@
       <menuitem id="se-dbg-cMenu-addBreakpoint"
                 label="&debuggerUI.seMenuBreak;"
                 key="addBreakpointKey"
                 command="addBreakpointCommand"/>
       <menuitem id="se-dbg-cMenu-addConditionalBreakpoint"
                 label="&debuggerUI.seMenuCondBreak;"
                 key="addConditionalBreakpointKey"
                 command="addConditionalBreakpointCommand"/>
-      <menuitem id="se-dbg-cMenu-editConditionalBreakpoint"
-                label="&debuggerUI.seEditMenuCondBreak;"
-                key="addConditionalBreakpointKey"
-                command="addConditionalBreakpointCommand"/>
       <menuitem id="se-dbg-cMenu-addAsWatch"
                 label="&debuggerUI.seMenuAddWatch;"
                 key="addWatchExpressionKey"
                 command="addWatchExpressionCommand"/>
       <menuseparator/>
       <menuitem id="cMenu_copy"/>
       <menuseparator/>
       <menuitem id="cMenu_selectAll"/>
--- a/devtools/client/locales/en-US/debugger.dtd
+++ b/devtools/client/locales/en-US/debugger.dtd
@@ -162,21 +162,16 @@
 <!ENTITY debuggerUI.seMenuBreak.key "B">
 
 <!-- LOCALIZATION NOTE (debuggerUI.seMenuCondBreak): This is the text that
   -  appears in the source editor context menu for adding a conditional
   -  breakpoint. -->
 <!ENTITY debuggerUI.seMenuCondBreak     "Add Conditional Breakpoint">
 <!ENTITY debuggerUI.seMenuCondBreak.key "B">
 
-<!-- LOCALIZATION NOTE (debuggerUI.seMenuBreak): This is the text that
-  -  appears in the source editor context menu for editing a breakpoint. -->
-<!ENTITY debuggerUI.seEditMenuCondBreak     "Edit Conditional Breakpoint">
-<!ENTITY debuggerUI.seEditMenuCondBreak.key "B">
-
 <!-- LOCALIZATION NOTE (debuggerUI.tabs.*): This is the text that
   -  appears in the debugger's side pane tabs. -->
 <!ENTITY debuggerUI.tabs.workers        "Workers">
 <!ENTITY debuggerUI.tabs.sources        "Sources">
 <!ENTITY debuggerUI.tabs.traces         "Traces">
 <!ENTITY debuggerUI.tabs.callstack      "Call Stack">
 <!ENTITY debuggerUI.tabs.variables      "Variables">
 <!ENTITY debuggerUI.tabs.events         "Events">
--- a/devtools/client/sourceeditor/editor.js
+++ b/devtools/client/sourceeditor/editor.js
@@ -332,18 +332,16 @@ Editor.prototype = {
         if (!this.config.contextMenu) {
           return;
         }
 
         let popup = this.config.contextMenu;
         if (typeof popup == "string") {
           popup = el.ownerDocument.getElementById(this.config.contextMenu);
         }
-
-        this.emit("onPopupOpen",  ev, popup);
         popup.openPopupAtScreen(ev.screenX, ev.screenY, true);
       }, false);
 
       // Intercept the find and find again keystroke on CodeMirror, to avoid
       // the browser's search
 
       let findKey = L10N.GetStringFromName("find.commandkey");
       let findAgainKey = L10N.GetStringFromName("findAgain.commandkey");