RESOLVED FIXED 26010
Serialize calls to WebInspector
https://bugs.webkit.org/show_bug.cgi?id=26010
Summary Serialize calls to WebInspector
Pavel Feldman
Reported 2009-05-25 09:05:20 PDT
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.
Attachments
patch (16.29 KB, patch)
2009-05-25 09:09 PDT, Pavel Feldman
timothy: review-
patch (16.46 KB, patch)
2009-05-25 13:32 PDT, Pavel Feldman
timothy: review+
Pavel Feldman
Comment 1 2009-05-25 09:09:30 PDT
Timothy Hatcher
Comment 2 2009-05-25 10:55:30 PDT
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+.
Mark Rowe (bdash)
Comment 3 2009-05-25 12:41:25 PDT
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.
Pavel Feldman
Comment 4 2009-05-25 13:32:23 PDT
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.
Alexey Proskuryakov
Comment 5 2009-05-26 05:24:47 PDT
Committed revision 44149.
Note You need to log in before you can comment on or make changes to this bug.