| Index: third_party/WebKit/Source/devtools/front_end/workspace/UISourceCode.js
|
| diff --git a/third_party/WebKit/Source/devtools/front_end/workspace/UISourceCode.js b/third_party/WebKit/Source/devtools/front_end/workspace/UISourceCode.js
|
| index 5a4b67350debc272e9e6ff0a9935a348def3f45a..eb25c7ea4f5912b98f9e80b5836fe4fec67a6cec 100644
|
| --- a/third_party/WebKit/Source/devtools/front_end/workspace/UISourceCode.js
|
| +++ b/third_party/WebKit/Source/devtools/front_end/workspace/UISourceCode.js
|
| @@ -222,44 +222,11 @@ Workspace.UISourceCode = class extends Common.Object {
|
| return promise;
|
| }
|
|
|
| - /**
|
| - * @param {function()} callback
|
| - */
|
| - _pushCheckContentUpdatedCallback(callback) {
|
| - if (!this._checkContentUpdatedCallbacks)
|
| - this._checkContentUpdatedCallbacks = [];
|
| - this._checkContentUpdatedCallbacks.push(callback);
|
| - }
|
| -
|
| - _terminateContentCheck() {
|
| - delete this._checkingContent;
|
| - if (this._checkContentUpdatedCallbacks) {
|
| - this._checkContentUpdatedCallbacks.forEach(function(callback) {
|
| - callback();
|
| - });
|
| - delete this._checkContentUpdatedCallbacks;
|
| - }
|
| - }
|
| -
|
| - /**
|
| - * @param {boolean=} forceLoad
|
| - * @param {function()=} callback
|
| - */
|
| - checkContentUpdated(forceLoad, callback) {
|
| - callback = callback || function() {};
|
| - forceLoad = forceLoad || this._forceLoadOnCheckContent;
|
| - if (!this.contentLoaded() && !forceLoad) {
|
| - callback();
|
| + checkContentUpdated() {
|
| + if (!this._contentLoaded && !this._forceLoadOnCheckContent)
|
| return;
|
| - }
|
|
|
| - if (!this._project.canSetFileContent()) {
|
| - callback();
|
| - return;
|
| - }
|
| - this._pushCheckContentUpdatedCallback(callback);
|
| -
|
| - if (this._checkingContent)
|
| + if (!this._project.canSetFileContent() || this._checkingContent)
|
| return;
|
|
|
| this._checkingContent = true;
|
| @@ -270,27 +237,23 @@ Workspace.UISourceCode = class extends Common.Object {
|
| * @this {Workspace.UISourceCode}
|
| */
|
| function contentLoaded(updatedContent) {
|
| + this._checkingContent = false;
|
| if (updatedContent === null) {
|
| var workingCopy = this.workingCopy();
|
| this._contentCommitted('', false);
|
| this.setWorkingCopy(workingCopy);
|
| - this._terminateContentCheck();
|
| return;
|
| }
|
| - if (typeof this._lastAcceptedContent === 'string' && this._lastAcceptedContent === updatedContent) {
|
| - this._terminateContentCheck();
|
| + if (typeof this._lastAcceptedContent === 'string' && this._lastAcceptedContent === updatedContent)
|
| return;
|
| - }
|
|
|
| if (this._content === updatedContent) {
|
| delete this._lastAcceptedContent;
|
| - this._terminateContentCheck();
|
| return;
|
| }
|
|
|
| if (!this.isDirty() || this._workingCopy === updatedContent) {
|
| this._contentCommitted(updatedContent, false);
|
| - this._terminateContentCheck();
|
| return;
|
| }
|
|
|
| @@ -300,7 +263,6 @@ Workspace.UISourceCode = class extends Common.Object {
|
| this._contentCommitted(updatedContent, false);
|
| else
|
| this._lastAcceptedContent = updatedContent;
|
| - this._terminateContentCheck();
|
| }
|
| }
|
|
|
|
|