Changeset 132695 in webkit
- Timestamp:
- Oct 26, 2012, 2:30:22 PM (13 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r132692 r132695 1 2012-10-26 Brady Eidson <beidson@apple.com> 2 3 Crash in WebProces at WebCore::ResourceLoadScheduler::crossOriginRedirectReceived + 78 4 <rdar://problem/12575514> and https://bugs.webkit.org/show_bug.cgi?id=100554 5 6 Reviewed by Alexey Proskuryakov. 7 8 This was fallout from http://trac.webkit.org/changeset/132501 where I missed some of the 9 spots that call resourceLoadScheduler(). 10 11 As a result we were creating more than one ResourceLoadScheduler, allowing the host records 12 to get out of sync. 13 14 The fix that also results in less #ifdefs scattered throughout the code is to use a single 15 choke point for all ResourceLoadScheduler access. 16 17 No new tests 18 (No change of behavior for the default config, not testable at this time in the repro config) 19 20 Add a single choke point for accessing the correct ResourceLoadScheduler: 21 * loader/ResourceLoadScheduler.cpp: 22 (WebCore::defaultResourceLoadScheduler): New private function that keeps the singleton default ResourceLoadScheduler. 23 (WebCore::resourceLoadScheduler): Refactor this function to either ask the LoaderStrategy or call through to 24 25 Revert back to using that single choke point everywhere: 26 * dom/ContainerNode.cpp: 27 (WebCore::ContainerNode::suspendPostAttachCallbacks): 28 (WebCore::ContainerNode::resumePostAttachCallbacks): 29 30 * loader/MainResourceLoader.cpp: 31 (WebCore::MainResourceLoader::loadNow): 32 33 * loader/ResourceLoader.cpp: 34 (WebCore::ResourceLoader::releaseResources): 35 (WebCore::ResourceLoader::willSendRequest): 36 37 * loader/cache/CachedResource.cpp: 38 (WebCore::CachedResource::load): 39 40 * loader/cache/CachedResourceLoader.cpp: 41 (WebCore::CachedResourceLoader::performPostLoadActions): 42 1 43 2012-10-26 Elliott Sprehn <esprehn@chromium.org> 2 44 -
trunk/Source/WebCore/dom/ContainerNode.cpp
r132501 r132695 36 36 #include "InsertionPoint.h" 37 37 #include "InspectorInstrumentation.h" 38 #include "LoaderStrategy.h"39 38 #include "MemoryCache.h" 40 39 #include "MutationEvent.h" 41 #include "ResourceLoadScheduler.h"42 40 #include "Page.h" 43 #include "PlatformStrategies.h"44 41 #include "RenderBox.h" 45 42 #include "RenderTheme.h" 46 43 #include "RenderWidget.h" 44 #include "ResourceLoadScheduler.h" 47 45 #include "RootInlineBox.h" 48 46 #include "UndoManager.h" … … 644 642 } 645 643 } 646 #if USE(PLATFORM_STRATEGIES)647 platformStrategies()->loaderStrategy()->resourceLoadScheduler()->suspendPendingRequests();648 #else649 644 resourceLoadScheduler()->suspendPendingRequests(); 650 #endif651 645 } 652 646 ++s_attachDepth; … … 665 659 page->setMemoryCacheClientCallsEnabled(true); 666 660 } 667 #if USE(PLATFORM_STRATEGIES)668 platformStrategies()->loaderStrategy()->resourceLoadScheduler()->resumePendingRequests();669 #else670 661 resourceLoadScheduler()->resumePendingRequests(); 671 #endif672 662 } 673 663 --s_attachDepth; -
trunk/Source/WebCore/loader/MainResourceLoader.cpp
r132501 r132695 45 45 #include "HistoryItem.h" 46 46 #include "InspectorInstrumentation.h" 47 #include "LoaderStrategy.h"48 47 #include "Page.h" 49 #include "PlatformStrategies.h"50 48 #include "ResourceError.h" 51 49 #include "ResourceHandle.h" … … 633 631 return true; 634 632 635 #if USE(PLATFORM_STRATEGIES)636 platformStrategies()->loaderStrategy()->resourceLoadScheduler()->addMainResourceLoad(this);637 #else638 633 resourceLoadScheduler()->addMainResourceLoad(this); 639 #endif640 634 641 635 if (m_substituteData.isValid()) -
trunk/Source/WebCore/loader/ResourceLoadScheduler.cpp
r132501 r132695 32 32 #include "InspectorInstrumentation.h" 33 33 #include "KURL.h" 34 #include "LoaderStrategy.h" 34 35 #include "Logging.h" 35 36 #include "NetscapePlugInStreamLoader.h" 37 #include "PlatformStrategies.h" 36 38 #include "ResourceLoader.h" 37 39 #include "ResourceRequest.h" … … 72 74 } 73 75 74 ResourceLoadScheduler* resourceLoadScheduler()76 ResourceLoadScheduler* ResourceLoadScheduler::defaultResourceLoadScheduler() 75 77 { 76 78 ASSERT(isMainThread()); 77 79 DEFINE_STATIC_LOCAL(ResourceLoadScheduler, resourceLoadScheduler, ()); 78 80 return &resourceLoadScheduler; 81 } 82 83 ResourceLoadScheduler* resourceLoadScheduler() 84 { 85 #if USE(PLATFORM_STRATEGIES) 86 return platformStrategies()->loaderStrategy()->resourceLoadScheduler(); 87 #else 88 return ResourceLoadScheduler::defaultResourceLoadScheduler(); 89 #endif 79 90 } 80 91 -
trunk/Source/WebCore/loader/ResourceLoadScheduler.h
r132501 r132695 106 106 void servePendingRequests(HostInformation*, ResourceLoadPriority); 107 107 108 static ResourceLoadScheduler* defaultResourceLoadScheduler(); 109 108 110 typedef HashMap<String, HostInformation*, StringHash> HostMap; 109 111 HostMap m_hosts; -
trunk/Source/WebCore/loader/ResourceLoader.cpp
r132501 r132695 38 38 #include "FrameLoaderClient.h" 39 39 #include "InspectorInstrumentation.h" 40 #include "LoaderStrategy.h"41 40 #include "Page.h" 42 #include "PlatformStrategies.h"43 41 #include "ProgressTracker.h" 44 42 #include "ResourceBuffer.h" … … 92 90 m_reachedTerminalState = true; 93 91 94 #if USE(PLATFORM_STRATEGIES) 95 platformStrategies()->loaderStrategy()->resourceLoadScheduler()->remove(this); 96 #endif 92 resourceLoadScheduler()->remove(this); 93 97 94 m_identifier = 0; 98 #if !USE(PLATFORM_STRATEGIES)99 resourceLoadScheduler()->remove(this);100 #endif101 95 102 96 if (m_handle) { … … 244 238 } 245 239 246 if (!redirectResponse.isNull()) { 247 #if USE(PLATFORM_STRATEGIES) 248 platformStrategies()->loaderStrategy()->resourceLoadScheduler()->crossOriginRedirectReceived(this, request.url()); 249 #else 240 if (!redirectResponse.isNull()) 250 241 resourceLoadScheduler()->crossOriginRedirectReceived(this, request.url()); 251 #endif 252 } 242 253 243 m_request = request; 254 244 } -
trunk/Source/WebCore/loader/cache/CachedResource.cpp
r132520 r132695 37 37 #include "InspectorInstrumentation.h" 38 38 #include "KURL.h" 39 #include "LoaderStrategy.h"40 39 #include "Logging.h" 41 #include "PlatformStrategies.h"42 40 #include "PurgeableBuffer.h" 43 41 #include "ResourceBuffer.h" … … 286 284 addAdditionalRequestHeaders(cachedResourceLoader); 287 285 288 #if USE(PLATFORM_STRATEGIES)289 m_loader = platformStrategies()->loaderStrategy()->resourceLoadScheduler()->scheduleSubresourceLoad(cachedResourceLoader->frame(), this, m_resourceRequest, m_resourceRequest.priority(), options);290 #else291 286 m_loader = resourceLoadScheduler()->scheduleSubresourceLoad(cachedResourceLoader->frame(), this, m_resourceRequest, m_resourceRequest.priority(), options); 292 #endif293 287 294 288 if (!m_loader) { -
trunk/Source/WebCore/loader/cache/CachedResourceLoader.cpp
r132520 r132695 45 45 #include "FrameLoaderClient.h" 46 46 #include "HTMLElement.h" 47 #include "LoaderStrategy.h"48 47 #include "Logging.h" 49 48 #include "MemoryCache.h" 50 49 #include "PingLoader.h" 51 #include "PlatformStrategies.h"52 50 #include "ResourceLoadScheduler.h" 53 51 #include "SecurityOrigin.h" … … 731 729 checkForPendingPreloads(); 732 730 733 #if USE(PLATFORM_STRATEGIES)734 platformStrategies()->loaderStrategy()->resourceLoadScheduler()->servePendingRequests();735 #else736 731 resourceLoadScheduler()->servePendingRequests(); 737 #endif738 732 } 739 733
Note:
See TracChangeset
for help on using the changeset viewer.