Commit cad6d6d6 authored by apavlov@chromium.org's avatar apavlov@chromium.org

DevTools: Remove InspectorFrontendAPIImpl.prototype.loadCompleted()

https://crrev.com/6bffde4d87f7a05e5a871cd48366d56b8b83e950 introduces
dispatching of messages on InspectorFrontendAPI post the
IFH.loadCompleted() call only, hence the IFAPI.loadCompleted() call
is no longer required.

R=pfeldman@chromium.org

Review URL: https://codereview.chromium.org/644493003

git-svn-id: svn://svn.chromium.org/blink/trunk@183601 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent f168d3b5
...@@ -70,20 +70,20 @@ InspectorFrontendHostAPI.EventDescriptors = [ ...@@ -70,20 +70,20 @@ InspectorFrontendHostAPI.EventDescriptors = [
[InspectorFrontendHostAPI.Events.DeviceCountUpdated, ["count"]], [InspectorFrontendHostAPI.Events.DeviceCountUpdated, ["count"]],
[InspectorFrontendHostAPI.Events.DevicesUpdated, ["devices"]], [InspectorFrontendHostAPI.Events.DevicesUpdated, ["devices"]],
[InspectorFrontendHostAPI.Events.DispatchMessage, ["messageObject"]], [InspectorFrontendHostAPI.Events.DispatchMessage, ["messageObject"]],
[InspectorFrontendHostAPI.Events.EnterInspectElementMode, [], true], [InspectorFrontendHostAPI.Events.EnterInspectElementMode, []],
[InspectorFrontendHostAPI.Events.FileSystemsLoaded, ["fileSystems"]], [InspectorFrontendHostAPI.Events.FileSystemsLoaded, ["fileSystems"]],
[InspectorFrontendHostAPI.Events.FileSystemRemoved, ["fileSystemPath"]], [InspectorFrontendHostAPI.Events.FileSystemRemoved, ["fileSystemPath"]],
[InspectorFrontendHostAPI.Events.FileSystemAdded, ["errorMessage", "fileSystem"]], [InspectorFrontendHostAPI.Events.FileSystemAdded, ["errorMessage", "fileSystem"]],
[InspectorFrontendHostAPI.Events.IndexingTotalWorkCalculated, ["requestId", "fileSystemPath", "totalWork"]], [InspectorFrontendHostAPI.Events.IndexingTotalWorkCalculated, ["requestId", "fileSystemPath", "totalWork"]],
[InspectorFrontendHostAPI.Events.IndexingWorked, ["requestId", "fileSystemPath", "worked"]], [InspectorFrontendHostAPI.Events.IndexingWorked, ["requestId", "fileSystemPath", "worked"]],
[InspectorFrontendHostAPI.Events.IndexingDone, ["requestId", "fileSystemPath"]], [InspectorFrontendHostAPI.Events.IndexingDone, ["requestId", "fileSystemPath"]],
[InspectorFrontendHostAPI.Events.KeyEventUnhandled, ["event"], true], [InspectorFrontendHostAPI.Events.KeyEventUnhandled, ["event"]],
[InspectorFrontendHostAPI.Events.RevealSourceLine, ["url", "lineNumber", "columnNumber"], true], [InspectorFrontendHostAPI.Events.RevealSourceLine, ["url", "lineNumber", "columnNumber"]],
[InspectorFrontendHostAPI.Events.SavedURL, ["url"]], [InspectorFrontendHostAPI.Events.SavedURL, ["url"]],
[InspectorFrontendHostAPI.Events.SearchCompleted, ["requestId", "fileSystemPath", "files"]], [InspectorFrontendHostAPI.Events.SearchCompleted, ["requestId", "fileSystemPath", "files"]],
[InspectorFrontendHostAPI.Events.SetToolbarColors, ["backgroundColor", "color"]], [InspectorFrontendHostAPI.Events.SetToolbarColors, ["backgroundColor", "color"]],
[InspectorFrontendHostAPI.Events.SetUseSoftMenu, ["useSoftMenu"]], [InspectorFrontendHostAPI.Events.SetUseSoftMenu, ["useSoftMenu"]],
[InspectorFrontendHostAPI.Events.ShowConsole, [], true] [InspectorFrontendHostAPI.Events.ShowConsole, []]
]; ];
InspectorFrontendHostAPI.prototype = { InspectorFrontendHostAPI.prototype = {
...@@ -248,7 +248,7 @@ InspectorFrontendHostAPI.prototype = { ...@@ -248,7 +248,7 @@ InspectorFrontendHostAPI.prototype = {
/** /**
* @param {boolean} isDocked * @param {boolean} isDocked
* @param {!function()} callback * @param {function()} callback
*/ */
setIsDocked: function(isDocked, callback) { }, setIsDocked: function(isDocked, callback) { },
...@@ -349,7 +349,7 @@ WebInspector.InspectorFrontendHostStub.prototype = { ...@@ -349,7 +349,7 @@ WebInspector.InspectorFrontendHostStub.prototype = {
/** /**
* @param {boolean} isDocked * @param {boolean} isDocked
* @param {!function()} callback * @param {function()} callback
*/ */
setIsDocked: function(isDocked, callback) setIsDocked: function(isDocked, callback)
{ {
...@@ -641,8 +641,6 @@ var InspectorFrontendHost = window.InspectorFrontendHost || null; ...@@ -641,8 +641,6 @@ var InspectorFrontendHost = window.InspectorFrontendHost || null;
*/ */
function InspectorFrontendAPIImpl() function InspectorFrontendAPIImpl()
{ {
this._isLoaded = false;
this._pendingCommands = [];
this._debugFrontend = !!Runtime.queryParam("debugFrontend"); this._debugFrontend = !!Runtime.queryParam("debugFrontend");
var descriptors = InspectorFrontendHostAPI.EventDescriptors; var descriptors = InspectorFrontendHostAPI.EventDescriptors;
...@@ -651,16 +649,6 @@ function InspectorFrontendAPIImpl() ...@@ -651,16 +649,6 @@ function InspectorFrontendAPIImpl()
} }
InspectorFrontendAPIImpl.prototype = { InspectorFrontendAPIImpl.prototype = {
loadCompleted: function()
{
this._isLoaded = true;
for (var i = 0; i < this._pendingCommands.length; ++i)
this._pendingCommands[i]();
this._pendingCommands = [];
if (window.opener)
window.opener.postMessage(["loadCompleted"], "*");
},
/** /**
* @param {string} name * @param {string} name
* @param {!Array.<string>} signature * @param {!Array.<string>} signature
...@@ -671,47 +659,24 @@ InspectorFrontendAPIImpl.prototype = { ...@@ -671,47 +659,24 @@ InspectorFrontendAPIImpl.prototype = {
var params = Array.prototype.slice.call(arguments, 3); var params = Array.prototype.slice.call(arguments, 3);
if (this._debugFrontend) if (this._debugFrontend)
setImmediate(innerDispatch.bind(this)); setImmediate(innerDispatch);
else else
innerDispatch.call(this); innerDispatch();
/**
* @this {!InspectorFrontendAPIImpl}
*/
function innerDispatch() function innerDispatch()
{ {
if (runOnceLoaded) // Single argument methods get dispatched with the param.
this._runOnceLoaded(dispatchAfterLoad); if (signature.length < 2) {
else InspectorFrontendHost.events.dispatchEventToListeners(name, params[0]);
dispatchAfterLoad(); return;
function dispatchAfterLoad()
{
// Single argument methods get dispatched with the param.
if (signature.length < 2) {
InspectorFrontendHost.events.dispatchEventToListeners(name, params[0]);
return;
}
var data = {};
for (var i = 0; i < signature.length; ++i)
data[signature[i]] = params[i];
InspectorFrontendHost.events.dispatchEventToListeners(name, data);
} }
var data = {};
for (var i = 0; i < signature.length; ++i)
data[signature[i]] = params[i];
InspectorFrontendHost.events.dispatchEventToListeners(name, data);
} }
}, },
/**
* @param {function()} command
*/
_runOnceLoaded: function(command)
{
if (this._isLoaded) {
command();
return;
}
this._pendingCommands.push(command);
},
/** /**
* @param {number} id * @param {number} id
* @param {?string} error * @param {?string} error
......
...@@ -253,9 +253,6 @@ WebInspector.Main.prototype = { ...@@ -253,9 +253,6 @@ WebInspector.Main.prototype = {
WebInspector.extensionServerProxy.setFrontendReady(); WebInspector.extensionServerProxy.setFrontendReady();
// FIXME: Remove once the upstream counterpart has landed.
InspectorFrontendAPI.loadCompleted();
InspectorFrontendHost.loadCompleted(); InspectorFrontendHost.loadCompleted();
// Give UI cycles to repaint, then proceed with creating connection. // Give UI cycles to repaint, then proceed with creating connection.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment