| 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 c02c26fc0ec8a7e1fc63988c45fd1d6c84b7cfc5..10413cfa00d6716524ee482e4b7a5bf9df210df8 100644
|
| --- a/third_party/WebKit/Source/devtools/front_end/sdk/Script.js
|
| +++ b/third_party/WebKit/Source/devtools/front_end/sdk/Script.js
|
| @@ -71,6 +71,8 @@ SDK.Script = class {
|
| this._isLiveEdit = isLiveEdit;
|
| this.sourceMapURL = sourceMapURL;
|
| this.hasSourceURL = hasSourceURL;
|
| + this._originalContentProvider = null;
|
| + this._originalSource = null;
|
| }
|
|
|
| /**
|
| @@ -186,11 +188,25 @@ SDK.Script = class {
|
| } else {
|
| this._source = '';
|
| }
|
| + if (this._originalSource === null)
|
| + this._originalSource = this._source;
|
| callback(this._source);
|
| }
|
| }
|
|
|
| /**
|
| + * @return {!Common.ContentProvider}
|
| + */
|
| + originalContentProvider() {
|
| + if (!this._originalContentProvider) {
|
| + var lazyContent = () => this.requestContent().then(() => this._originalSource);
|
| + this._originalContentProvider =
|
| + new Common.StaticContentProvider(this.contentURL(), this.contentType(), lazyContent);
|
| + }
|
| + return this._originalContentProvider;
|
| + }
|
| +
|
| + /**
|
| * @override
|
| * @param {string} query
|
| * @param {boolean} caseSensitive
|
| @@ -261,8 +277,9 @@ SDK.Script = class {
|
| newSource = this._appendSourceURLCommentIfNeeded(newSource);
|
|
|
| if (this.scriptId) {
|
| - this.debuggerModel.target().debuggerAgent().setScriptSource(
|
| - this.scriptId, newSource, undefined, didEditScriptSource.bind(this));
|
| + this.requestContent().then(
|
| + () => this.debuggerModel.target().debuggerAgent().setScriptSource(
|
| + this.scriptId, newSource, undefined, didEditScriptSource.bind(this)));
|
| } else {
|
| callback('Script failed to parse');
|
| }
|
|
|