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

Unified Diff: Source/devtools/front_end/bindings/ResourceScriptMapping.js

Issue 1238103002: [DevTools] Do not report edited resources via Page.getResourceContent. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 5 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/bindings/ResourceScriptMapping.js
diff --git a/Source/devtools/front_end/bindings/ResourceScriptMapping.js b/Source/devtools/front_end/bindings/ResourceScriptMapping.js
index 88336246748f143c81202cc3158147d444897116..5aab2798b7dab9aaa180b40eafcdc227fede71cc 100644
--- a/Source/devtools/front_end/bindings/ResourceScriptMapping.js
+++ b/Source/devtools/front_end/bindings/ResourceScriptMapping.js
@@ -239,6 +239,10 @@ WebInspector.ResourceScriptMapping.prototype = {
_bindUISourceCodeToScripts: function(uiSourceCode, scripts)
{
console.assert(scripts.length);
+ var boundScriptFile = this.scriptFile(uiSourceCode);
+ if (boundScriptFile && boundScriptFile.hasScripts(scripts))
yurys 2015/07/16 16:30:35 Was it a bug or what? If so it may make sense to e
dgozman 2015/07/17 14:39:16 This is a race, but it always happened in one orde
+ return;
+
var scriptFile = new WebInspector.ResourceScriptFile(this, uiSourceCode, scripts);
this._setScriptFile(uiSourceCode, scriptFile);
for (var i = 0; i < scripts.length; ++i)
@@ -310,6 +314,18 @@ WebInspector.ResourceScriptFile.Events = {
WebInspector.ResourceScriptFile.prototype = {
/**
+ * @param {!Array.<!WebInspector.Script>} scripts
+ * @return {boolean}
+ */
+ hasScripts: function(scripts)
+ {
+ var script;
+ if (this._uiSourceCode.contentType() === WebInspector.resourceTypes.Script)
+ script = scripts[0];
+ return this._script === script;
+ },
+
+ /**
* @param {function(?string,!DebuggerAgent.SetScriptSourceError=,!WebInspector.Script=)=} callback
*/
commitLiveEdit: function(callback)

Powered by Google App Engine
This is Rietveld 408576698