Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(134)

Side by Side Diff: Source/core/dom/Document.h

Issue 305723002: Use method registration approach for creating events on core and modules. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix oilpan compilation. Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2001 Dirk Mueller (mueller@kde.org) 4 * (C) 2001 Dirk Mueller (mueller@kde.org)
5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org) 5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org)
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012 Apple Inc. All r ights reserved. 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012 Apple Inc. All r ights reserved.
7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/) 7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/)
8 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) 8 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
9 * Copyright (C) 2011 Google Inc. All rights reserved. 9 * Copyright (C) 2011 Google Inc. All rights reserved.
10 * 10 *
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 class DocumentLifecycleObserver; 88 class DocumentLifecycleObserver;
89 class DocumentLoader; 89 class DocumentLoader;
90 class DocumentMarkerController; 90 class DocumentMarkerController;
91 class DocumentParser; 91 class DocumentParser;
92 class DocumentState; 92 class DocumentState;
93 class AnimationTimeline; 93 class AnimationTimeline;
94 class DocumentType; 94 class DocumentType;
95 class Element; 95 class Element;
96 class ElementDataCache; 96 class ElementDataCache;
97 class Event; 97 class Event;
98 class EventFactoryBase;
98 class EventListener; 99 class EventListener;
99 class ExceptionState; 100 class ExceptionState;
100 class FastTextAutosizer; 101 class FastTextAutosizer;
101 class FloatQuad; 102 class FloatQuad;
102 class FloatRect; 103 class FloatRect;
103 class FontFaceSet; 104 class FontFaceSet;
104 class FormController; 105 class FormController;
105 class LocalFrame; 106 class LocalFrame;
106 class FrameHost; 107 class FrameHost;
107 class FrameView; 108 class FrameView;
(...skipping 578 matching lines...) Expand 10 before | Expand all | Expand 10 after
686 void didMergeTextNodes(Text& oldNode, unsigned offset); 687 void didMergeTextNodes(Text& oldNode, unsigned offset);
687 void didSplitTextNode(Text& oldNode); 688 void didSplitTextNode(Text& oldNode);
688 689
689 void clearDOMWindow() { m_domWindow = nullptr; } 690 void clearDOMWindow() { m_domWindow = nullptr; }
690 DOMWindow* domWindow() const { return m_domWindow; } 691 DOMWindow* domWindow() const { return m_domWindow; }
691 692
692 // Helper functions for forwarding DOMWindow event related tasks to the DOMW indow if it exists. 693 // Helper functions for forwarding DOMWindow event related tasks to the DOMW indow if it exists.
693 void setWindowAttributeEventListener(const AtomicString& eventType, PassRefP tr<EventListener>); 694 void setWindowAttributeEventListener(const AtomicString& eventType, PassRefP tr<EventListener>);
694 EventListener* getWindowAttributeEventListener(const AtomicString& eventType ); 695 EventListener* getWindowAttributeEventListener(const AtomicString& eventType );
695 696
697 static void registerEventFactory(EventFactoryBase*);
696 static PassRefPtrWillBeRawPtr<Event> createEvent(const String& eventType, Ex ceptionState&); 698 static PassRefPtrWillBeRawPtr<Event> createEvent(const String& eventType, Ex ceptionState&);
697 699
698 // keep track of what types of event listeners are registered, so we don't 700 // keep track of what types of event listeners are registered, so we don't
699 // dispatch events unnecessarily 701 // dispatch events unnecessarily
700 enum ListenerType { 702 enum ListenerType {
701 DOMSUBTREEMODIFIED_LISTENER = 1, 703 DOMSUBTREEMODIFIED_LISTENER = 1,
702 DOMNODEINSERTED_LISTENER = 1 << 1, 704 DOMNODEINSERTED_LISTENER = 1 << 1,
703 DOMNODEREMOVED_LISTENER = 1 << 2, 705 DOMNODEREMOVED_LISTENER = 1 << 2,
704 DOMNODEREMOVEDFROMDOCUMENT_LISTENER = 1 << 3, 706 DOMNODEREMOVEDFROMDOCUMENT_LISTENER = 1 << 3,
705 DOMNODEINSERTEDINTODOCUMENT_LISTENER = 1 << 4, 707 DOMNODEINSERTEDINTODOCUMENT_LISTENER = 1 << 4,
(...skipping 468 matching lines...) Expand 10 before | Expand all | Expand 10 after
1174 void processHttpEquivDefaultStyle(const AtomicString& content); 1176 void processHttpEquivDefaultStyle(const AtomicString& content);
1175 void processHttpEquivRefresh(const AtomicString& content); 1177 void processHttpEquivRefresh(const AtomicString& content);
1176 void processHttpEquivSetCookie(const AtomicString& content); 1178 void processHttpEquivSetCookie(const AtomicString& content);
1177 void processHttpEquivXFrameOptions(const AtomicString& content); 1179 void processHttpEquivXFrameOptions(const AtomicString& content);
1178 void processHttpEquivContentSecurityPolicy(const AtomicString& equiv, const AtomicString& content); 1180 void processHttpEquivContentSecurityPolicy(const AtomicString& equiv, const AtomicString& content);
1179 1181
1180 void didRemoveTouchEventHandler(Node*, bool clearAll); 1182 void didRemoveTouchEventHandler(Node*, bool clearAll);
1181 1183
1182 bool haveStylesheetsLoaded() const; 1184 bool haveStylesheetsLoaded() const;
1183 1185
1186 typedef HashSet<EventFactoryBase*> EventFactorySet;
1187 static EventFactorySet& eventFactories();
1188
1184 DocumentLifecycle m_lifecycle; 1189 DocumentLifecycle m_lifecycle;
1185 1190
1186 bool m_hasNodesWithPlaceholderStyle; 1191 bool m_hasNodesWithPlaceholderStyle;
1187 bool m_evaluateMediaQueriesOnStyleRecalc; 1192 bool m_evaluateMediaQueriesOnStyleRecalc;
1188 1193
1189 // If we do ignore the pending stylesheet count, then we need to add a boole an 1194 // If we do ignore the pending stylesheet count, then we need to add a boole an
1190 // to track that this happened so that we can do a full repaint when the sty lesheets 1195 // to track that this happened so that we can do a full repaint when the sty lesheets
1191 // do eventually load. 1196 // do eventually load.
1192 PendingSheetLayout m_pendingSheetLayout; 1197 PendingSheetLayout m_pendingSheetLayout;
1193 1198
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after
1443 inline bool Node::isDocumentNode() const 1448 inline bool Node::isDocumentNode() const
1444 { 1449 {
1445 return this == document(); 1450 return this == document();
1446 } 1451 }
1447 1452
1448 Node* eventTargetNodeForDocument(Document*); 1453 Node* eventTargetNodeForDocument(Document*);
1449 1454
1450 } // namespace WebCore 1455 } // namespace WebCore
1451 1456
1452 #endif // Document_h 1457 #endif // Document_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698