Index: Source/devtools/blink/chromeServerProfile/Default/Cache/f_000066 |
diff --git a/Source/devtools/front_end/ScriptSnippetModel.js b/Source/devtools/blink/chromeServerProfile/Default/Cache/f_000066 |
similarity index 95% |
copy from Source/devtools/front_end/ScriptSnippetModel.js |
copy to Source/devtools/blink/chromeServerProfile/Default/Cache/f_000066 |
index b5ef0bc98e35e6a4437f6c13169ea27aecaced54..7e5e46e55178618205a34efee30898116c42d28b 100644 |
--- a/Source/devtools/front_end/ScriptSnippetModel.js |
+++ b/Source/devtools/blink/chromeServerProfile/Default/Cache/f_000066 |
@@ -48,9 +48,8 @@ WebInspector.ScriptSnippetModel = function(workspace) |
this._snippetStorage = new WebInspector.SnippetStorage("script", "Script snippet #"); |
this._lastSnippetEvaluationIndexSetting = WebInspector.settings.createSetting("lastSnippetEvaluationIndex", 0); |
this._snippetScriptMapping = new WebInspector.SnippetScriptMapping(this); |
- this._projectId = WebInspector.projectTypes.Snippets + ":"; |
- this._projectDelegate = new WebInspector.SnippetsProjectDelegate(workspace, this, this._projectId); |
- this._project = this._workspace.project(this._projectId); |
+ this._projectDelegate = new WebInspector.SnippetsProjectDelegate(this); |
+ this._project = this._workspace.addProject(this._projectDelegate); |
this.reset(); |
WebInspector.debuggerModel.addEventListener(WebInspector.DebuggerModel.Events.GlobalObjectCleared, this._debuggerReset, this); |
} |
@@ -97,7 +96,7 @@ WebInspector.ScriptSnippetModel.prototype = { |
_addScriptSnippet: function(snippet) |
{ |
var path = this._projectDelegate.addSnippet(snippet.name, new WebInspector.SnippetContentProvider(snippet)); |
- var uiSourceCode = this._workspace.uiSourceCode(this._projectId, path); |
+ var uiSourceCode = this._workspace.uiSourceCode(this._projectDelegate.id(), path); |
if (!uiSourceCode) { |
console.assert(uiSourceCode); |
return ""; |
@@ -115,7 +114,7 @@ WebInspector.ScriptSnippetModel.prototype = { |
*/ |
deleteScriptSnippet: function(path) |
{ |
- var uiSourceCode = this._workspace.uiSourceCode(this._projectId, path); |
+ var uiSourceCode = this._workspace.uiSourceCode(this._projectDelegate.id(), path); |
if (!uiSourceCode) |
return; |
var snippetId = this._snippetIdForUISourceCode.get(uiSourceCode) || ""; |
@@ -204,9 +203,7 @@ WebInspector.ScriptSnippetModel.prototype = { |
var expression = uiSourceCode.workingCopy(); |
WebInspector.console.show(); |
- var executionContext = WebInspector.runtimeModel.currentExecutionContext(); |
- var executionContextId = executionContext ? executionContext.id : undefined; |
- DebuggerAgent.compileScript(expression, evaluationUrl, executionContextId, compileCallback.bind(this)); |
+ DebuggerAgent.compileScript(expression, evaluationUrl, compileCallback.bind(this)); |
/** |
* @param {?string} error |
@@ -237,17 +234,17 @@ WebInspector.ScriptSnippetModel.prototype = { |
var breakpointLocations = this._removeBreakpoints(uiSourceCode); |
this._restoreBreakpoints(uiSourceCode, breakpointLocations); |
- this._runScript(scriptId, executionContextId); |
+ this._runScript(scriptId); |
} |
}, |
/** |
* @param {!DebuggerAgent.ScriptId} scriptId |
- * @param {number=} executionContextId |
*/ |
- _runScript: function(scriptId, executionContextId) |
+ _runScript: function(scriptId) |
{ |
- DebuggerAgent.runScript(scriptId, executionContextId, "console", false, runCallback.bind(this)); |
+ var currentExecutionContext = WebInspector.runtimeModel.currentExecutionContext(); |
+ DebuggerAgent.runScript(scriptId, currentExecutionContext ? currentExecutionContext.id : undefined, "console", false, runCallback.bind(this)); |
/** |
* @param {?string} error |
@@ -295,7 +292,7 @@ WebInspector.ScriptSnippetModel.prototype = { |
var uiSourceCode = this._uiSourceCodeForScriptId[rawLocation.scriptId]; |
if (!uiSourceCode) |
return null; |
- return uiSourceCode.uiLocation(rawLocation.lineNumber, rawLocation.columnNumber || 0); |
+ return new WebInspector.UILocation(uiSourceCode, rawLocation.lineNumber, rawLocation.columnNumber || 0); |
}, |
/** |
@@ -609,18 +606,25 @@ WebInspector.SnippetContentProvider.prototype = { |
/** |
* @constructor |
* @extends {WebInspector.ContentProviderBasedProjectDelegate} |
- * @param {!WebInspector.Workspace} workspace |
* @param {!WebInspector.ScriptSnippetModel} model |
- * @param {string} id |
*/ |
-WebInspector.SnippetsProjectDelegate = function(workspace, model, id) |
+WebInspector.SnippetsProjectDelegate = function(model) |
{ |
- WebInspector.ContentProviderBasedProjectDelegate.call(this, workspace, id, WebInspector.projectTypes.Snippets); |
+ WebInspector.ContentProviderBasedProjectDelegate.call(this, WebInspector.projectTypes.Snippets); |
this._model = model; |
} |
WebInspector.SnippetsProjectDelegate.prototype = { |
/** |
+ * @override |
+ * @return {string} |
+ */ |
+ id: function() |
+ { |
+ return WebInspector.projectTypes.Snippets + ":"; |
+ }, |
+ |
+ /** |
* @param {string} name |
* @param {!WebInspector.ContentProvider} contentProvider |
* @return {string} |