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

Unified Diff: Source/devtools/front_end/host/InspectorFrontendHost.js

Issue 438333003: DevTools: use setImmediate instead of setTimeout for dispatching messages on devtools frontend in d… (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fixed tests Created 6 years, 4 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/host/InspectorFrontendHost.js
diff --git a/Source/devtools/front_end/host/InspectorFrontendHost.js b/Source/devtools/front_end/host/InspectorFrontendHost.js
index bcc2e421fcaec07a9d84990a7d4fa2361ae1480b..60eb42500be880053f13e878480ae2f59c1c7d9d 100644
--- a/Source/devtools/front_end/host/InspectorFrontendHost.js
+++ b/Source/devtools/front_end/host/InspectorFrontendHost.js
@@ -638,7 +638,6 @@ function InspectorFrontendAPIImpl()
this._isLoaded = false;
this._pendingCommands = [];
this._debugFrontend = !!WebInspector.queryParam("debugFrontend");
- this._debugCalls = [];
var descriptors = InspectorFrontendHostAPI.EventDescriptors;
for (var i = 0; i < descriptors.length; ++i)
@@ -665,13 +664,10 @@ InspectorFrontendAPIImpl.prototype = {
{
var params = Array.prototype.slice.call(arguments, 3);
- if (this._debugFrontend) {
- this._debugCalls.push(innerDispatch.bind(this));
- if (this._debugCalls.length === 1)
- window.setTimeout(this._onDebugTimeout.bind(this), 0);
- } else {
+ if (this._debugFrontend)
+ setImmediate(innerDispatch.bind(this));
+ else
innerDispatch.call(this);
- }
/**
* @this {!InspectorFrontendAPIImpl}
@@ -698,12 +694,6 @@ InspectorFrontendAPIImpl.prototype = {
}
},
- _onDebugTimeout: function()
- {
- while (this._debugCalls.length)
- this._debugCalls.shift()();
- },
-
/**
* @param {function()} command
*/
« Source/devtools/front_end/common/utilities.js ('K') | « Source/devtools/front_end/externs.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698