Bug 907755 - Followups, r=fitzgen

This commit is contained in:
Victor Porof 2013-09-28 10:41:20 +03:00
parent b1565a78e6
commit 7a9f8f9a02

View File

@ -36,9 +36,6 @@ const DEFAULT_EDITOR_CONFIG = {
showOverviewRuler: true showOverviewRuler: true
}; };
//For telemetry
Cu.import("resource://gre/modules/Services.jsm")
/** /**
* Object defining the debugger view components. * Object defining the debugger view components.
*/ */
@ -279,13 +276,10 @@ let DebuggerView = {
if (this._editorSource.url == aSource.url && !aFlags.force) { if (this._editorSource.url == aSource.url && !aFlags.force) {
return this._editorSource.promise; return this._editorSource.promise;
} }
let transportType = DebuggerController.client.localTransport let transportType = gClient.localTransport ? "_LOCAL" : "_REMOTE";
? "_LOCAL"
: "_REMOTE";
//Telemetry probe
let histogramId = "DEVTOOLS_DEBUGGER_DISPLAY_SOURCE" + transportType + "_MS"; let histogramId = "DEVTOOLS_DEBUGGER_DISPLAY_SOURCE" + transportType + "_MS";
let histogram = Services.telemetry.getHistogramById(histogramId); let histogram = Services.telemetry.getHistogramById(histogramId);
let startTime = +new Date(); let startTime = Date.now();
let deferred = promise.defer(); let deferred = promise.defer();
@ -306,7 +300,7 @@ let DebuggerView = {
DebuggerView.Sources.selectedValue = aSource.url; DebuggerView.Sources.selectedValue = aSource.url;
DebuggerController.Breakpoints.updateEditorBreakpoints(); DebuggerController.Breakpoints.updateEditorBreakpoints();
histogram.add(+new Date() - startTime); histogram.add(Date.now() - startTime);
// Resolve and notify that a source file was shown. // Resolve and notify that a source file was shown.
window.emit(EVENTS.SOURCE_SHOWN, aSource); window.emit(EVENTS.SOURCE_SHOWN, aSource);