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

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

Issue 14320027: DevTools: Track CSSStyleSheetHeaders in the front-end real time (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 8 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/StylesSourceMapping.js
diff --git a/Source/devtools/front_end/StylesSourceMapping.js b/Source/devtools/front_end/StylesSourceMapping.js
index fcbca2179b9adf87c0836f9f95d49ba4ebc5d236..7fe246d8c074bd854f48d24f4c304254ee1b11e0 100644
--- a/Source/devtools/front_end/StylesSourceMapping.js
+++ b/Source/devtools/front_end/StylesSourceMapping.js
@@ -244,31 +244,13 @@ WebInspector.StyleContentBinding.prototype = {
userCallback("No resource found: " + uiSourceCode.url);
return;
}
-
- this._cssModel.resourceBinding().requestStyleSheetIdForResource(resource, callback.bind(this));
- /**
- * @param {?CSSAgent.StyleSheetId} styleSheetId
- */
- function callback(styleSheetId)
- {
- if (!styleSheetId) {
- userCallback("No stylesheet found: " + resource.frameId + ":" + resource.url);
- return;
- }
-
- this._innerSetContent(styleSheetId, content, majorChange, userCallback, null);
+ var styleSheetId = this._cssModel.resourceBinding().styleSheetIdForResource(resource);
+ if (!styleSheetId) {
+ userCallback("No stylesheet found: " + resource.frameId + ":" + resource.url);
+ return;
}
- },
- /**
- * @param {CSSAgent.StyleSheetId} styleSheetId
- * @param {string} content
- * @param {boolean} majorChange
- * @param {function(?string)} userCallback
- */
- _innerSetContent: function(styleSheetId, content, majorChange, userCallback)
- {
this._isSettingContent = true;
function callback(error)
{
@@ -307,24 +289,17 @@ WebInspector.StyleContentBinding.prototype = {
*/
_innerStyleSheetChanged: function(styleSheetId, content)
{
- /**
- * @param {?string} styleSheetURL
- */
- function callback(styleSheetURL)
- {
- if (typeof styleSheetURL !== "string")
- return;
-
- var uiSourceCode = this._workspace.uiSourceCodeForURL(styleSheetURL);
- if (!uiSourceCode)
- return;
+ var styleSheetURL = this._cssModel.resourceBinding().resourceURLForStyleSheetId(styleSheetId);
+ if (typeof styleSheetURL !== "string")
+ return;
- if (uiSourceCode.styleFile())
- uiSourceCode.styleFile().addRevision(content);
- }
+ var uiSourceCode = this._workspace.uiSourceCodeForURL(styleSheetURL)
+ if (!uiSourceCode)
+ return;
- this._cssModel.resourceBinding().requestResourceURLForStyleSheetId(styleSheetId, callback.bind(this));
- },
+ if (uiSourceCode.styleFile())
+ uiSourceCode.styleFile().addRevision(content);
+ }
}
/**

Powered by Google App Engine
This is Rietveld 408576698