Serialize calls to WebInspector. This is the first step where method calls are being serialized to arrays (not yet JSON stringified ones) and are being dispatched on the client. This change also allows client to override InspectorFrontend, so that the serialized calls can be made on a given object instead of in-process WebInspector global. This will be the main control flow when InspectorController is decoupled from the in-process frontend.
Created attachment 30652 [details] patch
Comment on attachment 30652 [details] patch > + overrideFrontendObject(m_scriptState, webInspectorObj); I think "proxy" is a better term for this than "override". Maybe frontendProxyObject? > +WebInspector.dispatch = function() { > + var methodName = arguments[0]; > + var parameters = Array.prototype.slice.call(arguments, 1); > + WebInspector[methodName].apply(this, parameters); > +} Please use 4 spaces for indenting. r- for that. Otherwise r+.
Comment on attachment 30652 [details] patch > +ScriptFunctionCall* InspectorFrontend::newFunctionCall(const String& functionName) > +{ > + ScriptFunctionCall* function = new ScriptFunctionCall(m_scriptState, m_webInspector, "dispatch"); > + function->appendArgument(functionName); > + return function; > +} This would be an ideal place to use PassOwnPtr rather than a raw pointer, to indicate that ownership of an object is being transferred out of the function.
Created attachment 30659 [details] patch (In reply to comment #2) > (From update of attachment 30652 [details] [review]) > > + overrideFrontendObject(m_scriptState, webInspectorObj); > > I think "proxy" is a better term for this than "override". > > Maybe frontendProxyObject? > Renamed to setFrontendProxyObject > > +WebInspector.dispatch = function() { > > + var methodName = arguments[0]; > > + var parameters = Array.prototype.slice.call(arguments, 1); > > + WebInspector[methodName].apply(this, parameters); > > +} > > Please use 4 spaces for indenting. > Done. Sorry about that - old habit. > r- for that. Otherwise r+. > (In reply to comment #3) > (From update of attachment 30652 [details] [review]) > > +ScriptFunctionCall* InspectorFrontend::newFunctionCall(const String& functionName) > > +{ > > + ScriptFunctionCall* function = new ScriptFunctionCall(m_scriptState, m_webInspector, "dispatch"); > > + function->appendArgument(functionName); > > + return function; > > +} > > This would be an ideal place to use PassOwnPtr rather than a raw pointer, to > indicate that ownership of an object is being transferred out of the function. > Done.
Committed revision 44149.