RESOLVED FIXED 73225
Web Inspector: put inspector agents into a vector in the InspectorController.
https://bugs.webkit.org/show_bug.cgi?id=73225
Summary Web Inspector: put inspector agents into a vector in the InspectorController.
Pavel Feldman
Reported 2011-11-28 10:00:41 PST
Patch to follow.
Attachments
Patch (63.95 KB, patch)
2011-11-28 10:04 PST, Pavel Feldman
no flags
[Patch] review comments addressed. (69.12 KB, patch)
2011-11-29 00:55 PST, Pavel Feldman
no flags
[Patch] to land (71.88 KB, patch)
2011-11-29 01:38 PST, Pavel Feldman
yurys: review+
Pavel Feldman
Comment 1 2011-11-28 10:04:33 PST
Yury Semikhatsky
Comment 2 2011-11-29 00:12:45 PST
Comment on attachment 116773 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=116773&action=review > Source/WebCore/ChangeLog:5 > + Please describe the change here. > Source/WebCore/ChangeLog:99 > + Web Inspector: align agent creation (factory vs constructors). Remove this entry. > Source/WebCore/inspector/InspectorBaseAgent.h:42 > +class InspectorBaseAgentInterface { Consider moving it into its own file. > Source/WebCore/inspector/InspectorBaseAgent.h:67 > + , m_agent(static_cast<T*>(this)) You don't need to keep it in a field, just apply this cast in registerDispatcher. > Source/WebCore/inspector/InspectorController.h:34 > +#include "InspectorBaseAgent.h" Forward declaration should suffice
Pavel Feldman
Comment 3 2011-11-29 00:22:06 PST
> > Source/WebCore/inspector/InspectorBaseAgent.h:42 > > +class InspectorBaseAgentInterface { > > Consider moving it into its own file. > I consider InspectorBaseAgentInterface a part of the InspectroBaseAgent. It is just a convenience way for storing all agents in the same vector while implementing double dispatch using templates.
Ilya Tikhonovsky
Comment 4 2011-11-29 00:25:51 PST
Comment on attachment 116773 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=116773&action=review > Source/WebCore/inspector/CodeGeneratorInspector.py:1267 > + Generator.backend_setters_list.append(" void registerDispatcher(%s* %s) { m_%s = %s; }" % (agent_type_name, agent_field_name, agent_field_name, agent_field_name)) backend_agent_setters_list? registerAgent? I'd add ASSERT(!m_%s) here and m_%s = 0 in constructor. > Source/WebCore/inspector/InspectorBaseAgent.h:34 > +#include "InspectorBackendDispatcher.h" It is bad dependency. > Source/WebCore/inspector/InspectorBaseAgent.h:60 > + dispatcher->registerDispatcher(m_agent); Looks like you can do static cast right here and remove m_agent member.
Pavel Feldman
Comment 5 2011-11-29 00:55:24 PST
Created attachment 116916 [details] [Patch] review comments addressed.
Yury Semikhatsky
Comment 6 2011-11-29 01:09:00 PST
Comment on attachment 116916 [details] [Patch] review comments addressed. View in context: https://bugs.webkit.org/attachment.cgi?id=116916&action=review > Source/WebCore/inspector/InspectorController.cpp:162 > + (*it)->inspectedPageDestroyed(); You don't need this method.
Pavel Feldman
Comment 7 2011-11-29 01:38:29 PST
Created attachment 116921 [details] [Patch] to land
Pavel Feldman
Comment 8 2011-11-29 02:02:30 PST
Adam Klein
Comment 9 2011-12-01 12:32:09 PST
Note You need to log in before you can comment on or make changes to this bug.