diff options
author | Steve Block <steveblock@google.com> | 2011-06-10 16:52:27 +0100 |
---|---|---|
committer | Steve Block <steveblock@google.com> | 2011-06-14 01:14:02 +0100 |
commit | 54cdeeebc7adcbcd900e8b6a141a8cae27d9a631 (patch) | |
tree | 845b0d338b204a48560eca3b51b34cf92ed96840 /Source/WebCore/loader | |
parent | d2c5226a647dc21d0c15267e09a3d19cf3e0d593 (diff) | |
download | external_webkit-54cdeeebc7adcbcd900e8b6a141a8cae27d9a631.zip external_webkit-54cdeeebc7adcbcd900e8b6a141a8cae27d9a631.tar.gz external_webkit-54cdeeebc7adcbcd900e8b6a141a8cae27d9a631.tar.bz2 |
Merge WebKit at branches/chromium/742 r88085: Initial merge by git.
Change-Id: I0501b484b9528e31b0026e5ad64416dd6541cdde
Diffstat (limited to 'Source/WebCore/loader')
-rw-r--r-- | Source/WebCore/loader/DocumentThreadableLoader.cpp | 4 | ||||
-rw-r--r-- | Source/WebCore/loader/EmptyClients.h | 1 | ||||
-rw-r--r-- | Source/WebCore/loader/HistoryController.cpp | 8 | ||||
-rw-r--r-- | Source/WebCore/loader/ResourceLoadScheduler.cpp | 4 | ||||
-rw-r--r-- | Source/WebCore/loader/ResourceLoadScheduler.h | 2 | ||||
-rw-r--r-- | Source/WebCore/loader/SubresourceLoader.cpp | 3 | ||||
-rw-r--r-- | Source/WebCore/loader/SubresourceLoader.h | 2 | ||||
-rw-r--r-- | Source/WebCore/loader/ThreadableLoader.h | 3 |
8 files changed, 18 insertions, 9 deletions
diff --git a/Source/WebCore/loader/DocumentThreadableLoader.cpp b/Source/WebCore/loader/DocumentThreadableLoader.cpp index f02994a..2fbf324 100644 --- a/Source/WebCore/loader/DocumentThreadableLoader.cpp +++ b/Source/WebCore/loader/DocumentThreadableLoader.cpp @@ -346,11 +346,13 @@ void DocumentThreadableLoader::loadRequest(const ResourceRequest& request, Secur // Don't sniff content or send load callbacks for the preflight request. bool sendLoadCallbacks = m_options.sendLoadCallbacks && !m_actualRequest; bool sniffContent = m_options.sniffContent && !m_actualRequest; + // Keep buffering the data for the preflight request. + bool shouldBufferData = m_options.shouldBufferData || m_actualRequest; // Clear the loader so that any callbacks from SubresourceLoader::create will not have the old loader. m_loader = 0; m_loader = resourceLoadScheduler()->scheduleSubresourceLoad(m_document->frame(), this, request, ResourceLoadPriorityMedium, securityCheck, sendLoadCallbacks, - sniffContent, m_optionalOutgoingReferrer); + sniffContent, m_optionalOutgoingReferrer, shouldBufferData); return; } diff --git a/Source/WebCore/loader/EmptyClients.h b/Source/WebCore/loader/EmptyClients.h index f082317..45df6ec 100644 --- a/Source/WebCore/loader/EmptyClients.h +++ b/Source/WebCore/loader/EmptyClients.h @@ -89,6 +89,7 @@ public: virtual ~EmptyChromeClient() { } virtual void chromeDestroyed() { } + virtual void* webView() const { return 0; } virtual void setWindowRect(const FloatRect&) { } virtual FloatRect windowRect() { return FloatRect(); } diff --git a/Source/WebCore/loader/HistoryController.cpp b/Source/WebCore/loader/HistoryController.cpp index f9d85bc..1abe30d 100644 --- a/Source/WebCore/loader/HistoryController.cpp +++ b/Source/WebCore/loader/HistoryController.cpp @@ -78,8 +78,12 @@ void HistoryController::saveScrollPositionAndViewStateToItem(HistoryItem* item) { if (!item || !m_frame->view()) return; - - item->setScrollPoint(m_frame->view()->cachedScrollPosition()); + + if (m_frame->document()->inPageCache()) + item->setScrollPoint(m_frame->view()->cachedScrollPosition()); + else + item->setScrollPoint(m_frame->view()->scrollPosition()); + item->setPageScaleFactor(m_frame->pageScaleFactor()); // FIXME: It would be great to work out a way to put this code in WebCore instead of calling through to the client. diff --git a/Source/WebCore/loader/ResourceLoadScheduler.cpp b/Source/WebCore/loader/ResourceLoadScheduler.cpp index 0c0abb1..7b6cba4 100644 --- a/Source/WebCore/loader/ResourceLoadScheduler.cpp +++ b/Source/WebCore/loader/ResourceLoadScheduler.cpp @@ -84,9 +84,9 @@ ResourceLoadScheduler::ResourceLoadScheduler() } PassRefPtr<SubresourceLoader> ResourceLoadScheduler::scheduleSubresourceLoad(Frame* frame, SubresourceLoaderClient* client, const ResourceRequest& request, ResourceLoadPriority priority, SecurityCheckPolicy securityCheck, - bool sendResourceLoadCallbacks, bool shouldContentSniff, const String& optionalOutgoingReferrer) + bool sendResourceLoadCallbacks, bool shouldContentSniff, const String& optionalOutgoingReferrer, bool shouldBufferData) { - RefPtr<SubresourceLoader> loader = SubresourceLoader::create(frame, client, request, securityCheck, sendResourceLoadCallbacks, shouldContentSniff, optionalOutgoingReferrer); + RefPtr<SubresourceLoader> loader = SubresourceLoader::create(frame, client, request, securityCheck, sendResourceLoadCallbacks, shouldContentSniff, optionalOutgoingReferrer, shouldBufferData); if (loader) scheduleLoad(loader.get(), priority); return loader.release(); diff --git a/Source/WebCore/loader/ResourceLoadScheduler.h b/Source/WebCore/loader/ResourceLoadScheduler.h index a32b307..a97d1d1 100644 --- a/Source/WebCore/loader/ResourceLoadScheduler.h +++ b/Source/WebCore/loader/ResourceLoadScheduler.h @@ -50,7 +50,7 @@ class ResourceLoadScheduler { public: friend ResourceLoadScheduler* resourceLoadScheduler(); - PassRefPtr<SubresourceLoader> scheduleSubresourceLoad(Frame*, SubresourceLoaderClient*, const ResourceRequest&, ResourceLoadPriority = ResourceLoadPriorityLow, SecurityCheckPolicy = DoSecurityCheck, bool sendResourceLoadCallbacks = true, bool shouldContentSniff = true, const String& optionalOutgoingReferrer = String()); + PassRefPtr<SubresourceLoader> scheduleSubresourceLoad(Frame*, SubresourceLoaderClient*, const ResourceRequest&, ResourceLoadPriority = ResourceLoadPriorityLow, SecurityCheckPolicy = DoSecurityCheck, bool sendResourceLoadCallbacks = true, bool shouldContentSniff = true, const String& optionalOutgoingReferrer = String(), bool shouldBufferData = true); PassRefPtr<NetscapePlugInStreamLoader> schedulePluginStreamLoad(Frame*, NetscapePlugInStreamLoaderClient*, const ResourceRequest&); void addMainResourceLoad(ResourceLoader*); void remove(ResourceLoader*); diff --git a/Source/WebCore/loader/SubresourceLoader.cpp b/Source/WebCore/loader/SubresourceLoader.cpp index 3e37c1c..acadfcd 100644 --- a/Source/WebCore/loader/SubresourceLoader.cpp +++ b/Source/WebCore/loader/SubresourceLoader.cpp @@ -60,7 +60,7 @@ SubresourceLoader::~SubresourceLoader() #endif } -PassRefPtr<SubresourceLoader> SubresourceLoader::create(Frame* frame, SubresourceLoaderClient* client, const ResourceRequest& request, SecurityCheckPolicy securityCheck, bool sendResourceLoadCallbacks, bool shouldContentSniff, const String& optionalOutgoingReferrer) +PassRefPtr<SubresourceLoader> SubresourceLoader::create(Frame* frame, SubresourceLoaderClient* client, const ResourceRequest& request, SecurityCheckPolicy securityCheck, bool sendResourceLoadCallbacks, bool shouldContentSniff, const String& optionalOutgoingReferrer, bool shouldBufferData) { if (!frame) return 0; @@ -95,6 +95,7 @@ PassRefPtr<SubresourceLoader> SubresourceLoader::create(Frame* frame, Subresourc fl->addExtraFieldsToSubresourceRequest(newRequest); RefPtr<SubresourceLoader> subloader(adoptRef(new SubresourceLoader(frame, client, sendResourceLoadCallbacks, shouldContentSniff))); + subloader->setShouldBufferData(shouldBufferData); subloader->documentLoader()->addSubresourceLoader(subloader.get()); if (!subloader->init(newRequest)) return 0; diff --git a/Source/WebCore/loader/SubresourceLoader.h b/Source/WebCore/loader/SubresourceLoader.h index a33b166..c45c9b8 100644 --- a/Source/WebCore/loader/SubresourceLoader.h +++ b/Source/WebCore/loader/SubresourceLoader.h @@ -41,7 +41,7 @@ namespace WebCore { class SubresourceLoader : public ResourceLoader { public: - static PassRefPtr<SubresourceLoader> create(Frame*, SubresourceLoaderClient*, const ResourceRequest&, SecurityCheckPolicy = DoSecurityCheck, bool sendResourceLoadCallbacks = true, bool shouldContentSniff = true, const String& optionalOutgoingReferrer = String()); + static PassRefPtr<SubresourceLoader> create(Frame*, SubresourceLoaderClient*, const ResourceRequest&, SecurityCheckPolicy = DoSecurityCheck, bool sendResourceLoadCallbacks = true, bool shouldContentSniff = true, const String& optionalOutgoingReferrer = String(), bool shouldBufferData = true); void clearClient() { m_client = 0; } diff --git a/Source/WebCore/loader/ThreadableLoader.h b/Source/WebCore/loader/ThreadableLoader.h index f574c94..b01f3ee 100644 --- a/Source/WebCore/loader/ThreadableLoader.h +++ b/Source/WebCore/loader/ThreadableLoader.h @@ -55,12 +55,13 @@ namespace WebCore { }; struct ThreadableLoaderOptions { - ThreadableLoaderOptions() : sendLoadCallbacks(false), sniffContent(false), allowCredentials(false), forcePreflight(false), crossOriginRequestPolicy(DenyCrossOriginRequests) { } + ThreadableLoaderOptions() : sendLoadCallbacks(false), sniffContent(false), allowCredentials(false), forcePreflight(false), crossOriginRequestPolicy(DenyCrossOriginRequests), shouldBufferData(true) { } bool sendLoadCallbacks; bool sniffContent; bool allowCredentials; // Whether HTTP credentials and cookies are sent with the request. bool forcePreflight; // If AccessControl is used, whether to force a preflight. CrossOriginRequestPolicy crossOriginRequestPolicy; + bool shouldBufferData; }; // Useful for doing loader operations from any thread (not threadsafe, |