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

Unified Diff: Source/devtools/front_end/UISourceCode.js

Issue 216183003: DevTools: Make sure UISC content is up-to-date when running performSearchInContent() (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Comments addressed Created 6 years, 9 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
« no previous file with comments | « Source/devtools/front_end/SourcesSearchScope.js ('k') | Source/devtools/front_end/utilities.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..b9160e1ac1046b32e246d8e4e8ebe2fb374d285a 100644
--- a/Source/devtools/front_end/UISourceCode.js
+++ b/Source/devtools/front_end/UISourceCode.js
@@ -266,10 +266,15 @@ WebInspector.UISourceCode.prototype = {
*/
checkContentUpdated: function(callback)
{
- if (!this._project.canSetFileContent())
+ callback = callback || function() {};
+ if (!this._project.canSetFileContent()) {
+ callback();
return;
- if (this._checkingContent)
+ }
+ if (this._checkingContent) {
+ callback();
vsevik 2014/04/01 09:10:20 This one is actually incorrect, I don't think we s
apavlov 2014/04/01 09:12:25 That's why I initially had a boolean callback argu
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();
return;
}
if (typeof this._lastAcceptedContent === "string" && this._lastAcceptedContent === updatedContent) {
delete this._checkingContent;
- if (callback)
- callback();
+ callback();
return;
}
if (this._content === updatedContent) {
delete this._lastAcceptedContent;
delete this._checkingContent;
- if (callback)
- callback();
+ callback();
return;
}
if (!this.isDirty()) {
this._commitContent(updatedContent, false);
delete this._checkingContent;
- if (callback)
- callback();
+ callback();
return;
}
@@ -316,8 +317,7 @@ WebInspector.UISourceCode.prototype = {
else
this._lastAcceptedContent = updatedContent;
delete this._checkingContent;
- if (callback)
- callback();
+ callback();
}
},
« no previous file with comments | « Source/devtools/front_end/SourcesSearchScope.js ('k') | Source/devtools/front_end/utilities.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698