Turn EventPath into a real class
Created attachment 213734 [details] Cleanup
Comment on attachment 213734 [details] Cleanup View in context: https://bugs.webkit.org/attachment.cgi?id=213734&action=review > Source/WebCore/ChangeLog:8 > + Since we can't forward-declare typedef, turning EventPath into a real class helps our defactoring. The comment about forward-declaring typedef is not necessary. Refactoring strategies not chosen are not that interesting. > Source/WebCore/dom/EventDispatcher.h:62 > + const EventContext& item(size_t i) const { return *m_path[i]; } > + EventContext& item(size_t i) { return *m_path[i]; } The interface is not great. item() is vague and and it is not clear which way the path goes. But I suppose you plan to improve this later.
Comment on attachment 213734 [details] Cleanup View in context: https://bugs.webkit.org/attachment.cgi?id=213734&action=review > Source/WebCore/dom/EventDispatcher.h:68 > + void shrink(size_t newSize) { m_path.shrink(newSize); } Can't you just get rid of this? > Source/WebCore/dom/EventDispatcher.h:73 > + Vector<OwnPtr<EventContext>, 32> m_path; This should be std::unique_ptr. > Source/WebCore/dom/EventRetargeter.cpp:94 > + m_path.append(adoptPtr(new MouseOrFocusEventContext(node, ¤tTarget, target))); Instead of using adoptPtr(new Foo(, you should use std::make_unique<Foo>(
Committed r157152: <http://trac.webkit.org/changeset/157152>