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

Unified Diff: third_party/WebKit/Source/devtools/front_end/sdk/Script.js

Issue 2851913002: [DevTools] Do not expose agents on Target
Patch Set: storage and tests.js Created 3 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/devtools/front_end/sdk/Script.js
diff --git a/third_party/WebKit/Source/devtools/front_end/sdk/Script.js b/third_party/WebKit/Source/devtools/front_end/sdk/Script.js
index 1a019d4efdebdb10264408ba2df824e8c6af1a1e..3a1033d565ea8849b5c91a8a58bf10371ea962e9 100644
--- a/third_party/WebKit/Source/devtools/front_end/sdk/Script.js
+++ b/third_party/WebKit/Source/devtools/front_end/sdk/Script.js
@@ -30,6 +30,7 @@
SDK.Script = class {
/**
* @param {!SDK.DebuggerModel} debuggerModel
+ * @param {!Protocol.DebuggerAgent} debuggerAgent
* @param {string} scriptId
* @param {string} sourceURL
* @param {number} startLine
@@ -45,9 +46,10 @@ SDK.Script = class {
* @param {number} length
*/
constructor(
- debuggerModel, scriptId, sourceURL, startLine, startColumn, endLine, endColumn, executionContextId, hash,
- isContentScript, isLiveEdit, sourceMapURL, hasSourceURL, length) {
+ debuggerModel, debuggerAgent, scriptId, sourceURL, startLine, startColumn, endLine, endColumn, executionContextId,
+ hash, isContentScript, isLiveEdit, sourceMapURL, hasSourceURL, length) {
this.debuggerModel = debuggerModel;
+ this._debuggerAgent = debuggerAgent;
this.scriptId = scriptId;
this.sourceURL = sourceURL;
this.lineOffset = startLine;
@@ -135,7 +137,7 @@ SDK.Script = class {
var callback;
var promise = new Promise(fulfill => callback = fulfill);
- this.debuggerModel.target().debuggerAgent().getScriptSource(this.scriptId, didGetScriptSource.bind(this));
+ this._debuggerAgent.getScriptSource(this.scriptId, didGetScriptSource.bind(this));
return promise;
/**
@@ -192,8 +194,7 @@ SDK.Script = class {
if (this.scriptId) {
// Script failed to parse.
- this.debuggerModel.target().debuggerAgent().searchInContent(
- this.scriptId, query, caseSensitive, isRegex, innerCallback);
+ this._debuggerAgent.searchInContent(this.scriptId, query, caseSensitive, isRegex, innerCallback);
} else {
callback([]);
}
@@ -235,8 +236,8 @@ SDK.Script = class {
if (this.scriptId) {
this.requestContent().then(
- () => this.debuggerModel.target().debuggerAgent().setScriptSource(
- this.scriptId, newSource, undefined, didEditScriptSource.bind(this)));
+ () =>
+ this._debuggerAgent.setScriptSource(this.scriptId, newSource, undefined, didEditScriptSource.bind(this)));
} else {
callback('Script failed to parse');
}
@@ -286,7 +287,7 @@ SDK.Script = class {
* @this {SDK.Script}
*/
function setBlackboxedRanges(fulfill, reject) {
- this.debuggerModel.target().debuggerAgent().setBlackboxedRanges(this.scriptId, positions, callback);
+ this._debuggerAgent.setBlackboxedRanges(this.scriptId, positions, callback);
/**
* @param {?Protocol.Error} error
*/

Powered by Google App Engine
This is Rietveld 408576698