Changeset 41845 in webkit
- Timestamp:
- Mar 19, 2009 4:45:57 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/ChangeLog
r41842 r41845 1 2009-03-19 Timothy Hatcher <timothy@apple.com> 2 3 <rdar://problem/6687342> -[WebView scheduleInRunLoop:forMode:] has no affect on timers 4 5 Reviewed by Darin Adler. 6 7 * wtf/Platform.h: Added HAVE_RUNLOOP_TIMER for PLATFORM(MAC). 8 1 9 2009-03-19 Geoffrey Garen <ggaren@apple.com> 2 10 -
trunk/JavaScriptCore/wtf/Platform.h
r41764 r41845 312 312 #endif 313 313 #define HAVE_READLINE 1 314 #define HAVE_RUNLOOP_TIMER 1 314 315 #endif 315 316 -
trunk/WebCore/ChangeLog
r41841 r41845 1 2009-03-18 Timothy Hatcher <timothy@apple.com> 2 3 Make the defered data loading timer honor the Page's scheduled runloop pairs. 4 Introduces a new RunLoopTimer class that has an API mimicking Timer but 5 allows it to be scheduled with one or more SchedulePairs. 6 7 <rdar://problem/6687342> -[WebView scheduleInRunLoop:forMode:] has no affect on timers 8 9 Reviewed by Darin Adler. 10 11 * WebCore.xcodeproj/project.pbxproj: Adds the new RunLoopTimer.{cpp,h} files. 12 * loader/MainResourceLoader.cpp: 13 (WebCore::MainResourceLoader::handleDataLoadNow): Use the MainResourceLoaderTimer typedef. 14 (WebCore::MainResourceLoader::startDataLoadTimer): Added. Start the timer and on 15 Mac platforms also schedule with the Page's SchedulePairs. 16 (WebCore::MainResourceLoader::handleDataLoadSoon): Call startDataLoadTimer(). 17 (WebCore::MainResourceLoader::setDefersLoading): Ditto. 18 * loader/MainResourceLoader.h: 19 * platform/cf/RunLoopTimerCF.cpp: Added. 20 (WebCore::RunLoopTimerBase::~RunLoopTimerBase): 21 (WebCore::timerFired): 22 (WebCore::RunLoopTimerBase::start): 23 (WebCore::RunLoopTimerBase::schedule): 24 (WebCore::RunLoopTimerBase::stop): 25 (WebCore::RunLoopTimerBase::isActive): 26 * platform/RunLoopTimer.h: Added. 27 (WebCore::RunLoopTimerBase::RunLoopTimerBase): 28 (WebCore::RunLoopTimerBase::startRepeating): 29 (WebCore::RunLoopTimerBase::startOneShot): 30 (WebCore::RunLoopTimer::RunLoopTimer): 31 (WebCore::RunLoopTimer::fired): 32 1 33 2009-03-19 Dimitri Glazkov <dglazkov@chromium.org> 2 34 -
trunk/WebCore/WebCore.xcodeproj/project.pbxproj
r41684 r41845 481 481 1C5FAED20DCFD90100D58F78 /* JSJavaScriptCallFrame.h in Headers */ = {isa = PBXBuildFile; fileRef = 1C5FAED00DCFD90100D58F78 /* JSJavaScriptCallFrame.h */; }; 482 482 1C5FAEE70DCFDA6800D58F78 /* JSJavaScriptCallFrameCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1C5FAEE60DCFDA6800D58F78 /* JSJavaScriptCallFrameCustom.cpp */; }; 483 1C63A2480F71646600C09D5A /* RunLoopTimer.h in Headers */ = {isa = PBXBuildFile; fileRef = 1C63A2460F71646600C09D5A /* RunLoopTimer.h */; }; 484 1C63A2490F71646600C09D5A /* RunLoopTimerCF.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1C63A2470F71646600C09D5A /* RunLoopTimerCF.cpp */; }; 483 485 1C81B95A0E97330800266E07 /* InspectorController.h in Headers */ = {isa = PBXBuildFile; fileRef = 1C81B9560E97330800266E07 /* InspectorController.h */; settings = {ATTRIBUTES = (Private, ); }; }; 484 486 1C81B95B0E97330800266E07 /* InspectorController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1C81B9570E97330800266E07 /* InspectorController.cpp */; }; … … 5431 5433 1C5FAED00DCFD90100D58F78 /* JSJavaScriptCallFrame.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSJavaScriptCallFrame.h; sourceTree = "<group>"; }; 5432 5434 1C5FAEE60DCFDA6800D58F78 /* JSJavaScriptCallFrameCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSJavaScriptCallFrameCustom.cpp; sourceTree = "<group>"; }; 5435 1C63A2460F71646600C09D5A /* RunLoopTimer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RunLoopTimer.h; sourceTree = "<group>"; }; 5436 1C63A2470F71646600C09D5A /* RunLoopTimerCF.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RunLoopTimerCF.cpp; sourceTree = "<group>"; }; 5433 5437 1C81B9560E97330800266E07 /* InspectorController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorController.h; sourceTree = "<group>"; }; 5434 5438 1C81B9570E97330800266E07 /* InspectorController.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InspectorController.cpp; sourceTree = "<group>"; }; … … 9665 9669 5160306B0CC4362300C8AC25 /* FileSystemCF.cpp */, 9666 9670 1A98956A0AA78F80005EF5EF /* KURLCFNet.cpp */, 9671 1C63A2470F71646600C09D5A /* RunLoopTimerCF.cpp */, 9667 9672 1CEFC9B80D78DC8C007D2579 /* SchedulePair.cpp */, 9668 9673 1CEFC9B70D78DC8C007D2579 /* SchedulePair.h */, … … 13889 13894 BC3BE12A0E98092F00835588 /* PopupMenuStyle.h */, 13890 13895 E4D687780ED7AE4F006EA978 /* PurgeableBuffer.h */, 13896 1C63A2460F71646600C09D5A /* RunLoopTimer.h */, 13891 13897 F587866202DE3B1101EA4122 /* SSLKeyGenerator.h */, 13892 13898 93C09C850B0657AA005ABD4D /* ScrollTypes.h */, … … 16903 16909 FE6FD4880F676E5700092873 /* Coordinates.h in Headers */, 16904 16910 FE6FD48E0F676E9300092873 /* JSCoordinates.h in Headers */, 16911 1C63A2480F71646600C09D5A /* RunLoopTimer.h in Headers */, 16905 16912 ); 16906 16913 runOnlyForDeploymentPostprocessing = 0; … … 18906 18913 FE6FD4870F676E5700092873 /* Coordinates.cpp in Sources */, 18907 18914 FE6FD48D0F676E9300092873 /* JSCoordinates.cpp in Sources */, 18915 1C63A2490F71646600C09D5A /* RunLoopTimerCF.cpp in Sources */, 18908 18916 ); 18909 18917 runOnlyForDeploymentPostprocessing = 0; -
trunk/WebCore/loader/MainResourceLoader.cpp
r40745 r41845 412 412 } 413 413 414 void MainResourceLoader::handleDataLoadNow( Timer<MainResourceLoader>*)414 void MainResourceLoader::handleDataLoadNow(MainResourceLoaderTimer*) 415 415 { 416 416 RefPtr<MainResourceLoader> protect(this); … … 424 424 } 425 425 426 void MainResourceLoader::startDataLoadTimer() 427 { 428 m_dataLoadTimer.startOneShot(0); 429 430 #if HAVE(RUNLOOP_TIMER) 431 if (SchedulePairHashSet* scheduledPairs = m_frame->page()->scheduledRunLoopPairs()) 432 m_dataLoadTimer.schedule(*scheduledPairs); 433 #endif 434 } 435 426 436 void MainResourceLoader::handleDataLoadSoon(ResourceRequest& r) 427 437 { … … 429 439 430 440 if (m_documentLoader->deferMainResourceDataLoad()) 431 m_dataLoadTimer.startOneShot(0);441 startDataLoadTimer(); 432 442 else 433 443 handleDataLoadNow(0); … … 513 523 { 514 524 ResourceLoader::setDefersLoading(defers); 515 525 516 526 if (defers) { 517 527 if (m_dataLoadTimer.isActive()) … … 520 530 if (m_initialRequest.isNull()) 521 531 return; 522 523 if (m_substituteData.isValid() && 524 m_documentLoader->deferMainResourceDataLoad()) 525 m_dataLoadTimer.startOneShot(0); 532 533 if (m_substituteData.isValid() && m_documentLoader->deferMainResourceDataLoad()) 534 startDataLoadTimer(); 526 535 else { 527 536 ResourceRequest r(m_initialRequest); -
trunk/WebCore/loader/MainResourceLoader.h
r41225 r41845 30 30 #include "ResourceLoader.h" 31 31 #include "SubstituteData.h" 32 #include <wtf/Forward.h> 33 34 #if HAVE(RUNLOOP_TIMER) 35 #include "RunLoopTimer.h" 36 #else 32 37 #include "Timer.h" 33 # include <wtf/Forward.h>38 #endif 34 39 35 40 namespace WebCore { … … 57 62 virtual void didFail(const ResourceError&); 58 63 59 void handleDataLoadNow(Timer<MainResourceLoader>*); 64 #if HAVE(RUNLOOP_TIMER) 65 typedef RunLoopTimer<MainResourceLoader> MainResourceLoaderTimer; 66 #else 67 typedef Timer<MainResourceLoader> MainResourceLoaderTimer; 68 #endif 69 70 void handleDataLoadNow(MainResourceLoaderTimer*); 60 71 61 72 bool isLoadingMultipartContent() const { return m_loadingMultipartContent; } … … 75 86 void handleDataLoadSoon(ResourceRequest& r); 76 87 88 void startDataLoadTimer(); 77 89 void handleDataLoad(ResourceRequest&); 78 90 … … 91 103 ResourceRequest m_initialRequest; 92 104 SubstituteData m_substituteData; 93 Timer<MainResourceLoader> m_dataLoadTimer; 105 106 MainResourceLoaderTimer m_dataLoadTimer; 94 107 95 108 #if ENABLE(OFFLINE_WEB_APPLICATIONS)
Note: See TracChangeset
for help on using the changeset viewer.