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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/snippets/ScriptSnippetModel.js

Issue 2546473005: [DevTools] Remove unnecessary checks for project types. (Closed)
Patch Set: fixed comment Created 4 years 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 /* 1 /*
2 * Copyright (C) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after
192 var evaluationIndex = this._lastSnippetEvaluationIndexSetting.get() + 1; 192 var evaluationIndex = this._lastSnippetEvaluationIndexSetting.get() + 1;
193 this._lastSnippetEvaluationIndexSetting.set(evaluationIndex); 193 this._lastSnippetEvaluationIndexSetting.set(evaluationIndex);
194 return evaluationIndex; 194 return evaluationIndex;
195 } 195 }
196 196
197 /** 197 /**
198 * @param {!SDK.ExecutionContext} executionContext 198 * @param {!SDK.ExecutionContext} executionContext
199 * @param {!Workspace.UISourceCode} uiSourceCode 199 * @param {!Workspace.UISourceCode} uiSourceCode
200 */ 200 */
201 evaluateScriptSnippet(executionContext, uiSourceCode) { 201 evaluateScriptSnippet(executionContext, uiSourceCode) {
202 console.assert(uiSourceCode.project().type() === Workspace.projectTypes.Snip pets);
202 var breakpointLocations = this._removeBreakpoints(uiSourceCode); 203 var breakpointLocations = this._removeBreakpoints(uiSourceCode);
203 this._releaseSnippetScript(uiSourceCode); 204 this._releaseSnippetScript(uiSourceCode);
204 this._restoreBreakpoints(uiSourceCode, breakpointLocations); 205 this._restoreBreakpoints(uiSourceCode, breakpointLocations);
205 206
206 var target = executionContext.target(); 207 var target = executionContext.target();
207 var runtimeModel = target.runtimeModel; 208 var runtimeModel = target.runtimeModel;
208 var evaluationIndex = this._nextEvaluationIndex(); 209 var evaluationIndex = this._nextEvaluationIndex();
209 var mapping = this._mappingForTarget.get(target); 210 var mapping = this._mappingForTarget.get(target);
210 mapping._setEvaluationIndex(evaluationIndex, uiSourceCode); 211 mapping._setEvaluationIndex(evaluationIndex, uiSourceCode);
211 var evaluationUrl = mapping._evaluationSourceURL(uiSourceCode); 212 var evaluationUrl = mapping._evaluationSourceURL(uiSourceCode);
(...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after
618 */ 619 */
619 deleteFile(url) { 620 deleteFile(url) {
620 this._model.deleteScriptSnippet(url); 621 this._model.deleteScriptSnippet(url);
621 } 622 }
622 }; 623 };
623 624
624 /** 625 /**
625 * @type {!Snippets.ScriptSnippetModel} 626 * @type {!Snippets.ScriptSnippetModel}
626 */ 627 */
627 Snippets.scriptSnippetModel = new Snippets.ScriptSnippetModel(Workspace.workspac e); 628 Snippets.scriptSnippetModel = new Snippets.ScriptSnippetModel(Workspace.workspac e);
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698