Changeset 74062 in webkit
- Timestamp:
- Dec 14, 2010 2:52:24 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/Android.mk
r74049 r74062 133 133 dom/EventNames.cpp \ 134 134 dom/EventTarget.cpp \ 135 dom/EventQueue.cpp \ 135 136 dom/ExceptionBase.cpp \ 136 137 dom/ExceptionCode.cpp \ -
trunk/WebCore/CMakeLists.txt
r74049 r74062 853 853 dom/EventNames.cpp 854 854 dom/EventTarget.cpp 855 dom/EventQueue.cpp 855 856 dom/ExceptionBase.cpp 856 857 dom/ExceptionCode.cpp -
trunk/WebCore/ChangeLog
r74059 r74062 1 2010-12-14 Mihai Parparita <mihaip@chromium.org> 2 3 Reviewed by Dimitri Glazkov. 4 5 Move asynchronous event dispatching out of Document 6 https://bugs.webkit.org/show_bug.cgi?id=49785 7 8 Move asynchonous event code out of Document and into a standalone 9 EventQueue class (which supports async events for both regular nodes 10 and the window object). 11 12 No new tests necessary, since no new functionality is exposed (existing 13 layout tests pass). 14 15 * Android.mk: 16 * CMakeLists.txt: 17 * GNUmakefile.am: 18 * WebCore.gypi: 19 * WebCore.pro: 20 * WebCore.vcproj/WebCore.vcproj: 21 * WebCore.xcodeproj/project.pbxproj: 22 * dom/Document.cpp: 23 (WebCore::Document::Document): 24 (WebCore::Document::enqueueWindowEvent): 25 (WebCore::Document::enqueueHashchangeEvent): 26 * dom/DOMAllInOne.cpp: 27 (WebCore::Document::eventQueue): 28 * dom/Document.h: 29 * dom/EventQueue.cpp: Added. 30 (WebCore::EventQueue::EventQueue): 31 (WebCore::EventQueue::enqueueEvent): 32 (WebCore::EventQueue::pendingEventTimerFired): 33 (WebCore::EventQueue::dispatchEvent): 34 * dom/EventQueue.h: Added. 35 * storage/StorageEventDispatcher.cpp: 36 (WebCore::StorageEventDispatcher::dispatch): 37 1 38 2010-12-14 Kyounga Ra <kyounga.ra@gmail.com> 2 39 -
trunk/WebCore/GNUmakefile.am
r74049 r74062 1207 1207 WebCore/dom/EventTarget.cpp \ 1208 1208 WebCore/dom/EventTarget.h \ 1209 WebCore/dom/EventQueue.cpp \ 1210 WebCore/dom/EventQueue.h \ 1209 1211 WebCore/dom/ExceptionBase.cpp \ 1210 1212 WebCore/dom/ExceptionBase.h \ -
trunk/WebCore/WebCore.gypi
r74049 r74062 1247 1247 'dom/EventTarget.cpp', 1248 1248 'dom/EventTarget.h', 1249 'dom/EventQueue.cpp', 1250 'dom/EventQueue.h', 1249 1251 'dom/ExceptionBase.cpp', 1250 1252 'dom/ExceptionBase.h', -
trunk/WebCore/WebCore.pro
r74056 r74062 731 731 dom/EventNames.cpp \ 732 732 dom/EventTarget.cpp \ 733 dom/EventQueue.cpp \ 733 734 dom/ExceptionBase.cpp \ 734 735 dom/ExceptionCode.cpp \ -
trunk/WebCore/WebCore.vcproj/WebCore.vcproj
r74049 r74062 43698 43698 > 43699 43699 </File> 43700 <File 43701 RelativePath="..\dom\EventQueue.cpp" 43702 > 43703 <FileConfiguration 43704 Name="Debug|Win32" 43705 ExcludedFromBuild="true" 43706 > 43707 <Tool 43708 Name="VCCLCompilerTool" 43709 /> 43710 </FileConfiguration> 43711 <FileConfiguration 43712 Name="Release|Win32" 43713 ExcludedFromBuild="true" 43714 > 43715 <Tool 43716 Name="VCCLCompilerTool" 43717 /> 43718 </FileConfiguration> 43719 <FileConfiguration 43720 Name="Debug_Internal|Win32" 43721 ExcludedFromBuild="true" 43722 > 43723 <Tool 43724 Name="VCCLCompilerTool" 43725 /> 43726 </FileConfiguration> 43727 <FileConfiguration 43728 Name="Debug_Cairo|Win32" 43729 ExcludedFromBuild="true" 43730 > 43731 <Tool 43732 Name="VCCLCompilerTool" 43733 /> 43734 </FileConfiguration> 43735 <FileConfiguration 43736 Name="Release_Cairo|Win32" 43737 ExcludedFromBuild="true" 43738 > 43739 <Tool 43740 Name="VCCLCompilerTool" 43741 /> 43742 </FileConfiguration> 43743 <FileConfiguration 43744 Name="Debug_All|Win32" 43745 ExcludedFromBuild="true" 43746 > 43747 <Tool 43748 Name="VCCLCompilerTool" 43749 /> 43750 </FileConfiguration> 43751 </File> 43752 <File 43753 RelativePath="..\dom\EventQueue.h" 43754 > 43755 </File> 43700 43756 <File 43701 43757 RelativePath="..\dom\ExceptionBase.cpp" -
trunk/WebCore/WebCore.xcodeproj/project.pbxproj
r74050 r74062 2691 2691 8C6EA61911EF7E0400FD8EE3 /* RuntimeEnabledFeatures.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8C6EA61711EF7E0400FD8EE3 /* RuntimeEnabledFeatures.cpp */; }; 2692 2692 8C6EA61A11EF7E0400FD8EE3 /* RuntimeEnabledFeatures.h in Headers */ = {isa = PBXBuildFile; fileRef = 8C6EA61811EF7E0400FD8EE3 /* RuntimeEnabledFeatures.h */; }; 2693 8F67561B1288B17B0047ACA3 /* EventQueue.h in Headers */ = {isa = PBXBuildFile; fileRef = 8F6756191288B17B0047ACA3 /* EventQueue.h */; }; 2694 8F67561C1288B17B0047ACA3 /* EventQueue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8F67561A1288B17B0047ACA3 /* EventQueue.cpp */; }; 2693 2695 8FAC774D119872CB0015AE94 /* JSMainThreadExecState.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8F934D841189F1EE00508D5D /* JSMainThreadExecState.cpp */; }; 2694 2696 9302B0BD0D79F82900C7EE83 /* PageGroup.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9302B0BC0D79F82900C7EE83 /* PageGroup.cpp */; }; … … 9028 9030 8C6EA61711EF7E0400FD8EE3 /* RuntimeEnabledFeatures.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RuntimeEnabledFeatures.cpp; path = generic/RuntimeEnabledFeatures.cpp; sourceTree = "<group>"; }; 9029 9031 8C6EA61811EF7E0400FD8EE3 /* RuntimeEnabledFeatures.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RuntimeEnabledFeatures.h; path = generic/RuntimeEnabledFeatures.h; sourceTree = "<group>"; }; 9032 8F6756191288B17B0047ACA3 /* EventQueue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EventQueue.h; sourceTree = "<group>"; }; 9033 8F67561A1288B17B0047ACA3 /* EventQueue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = EventQueue.cpp; sourceTree = "<group>"; }; 9030 9034 8F934D831189F1EE00508D5D /* JSMainThreadExecState.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSMainThreadExecState.h; sourceTree = "<group>"; }; 9031 9035 8F934D841189F1EE00508D5D /* JSMainThreadExecState.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSMainThreadExecState.cpp; sourceTree = "<group>"; }; … … 18807 18811 939885C108B7E3D100E707C4 /* EventNames.cpp */, 18808 18812 939885C208B7E3D100E707C4 /* EventNames.h */, 18813 8F6756191288B17B0047ACA3 /* EventQueue.h */, 18814 8F67561A1288B17B0047ACA3 /* EventQueue.cpp */, 18809 18815 E12EDBE90B308E0B002704B6 /* EventTarget.cpp */, 18810 18816 E12EDB7A0B308A78002704B6 /* EventTarget.h */, … … 20332 20338 1CA19E160DC255CA0065A994 /* EventLoop.h in Headers */, 20333 20339 939885C408B7E3D100E707C4 /* EventNames.h in Headers */, 20340 8F67561B1288B17B0047ACA3 /* EventQueue.h in Headers */, 20334 20341 E0FEF372B17C53EAC1C1FBEE /* EventSource.h in Headers */, 20335 20342 E12EDB7B0B308A78002704B6 /* EventTarget.h in Headers */, … … 23091 23098 1CA19E050DC255950065A994 /* EventLoopMac.mm in Sources */, 23092 23099 939885C308B7E3D100E707C4 /* EventNames.cpp in Sources */, 23100 8F67561C1288B17B0047ACA3 /* EventQueue.cpp in Sources */, 23093 23101 E0FEF372B27C53EAC1C1FBEE /* EventSource.cpp in Sources */, 23094 23102 E12EDBEA0B308E0B002704B6 /* EventTarget.cpp in Sources */, -
trunk/WebCore/dom/DOMAllInOne.cpp
r73690 r74062 72 72 #include "EventContext.cpp" 73 73 #include "EventNames.cpp" 74 #include "EventQueue.cpp" 74 75 #include "EventTarget.cpp" 75 76 #include "ExceptionBase.cpp" -
trunk/WebCore/dom/Document.cpp
r73939 r74062 60 60 #include "EventListener.h" 61 61 #include "EventNames.h" 62 #include "EventQueue.h" 62 63 #include "ExceptionCode.h" 63 64 #include "FocusController.h" … … 404 405 #endif 405 406 , m_usingGeolocation(false) 406 , m_ pendingEventTimer(this, &Document::pendingEventTimerFired)407 , m_eventQueue(adoptPtr(new EventQueue)) 407 408 #if ENABLE(WML) 408 409 , m_containsWMLContent(false) … … 3474 3475 } 3475 3476 3476 void Document::enqueueEvent(PassRefPtr<Event> event) 3477 { 3478 m_pendingEventQueue.append(event); 3479 if (!m_pendingEventTimer.isActive()) 3480 m_pendingEventTimer.startOneShot(0); 3481 } 3482 3483 void Document::pendingEventTimerFired(Timer<Document>*) 3484 { 3485 ASSERT(!m_pendingEventTimer.isActive()); 3486 Vector<RefPtr<Event> > eventQueue; 3487 eventQueue.swap(m_pendingEventQueue); 3488 3489 typedef Vector<RefPtr<Event> >::const_iterator Iterator; 3490 Iterator end = eventQueue.end(); 3491 for (Iterator it = eventQueue.begin(); it != end; ++it) 3492 dispatchWindowEvent(*it); 3477 void Document::enqueueWindowEvent(PassRefPtr<Event> event) 3478 { 3479 event->setTarget(domWindow()); 3480 m_eventQueue->enqueueEvent(event); 3493 3481 } 3494 3482 … … 4752 4740 void Document::enqueueHashchangeEvent(const String& oldURL, const String& newURL) 4753 4741 { 4754 enqueue Event(HashChangeEvent::create(oldURL, newURL));4742 enqueueWindowEvent(HashChangeEvent::create(oldURL, newURL)); 4755 4743 } 4756 4744 -
trunk/WebCore/dom/Document.h
r74041 r74062 77 77 class Event; 78 78 class EventListener; 79 class EventQueue; 79 80 class FormAssociatedElement; 80 81 class Frame; … … 1027 1028 void setContainsValidityStyleRules() { m_containsValidityStyleRules = true; } 1028 1029 1029 void enqueue Event(PassRefPtr<Event>);1030 void enqueueWindowEvent(PassRefPtr<Event>); 1030 1031 void enqueuePageshowEvent(PageshowEventPersistence); 1031 1032 void enqueueHashchangeEvent(const String& oldURL, const String& newURL); 1032 1033 void enqueuePopstateEvent(PassRefPtr<SerializedScriptValue> stateObject); 1034 EventQueue* eventQueue() const { return m_eventQueue.get(); } 1033 1035 1034 1036 void addMediaCanStartListener(MediaCanStartListener*); … … 1128 1130 1129 1131 void createStyleSelector(); 1130 1131 void pendingEventTimerFired(Timer<Document>*);1132 1132 1133 1133 PassRefPtr<NodeList> handleZeroPadding(const HitTestRequest&, HitTestResult&) const; … … 1353 1353 1354 1354 bool m_usingGeolocation; 1355 1356 Timer<Document> m_pendingEventTimer; 1357 Vector<RefPtr<Event> > m_pendingEventQueue; 1355 1356 OwnPtr<EventQueue> m_eventQueue; 1358 1357 1359 1358 #if ENABLE(WML) -
trunk/WebCore/storage/StorageEventDispatcher.cpp
r58873 r74062 59 59 Storage* storage = frames[i]->domWindow()->sessionStorage(ec); 60 60 if (!ec) 61 frames[i]->document()->enqueue Event(StorageEvent::create(eventNames().storageEvent, key, oldValue, newValue, sourceFrame->document()->url(), storage));61 frames[i]->document()->enqueueWindowEvent(StorageEvent::create(eventNames().storageEvent, key, oldValue, newValue, sourceFrame->document()->url(), storage)); 62 62 } 63 63 } else { … … 76 76 Storage* storage = frames[i]->domWindow()->localStorage(ec); 77 77 if (!ec) 78 frames[i]->document()->enqueue Event(StorageEvent::create(eventNames().storageEvent, key, oldValue, newValue, sourceFrame->document()->url(), storage));78 frames[i]->document()->enqueueWindowEvent(StorageEvent::create(eventNames().storageEvent, key, oldValue, newValue, sourceFrame->document()->url(), storage)); 79 79 } 80 80 } -
trunk/WebKit/chromium/ChangeLog
r73995 r74062 1 2010-12-14 Mihai Parparita <mihaip@chromium.org> 2 3 Reviewed by Dimitri Glazkov. 4 5 Move asynchronous event dispatching out of Document 6 https://bugs.webkit.org/show_bug.cgi?id=49785 7 8 Change enqueueEvent callsite. 9 10 * src/StorageAreaProxy.cpp: 11 (WebCore::StorageAreaProxy::storageEvent): 12 1 13 2010-12-13 Mike Lawther <mikelawther@chromium.org> 2 14 -
trunk/WebKit/chromium/src/StorageAreaProxy.cpp
r58873 r74062 130 130 Storage* storage = frames[i]->domWindow()->sessionStorage(ec); 131 131 if (!ec) 132 frames[i]->document()->enqueue Event(StorageEvent::create(eventNames().storageEvent, key, oldValue, newValue, sourceFrame->document()->url(), storage));132 frames[i]->document()->enqueueWindowEvent(StorageEvent::create(eventNames().storageEvent, key, oldValue, newValue, sourceFrame->document()->url(), storage)); 133 133 } 134 134 } else { … … 147 147 Storage* storage = frames[i]->domWindow()->localStorage(ec); 148 148 if (!ec) 149 frames[i]->document()->enqueue Event(StorageEvent::create(eventNames().storageEvent, key, oldValue, newValue, sourceFrame->document()->url(), storage));149 frames[i]->document()->enqueueWindowEvent(StorageEvent::create(eventNames().storageEvent, key, oldValue, newValue, sourceFrame->document()->url(), storage)); 150 150 } 151 151 }
Note: See TracChangeset
for help on using the changeset viewer.