Chromium Code Reviews| Index: Source/devtools/front_end/UISourceCode.js |
| diff --git a/Source/devtools/front_end/UISourceCode.js b/Source/devtools/front_end/UISourceCode.js |
| index cf07f0b58f762dd85a315565698ee9922fe0bdbd..22ccf318fd256c1e35982ccf0fad746cb5db67ff 100644 |
| --- a/Source/devtools/front_end/UISourceCode.js |
| +++ b/Source/devtools/front_end/UISourceCode.js |
| @@ -262,14 +262,19 @@ WebInspector.UISourceCode.prototype = { |
| }, |
| /** |
| - * @param {function()=} callback |
| + * @param {function(boolean)=} callback |
|
vsevik
2014/03/28 16:18:36
Looks like this parameter is never used, why do yo
apavlov
2014/03/30 13:02:09
Previously, not all paths would invoke the callbac
|
| */ |
| checkContentUpdated: function(callback) |
| { |
| - if (!this._project.canSetFileContent()) |
| + callback = callback || function() {}; |
| + if (this._checkingContent) { |
|
vsevik
2014/03/28 16:18:36
Why did you swap the conditionals?
apavlov
2014/03/30 13:02:09
This happened after a few steps of refactoring :)
|
| + callback(false); |
| return; |
| - if (this._checkingContent) |
| + } |
| + if (!this._project.canSetFileContent()) { |
| + callback(true); |
| return; |
| + } |
| this._checkingContent = true; |
| this._project.requestFileContent(this, contentLoaded.bind(this)); |
| @@ -284,29 +289,25 @@ WebInspector.UISourceCode.prototype = { |
| this._commitContent("", false); |
| this.setWorkingCopy(workingCopy); |
| delete this._checkingContent; |
| - if (callback) |
| - callback(); |
| + callback(true); |
| return; |
| } |
| if (typeof this._lastAcceptedContent === "string" && this._lastAcceptedContent === updatedContent) { |
| delete this._checkingContent; |
| - if (callback) |
| - callback(); |
| + callback(true); |
| return; |
| } |
| if (this._content === updatedContent) { |
| delete this._lastAcceptedContent; |
| delete this._checkingContent; |
| - if (callback) |
| - callback(); |
| + callback(true); |
| return; |
| } |
| if (!this.isDirty()) { |
| this._commitContent(updatedContent, false); |
| delete this._checkingContent; |
| - if (callback) |
| - callback(); |
| + callback(true); |
| return; |
| } |
| @@ -316,8 +317,7 @@ WebInspector.UISourceCode.prototype = { |
| else |
| this._lastAcceptedContent = updatedContent; |
| delete this._checkingContent; |
| - if (callback) |
| - callback(); |
| + callback(true); |
| } |
| }, |