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

Unified Diff: third_party/WebKit/Source/devtools/front_end/sdk/CSSStyleModel.js

Issue 1763883003: [DevTools] Fix compiler errors in bindings module (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@prepare-ui-module
Patch Set: Created 4 years, 10 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 | « third_party/WebKit/Source/devtools/front_end/bindings/StylesSourceMapping.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/devtools/front_end/sdk/CSSStyleModel.js
diff --git a/third_party/WebKit/Source/devtools/front_end/sdk/CSSStyleModel.js b/third_party/WebKit/Source/devtools/front_end/sdk/CSSStyleModel.js
index c235cfefb7d671fc6b822d35eab8663131ad5339..da98c85028a1281addfcc13e17f2b45de27e6cef 100644
--- a/third_party/WebKit/Source/devtools/front_end/sdk/CSSStyleModel.js
+++ b/third_party/WebKit/Source/devtools/front_end/sdk/CSSStyleModel.js
@@ -806,21 +806,21 @@ WebInspector.CSSDispatcher.prototype = {
WebInspector.CSSStyleModel.ComputedStyleLoader = function(cssModel)
{
this._cssModel = cssModel;
- /** @type {!Map.<!DOMAgent.NodeId, !Promise.<?WebInspector.CSSStyleDeclaration>>} */
+ /** @type {!Map<!DOMAgent.NodeId, !Promise<?Map<string, string>>>} */
this._nodeIdToPromise = new Map();
}
WebInspector.CSSStyleModel.ComputedStyleLoader.prototype = {
/**
* @param {!DOMAgent.NodeId} nodeId
- * @return {!Promise.<?Map.<string, string>>}
+ * @return {!Promise<?Map<string, string>>}
*/
computedStylePromise: function(nodeId)
{
- if (!this._nodeIdToPromise[nodeId])
- this._nodeIdToPromise[nodeId] = this._cssModel._agent.getComputedStyleForNode(nodeId, parsePayload).then(cleanUp.bind(this));
+ if (!this._nodeIdToPromise.has(nodeId))
+ this._nodeIdToPromise.set(nodeId, this._cssModel._agent.getComputedStyleForNode(nodeId, parsePayload).then(cleanUp.bind(this)));
- return this._nodeIdToPromise[nodeId];
+ return /** @type {!Promise.<?Map.<string, string>>} */(this._nodeIdToPromise.get(nodeId));
/**
* @param {?Protocol.Error} error
@@ -844,7 +844,7 @@ WebInspector.CSSStyleModel.ComputedStyleLoader.prototype = {
*/
function cleanUp(computedStyle)
{
- delete this._nodeIdToPromise[nodeId];
+ this._nodeIdToPromise.delete(nodeId);
return computedStyle;
}
}
« no previous file with comments | « third_party/WebKit/Source/devtools/front_end/bindings/StylesSourceMapping.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698