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

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: 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
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);
}
},

Powered by Google App Engine
This is Rietveld 408576698