Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(386)

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/sources/JavaScriptCompiler.js

Issue 2752403002: [DevTools] Migrate usages of Target to RuntimeModel where makes sense (Closed)
Patch Set: review comments addressed Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 /** 4 /**
5 * @unrestricted 5 * @unrestricted
6 */ 6 */
7 Sources.JavaScriptCompiler = class { 7 Sources.JavaScriptCompiler = class {
8 /** 8 /**
9 * @param {!Sources.JavaScriptSourceFrame} sourceFrame 9 * @param {!Sources.JavaScriptSourceFrame} sourceFrame
10 */ 10 */
(...skipping 14 matching lines...) Expand all
25 25
26 /** 26 /**
27 * @return {?SDK.RuntimeModel} 27 * @return {?SDK.RuntimeModel}
28 */ 28 */
29 _findRuntimeModel() { 29 _findRuntimeModel() {
30 var debuggerModels = SDK.targetManager.models(SDK.DebuggerModel); 30 var debuggerModels = SDK.targetManager.models(SDK.DebuggerModel);
31 var sourceCode = this._sourceFrame.uiSourceCode(); 31 var sourceCode = this._sourceFrame.uiSourceCode();
32 for (var i = 0; i < debuggerModels.length; ++i) { 32 for (var i = 0; i < debuggerModels.length; ++i) {
33 var scriptFile = Bindings.debuggerWorkspaceBinding.scriptFile(sourceCode, debuggerModels[i]); 33 var scriptFile = Bindings.debuggerWorkspaceBinding.scriptFile(sourceCode, debuggerModels[i]);
34 if (scriptFile) 34 if (scriptFile)
35 return debuggerModels[i].target().runtimeModel; 35 return debuggerModels[i].runtimeModel();
36 } 36 }
37 return SDK.targetManager.mainTarget() ? SDK.targetManager.mainTarget().runti meModel : null; 37 return SDK.targetManager.mainTarget() ? SDK.targetManager.mainTarget().runti meModel : null;
38 } 38 }
39 39
40 _compile() { 40 _compile() {
41 var runtimeModel = this._findRuntimeModel(); 41 var runtimeModel = this._findRuntimeModel();
42 if (!runtimeModel) 42 if (!runtimeModel)
43 return; 43 return;
44 var currentExecutionContext = UI.context.flavor(SDK.ExecutionContext); 44 var currentExecutionContext = UI.context.flavor(SDK.ExecutionContext);
45 if (!currentExecutionContext) 45 if (!currentExecutionContext)
(...skipping 22 matching lines...) Expand all
68 Workspace.UISourceCode.Message.Level.Error, text, exceptionDetails.lin eNumber, exceptionDetails.columnNumber); 68 Workspace.UISourceCode.Message.Level.Error, text, exceptionDetails.lin eNumber, exceptionDetails.columnNumber);
69 this._compilationFinishedForTest(); 69 this._compilationFinishedForTest();
70 } 70 }
71 } 71 }
72 72
73 _compilationFinishedForTest() { 73 _compilationFinishedForTest() {
74 } 74 }
75 }; 75 };
76 76
77 Sources.JavaScriptCompiler.CompileDelay = 1000; 77 Sources.JavaScriptCompiler.CompileDelay = 1000;
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698