[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.17-1283-gcf603cf
japhet at chromium.org
japhet at chromium.org
Tue Jan 5 23:57:50 UTC 2010
The following commit has been merged in the webkit-1.1 branch:
commit ca3f741c25c77cd3ed814ca336c8e073c5fc5a04
Author: japhet at chromium.org <japhet at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Mon Dec 21 22:39:46 2009 +0000
2009-12-21 Nate Chapin <japhet at chromium.org>
Rubber-stamped by Darin Adler.
Revert r52446 due to crashiness.
https://bugs.webkit.org/show_bug.cgi?id=32839
* loader/DocumentThreadableLoader.cpp:
(WebCore::DocumentThreadableLoader::loadRequest):
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::FrameLoader):
(WebCore::FrameLoader::stopLoading):
(WebCore::FrameLoader::loadURL):
(WebCore::FrameLoader::loadWithDocumentLoader):
(WebCore::FrameLoader::stopAllLoaders):
(WebCore::FrameLoader::continueLoadAfterNavigationPolicy):
(WebCore::FrameLoader::pageHidden):
* loader/FrameLoader.h:
(WebCore::FrameLoader::suppressOpenerInNewFrame):
* loader/Request.cpp:
(WebCore::Request::Request):
(WebCore::Request::~Request):
* loader/Request.h:
* loader/SubresourceLoader.cpp:
(WebCore::SubresourceLoader::create):
* loader/SubresourceLoader.h:
* loader/loader.cpp:
(WebCore::Loader::load):
(WebCore::Loader::cancelRequests):
(WebCore::Loader::Host::servePendingRequests):
(WebCore::Loader::Host::cancelPendingRequests):
(WebCore::Loader::Host::cancelRequests):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@52456 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index d170e9e..c4b8209 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,17 @@
+2009-12-21 Nate Chapin <japhet at chromium.org>
+
+ Rubber-stamped by Darin Adler.
+
+ Revert r52446 due to crashiness.
+
+ https://bugs.webkit.org/show_bug.cgi?id=32839
+
+ * http/tests/navigation/image-load-in-beforeunload-handler-expected.txt:
+ * http/tests/navigation/image-load-in-beforeunload-handler.html:
+ * http/tests/navigation/image-load-in-unload-handler-expected.txt:
+ * http/tests/navigation/image-load-in-unload-handler.html:
+ * http/tests/navigation/resources/wait-then-notify-done.html:
+
2009-12-21 Dirk Schulze <krit at webkit.org>
Reviewed by Darin Adler and Nikolas Zimmermann.
diff --git a/LayoutTests/http/tests/navigation/image-load-in-beforeunload-handler-expected.txt b/LayoutTests/http/tests/navigation/image-load-in-beforeunload-handler-expected.txt
index 1d14e99..e69de29 100644
--- a/LayoutTests/http/tests/navigation/image-load-in-beforeunload-handler-expected.txt
+++ b/LayoutTests/http/tests/navigation/image-load-in-beforeunload-handler-expected.txt
@@ -1,8 +0,0 @@
-<unknown> - didFailLoadingWithError: <NSError domain NSURLErrorDomain, code -999, failing URL "http://127.0.0.1:8000/navigation/image-load-in-beforeunload-handler.html">
-http://127.0.0.1:8000/navigation/resources/wait-then-notify-done.html - willSendRequest <NSURLRequest URL http://127.0.0.1:8000/navigation/resources/wait-then-notify-done.html, main document URL http://127.0.0.1:8000/navigation/resources/wait-then-notify-done.html, http method GET> redirectResponse (null)
-http://127.0.0.1:8000/navigation/resources/slow-resource-1-sec.pl - willSendRequest <NSURLRequest URL http://127.0.0.1:8000/navigation/resources/slow-resource-1-sec.pl, main document URL http://127.0.0.1:8000/navigation/image-load-in-beforeunload-handler.html, http method GET> redirectResponse (null)
-http://127.0.0.1:8000/navigation/resources/wait-then-notify-done.html - didReceiveResponse <NSURLResponse http://127.0.0.1:8000/navigation/resources/wait-then-notify-done.html, http status code 200>
-http://127.0.0.1:8000/navigation/resources/wait-then-notify-done.html - didFinishLoading
-http://127.0.0.1:8000/navigation/resources/slow-resource-1-sec.pl - didReceiveResponse <NSURLResponse http://127.0.0.1:8000/navigation/resources/slow-resource-1-sec.pl, http status code 200>
-http://127.0.0.1:8000/navigation/resources/slow-resource-1-sec.pl - didFinishLoading
-
diff --git a/LayoutTests/http/tests/navigation/image-load-in-beforeunload-handler.html b/LayoutTests/http/tests/navigation/image-load-in-beforeunload-handler.html
index e87553e..e69de29 100644
--- a/LayoutTests/http/tests/navigation/image-load-in-beforeunload-handler.html
+++ b/LayoutTests/http/tests/navigation/image-load-in-beforeunload-handler.html
@@ -1,23 +0,0 @@
-<html><head>
-<title>Image load in unload handler</title>
-<script>
-function navigate() {
- if (window.layoutTestController) {
- layoutTestController.dumpAsText();
- layoutTestController.dumpResourceLoadCallbacks();
- layoutTestController.waitUntilDone();
- var target = document.getElementById("link");
- eventSender.mouseMoveTo(target.offsetLeft + 2, target.offsetTop + 2);
- eventSender.mouseDown();
- eventSender.mouseUp();
- }
-}
-
-function requestImage() {
- var img = new Image(1, 1);
- img.src = "resources/slow-resource-1-sec.pl";
-}
-</script></head>
-<body onload="navigate();" onbeforeunload="requestImage();">
-<a id="link" href="resources/wait-then-notify-done.html">link</a>
-</body></html>
diff --git a/LayoutTests/http/tests/navigation/image-load-in-unload-handler-expected.txt b/LayoutTests/http/tests/navigation/image-load-in-unload-handler-expected.txt
index 9d0552c..e69de29 100644
--- a/LayoutTests/http/tests/navigation/image-load-in-unload-handler-expected.txt
+++ b/LayoutTests/http/tests/navigation/image-load-in-unload-handler-expected.txt
@@ -1,9 +0,0 @@
-main frame - has 1 onunload handler(s)
-<unknown> - didFailLoadingWithError: <NSError domain NSURLErrorDomain, code -999, failing URL "http://127.0.0.1:8000/navigation/image-load-in-unload-handler.html">
-http://127.0.0.1:8000/navigation/resources/wait-then-notify-done.html - willSendRequest <NSURLRequest URL http://127.0.0.1:8000/navigation/resources/wait-then-notify-done.html, main document URL http://127.0.0.1:8000/navigation/resources/wait-then-notify-done.html, http method GET> redirectResponse (null)
-http://127.0.0.1:8000/navigation/resources/wait-then-notify-done.html - didReceiveResponse <NSURLResponse http://127.0.0.1:8000/navigation/resources/wait-then-notify-done.html, http status code 200>
-http://127.0.0.1:8000/navigation/resources/wait-then-notify-done.html - didFinishLoading
-http://127.0.0.1:8000/navigation/resources/slow-resource-1-sec.pl - willSendRequest <NSURLRequest URL http://127.0.0.1:8000/navigation/resources/slow-resource-1-sec.pl, main document URL http://127.0.0.1:8000/navigation/resources/wait-then-notify-done.html, http method GET> redirectResponse (null)
-http://127.0.0.1:8000/navigation/resources/slow-resource-1-sec.pl - didReceiveResponse <NSURLResponse http://127.0.0.1:8000/navigation/resources/slow-resource-1-sec.pl, http status code 200>
-http://127.0.0.1:8000/navigation/resources/slow-resource-1-sec.pl - didFinishLoading
-
diff --git a/LayoutTests/http/tests/navigation/image-load-in-unload-handler.html b/LayoutTests/http/tests/navigation/image-load-in-unload-handler.html
index 725bd5c..e69de29 100644
--- a/LayoutTests/http/tests/navigation/image-load-in-unload-handler.html
+++ b/LayoutTests/http/tests/navigation/image-load-in-unload-handler.html
@@ -1,24 +0,0 @@
-<html><head>
-<title>Image load in unload handler</title>
-<script>
-function navigate() {
- if (window.layoutTestController) {
- layoutTestController.dumpAsText();
- layoutTestController.dumpResourceLoadCallbacks();
- layoutTestController.waitUntilDone();
- var target = document.getElementById("link");
- eventSender.mouseMoveTo(target.offsetLeft + 2, target.offsetTop + 2);
- eventSender.mouseDown();
- eventSender.mouseUp();
- }
-}
-
-function requestImage() {
- var img = new Image(1, 1);
- img.src = "resources/slow-resource-1-sec.pl";
-}
-</script>
-</head>
-<body onload="navigate();" onunload="requestImage();">
-<a id="link" href="resources/wait-then-notify-done.html">link</a>
-</body></html>
diff --git a/LayoutTests/http/tests/navigation/resources/wait-then-notify-done.html b/LayoutTests/http/tests/navigation/resources/wait-then-notify-done.html
index ed43ec4..e69de29 100644
--- a/LayoutTests/http/tests/navigation/resources/wait-then-notify-done.html
+++ b/LayoutTests/http/tests/navigation/resources/wait-then-notify-done.html
@@ -1,9 +0,0 @@
-<html>
-<script>
- if (window.layoutTestController) {
- setTimeout(function() {
- layoutTestController.notifyDone();
- }, 2000);
- }
-</script>
-</html>
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index b773faa..d4b7c5e 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,37 @@
+2009-12-21 Nate Chapin <japhet at chromium.org>
+
+ Rubber-stamped by Darin Adler.
+
+ Revert r52446 due to crashiness.
+
+ https://bugs.webkit.org/show_bug.cgi?id=32839
+
+ * loader/DocumentThreadableLoader.cpp:
+ (WebCore::DocumentThreadableLoader::loadRequest):
+ * loader/FrameLoader.cpp:
+ (WebCore::FrameLoader::FrameLoader):
+ (WebCore::FrameLoader::stopLoading):
+ (WebCore::FrameLoader::loadURL):
+ (WebCore::FrameLoader::loadWithDocumentLoader):
+ (WebCore::FrameLoader::stopAllLoaders):
+ (WebCore::FrameLoader::continueLoadAfterNavigationPolicy):
+ (WebCore::FrameLoader::pageHidden):
+ * loader/FrameLoader.h:
+ (WebCore::FrameLoader::suppressOpenerInNewFrame):
+ * loader/Request.cpp:
+ (WebCore::Request::Request):
+ (WebCore::Request::~Request):
+ * loader/Request.h:
+ * loader/SubresourceLoader.cpp:
+ (WebCore::SubresourceLoader::create):
+ * loader/SubresourceLoader.h:
+ * loader/loader.cpp:
+ (WebCore::Loader::load):
+ (WebCore::Loader::cancelRequests):
+ (WebCore::Loader::Host::servePendingRequests):
+ (WebCore::Loader::Host::cancelPendingRequests):
+ (WebCore::Loader::Host::cancelRequests):
+
2009-12-19 Kent Tamura <tkent at chromium.org>
Reviewed by Adam Barth.
diff --git a/WebCore/loader/DocumentThreadableLoader.cpp b/WebCore/loader/DocumentThreadableLoader.cpp
index 43580e4..de0a0b0 100644
--- a/WebCore/loader/DocumentThreadableLoader.cpp
+++ b/WebCore/loader/DocumentThreadableLoader.cpp
@@ -299,7 +299,7 @@ void DocumentThreadableLoader::loadRequest(const ResourceRequest& request, Secur
// Clear the loader so that any callbacks from SubresourceLoader::create will not have the old loader.
m_loader = 0;
- m_loader = SubresourceLoader::create(m_document->frame(), this, request, securityCheck, DoNotOutlivePage, sendLoadCallbacks, sniffContent);
+ m_loader = SubresourceLoader::create(m_document->frame(), this, request, securityCheck, sendLoadCallbacks, sniffContent);
return;
}
diff --git a/WebCore/loader/FrameLoader.cpp b/WebCore/loader/FrameLoader.cpp
index 7c7aa3e..e457fd9 100644
--- a/WebCore/loader/FrameLoader.cpp
+++ b/WebCore/loader/FrameLoader.cpp
@@ -180,8 +180,7 @@ FrameLoader::FrameLoader(Frame* frame, FrameLoaderClient* client)
, m_isExecutingJavaScriptFormAction(false)
, m_didCallImplicitClose(false)
, m_wasUnloadEventEmitted(false)
- , m_isDispatchingBeforeUnloadEvent(false)
- , m_isDispatchingUnloadEvent(false)
+ , m_unloadEventBeingDispatched(false)
, m_isComplete(false)
, m_isLoadingMainResource(false)
, m_needsClear(false)
@@ -518,16 +517,14 @@ void FrameLoader::stopLoading(UnloadEventPolicy unloadEventPolicy, DatabasePolic
Node* currentFocusedNode = m_frame->document()->focusedNode();
if (currentFocusedNode)
currentFocusedNode->aboutToUnload();
- ASSERT(!m_isDispatchingUnloadEvent);
- m_isDispatchingUnloadEvent = true;
+ m_unloadEventBeingDispatched = true;
if (m_frame->domWindow()) {
if (unloadEventPolicy == UnloadEventPolicyUnloadAndPageHide)
m_frame->domWindow()->dispatchEvent(PageTransitionEvent::create(eventNames().pagehideEvent, m_frame->document()->inPageCache()), m_frame->document());
if (!m_frame->document()->inPageCache())
m_frame->domWindow()->dispatchEvent(Event::create(eventNames().unloadEvent, false, false), m_frame->domWindow()->document());
}
- ASSERT(m_isDispatchingUnloadEvent);
- m_isDispatchingUnloadEvent = false;
+ m_unloadEventBeingDispatched = false;
if (m_frame->document())
m_frame->document()->updateStyleIfNeeded();
m_wasUnloadEventEmitted = true;
@@ -1911,7 +1908,7 @@ void FrameLoader::loadURL(const KURL& newURL, const String& referrer, const Stri
return;
}
- if (m_isDispatchingUnloadEvent)
+ if (m_unloadEventBeingDispatched)
return;
NavigationAction action(newURL, newLoadType, isFormSubmission, event);
@@ -2037,7 +2034,7 @@ void FrameLoader::loadWithDocumentLoader(DocumentLoader* loader, FrameLoadType t
ASSERT(m_frame->view());
- if (m_isDispatchingUnloadEvent)
+ if (m_unloadEventBeingDispatched)
return;
policyChecker()->setLoadType(type);
@@ -2279,7 +2276,7 @@ void FrameLoader::stopLoadingSubframes()
void FrameLoader::stopAllLoaders(DatabasePolicy databasePolicy)
{
ASSERT(!m_frame->document() || !m_frame->document()->inPageCache());
- if (m_isDispatchingUnloadEvent)
+ if (m_unloadEventBeingDispatched)
return;
// If this method is called from within this method, infinite recursion can occur (3442218). Avoid this.
@@ -3436,11 +3433,7 @@ void FrameLoader::continueLoadAfterNavigationPolicy(const ResourceRequest&, Pass
// is the user responding Cancel to the form repost nag sheet.
// 2) User responded Cancel to an alert popped up by the before unload event handler.
// The "before unload" event handler runs only for the main frame.
- ASSERT(!m_isDispatchingBeforeUnloadEvent);
- m_isDispatchingBeforeUnloadEvent = true;
bool canContinue = shouldContinue && (!isLoadingMainFrame() || m_frame->shouldClose());
- ASSERT(m_isDispatchingBeforeUnloadEvent);
- m_isDispatchingBeforeUnloadEvent = false;
if (!canContinue) {
// If we were waiting for a quick redirect, but the policy delegate decided to ignore it, then we
@@ -3634,12 +3627,10 @@ void FrameLoader::cachePageForHistoryItem(HistoryItem* item)
void FrameLoader::pageHidden()
{
- ASSERT(!m_isDispatchingUnloadEvent);
- m_isDispatchingUnloadEvent = true;
+ m_unloadEventBeingDispatched = true;
if (m_frame->domWindow())
m_frame->domWindow()->dispatchEvent(PageTransitionEvent::create(eventNames().pagehideEvent, true), m_frame->document());
- ASSERT(m_isDispatchingUnloadEvent);
- m_isDispatchingUnloadEvent = false;
+ m_unloadEventBeingDispatched = false;
// Send pagehide event for subframes as well
for (Frame* child = m_frame->tree()->firstChild(); child; child = child->tree()->nextSibling())
diff --git a/WebCore/loader/FrameLoader.h b/WebCore/loader/FrameLoader.h
index b499cad..7304bfd 100644
--- a/WebCore/loader/FrameLoader.h
+++ b/WebCore/loader/FrameLoader.h
@@ -333,8 +333,6 @@ public:
void continueLoadAfterWillSubmitForm();
bool suppressOpenerInNewFrame() const { return m_suppressOpenerInNewFrame; }
-
- bool isDispatchingUnloadFamilyEvent() const { return m_isDispatchingBeforeUnloadEvent || m_isDispatchingUnloadEvent; }
static ObjectContentType defaultObjectContentType(const KURL& url, const String& mimeType);
@@ -481,8 +479,7 @@ private:
bool m_didCallImplicitClose;
bool m_wasUnloadEventEmitted;
- bool m_isDispatchingBeforeUnloadEvent;
- bool m_isDispatchingUnloadEvent;
+ bool m_unloadEventBeingDispatched;
bool m_isComplete;
bool m_isLoadingMainResource;
diff --git a/WebCore/loader/Request.cpp b/WebCore/loader/Request.cpp
index 7cb8934..630a4bb 100644
--- a/WebCore/loader/Request.cpp
+++ b/WebCore/loader/Request.cpp
@@ -25,12 +25,10 @@
#include "Request.h"
#include "CachedResource.h"
-#include "DocLoader.h"
-#include "Frame.h"
namespace WebCore {
-Request::Request(DocLoader* docLoader, CachedResource* object, bool incremental, SecurityCheckPolicy shouldDoSecurityCheck, OutlivePagePolicy outlivePagePolicy, bool sendResourceLoadCallbacks)
+Request::Request(DocLoader* docLoader, CachedResource* object, bool incremental, SecurityCheckPolicy shouldDoSecurityCheck, bool sendResourceLoadCallbacks)
: m_object(object)
, m_docLoader(docLoader)
, m_incremental(incremental)
@@ -39,18 +37,11 @@ Request::Request(DocLoader* docLoader, CachedResource* object, bool incremental,
, m_sendResourceLoadCallbacks(sendResourceLoadCallbacks)
{
m_object->setRequest(this);
- if (outlivePagePolicy == OutlivePage)
- m_frameForRequestThatCanOutlivePage = docLoader->frame();
}
Request::~Request()
{
m_object->setRequest(0);
}
-
-Frame* Request::frame() const
-{
- return m_frameForRequestThatCanOutlivePage ? m_frameForRequestThatCanOutlivePage.get() : m_docLoader->frame();
-}
} //namespace WebCore
diff --git a/WebCore/loader/Request.h b/WebCore/loader/Request.h
index 20f358d..468f8ff 100644
--- a/WebCore/loader/Request.h
+++ b/WebCore/loader/Request.h
@@ -24,23 +24,16 @@
#define Request_h
#include "FrameLoaderTypes.h"
-#include <wtf/RefPtr.h>
#include <wtf/Vector.h>
namespace WebCore {
class CachedResource;
class DocLoader;
- class Frame;
-
- enum OutlivePagePolicy {
- DoNotOutlivePage,
- OutlivePage
- };
class Request : public Noncopyable {
public:
- Request(DocLoader*, CachedResource*, bool incremental, SecurityCheckPolicy, OutlivePagePolicy, bool sendResourceLoadCallbacks);
+ Request(DocLoader*, CachedResource*, bool incremental, SecurityCheckPolicy, bool sendResourceLoadCallbacks);
~Request();
Vector<char>& buffer() { return m_buffer; }
@@ -56,9 +49,6 @@ namespace WebCore {
SecurityCheckPolicy shouldDoSecurityCheck() const { return m_shouldDoSecurityCheck; }
bool sendResourceLoadCallbacks() const { return m_sendResourceLoadCallbacks; }
- OutlivePagePolicy canOutlivePage() const { return m_frameForRequestThatCanOutlivePage ? OutlivePage : DoNotOutlivePage; }
- Frame* frame() const;
-
private:
Vector<char> m_buffer;
CachedResource* m_object;
@@ -67,7 +57,6 @@ namespace WebCore {
bool m_multipart;
SecurityCheckPolicy m_shouldDoSecurityCheck;
bool m_sendResourceLoadCallbacks;
- RefPtr<Frame> m_frameForRequestThatCanOutlivePage;
};
} //namespace WebCore
diff --git a/WebCore/loader/SubresourceLoader.cpp b/WebCore/loader/SubresourceLoader.cpp
index cc8e47d..f92a074 100644
--- a/WebCore/loader/SubresourceLoader.cpp
+++ b/WebCore/loader/SubresourceLoader.cpp
@@ -61,18 +61,18 @@ SubresourceLoader::~SubresourceLoader()
#endif
}
-PassRefPtr<SubresourceLoader> SubresourceLoader::create(Frame* frame, SubresourceLoaderClient* client, const ResourceRequest& request, SecurityCheckPolicy securityCheckPolicy, OutlivePagePolicy outlivePagePolicy, bool sendResourceLoadCallbacks, bool shouldContentSniff)
+PassRefPtr<SubresourceLoader> SubresourceLoader::create(Frame* frame, SubresourceLoaderClient* client, const ResourceRequest& request, SecurityCheckPolicy securityCheck, bool sendResourceLoadCallbacks, bool shouldContentSniff)
{
if (!frame)
return 0;
FrameLoader* fl = frame->loader();
- if (outlivePagePolicy == DoNotOutlivePage && (fl->state() == FrameStateProvisional || fl->activeDocumentLoader()->isStopping()))
+ if (securityCheck == DoSecurityCheck && (fl->state() == FrameStateProvisional || fl->activeDocumentLoader()->isStopping()))
return 0;
ResourceRequest newRequest = request;
- if (securityCheckPolicy == DoSecurityCheck
+ if (securityCheck == DoSecurityCheck
&& SecurityOrigin::restrictAccessToLocal()
&& !SecurityOrigin::canLoad(request.url(), String(), frame->document())) {
FrameLoader::reportLocalLoadFailed(frame, request.url().string());
diff --git a/WebCore/loader/SubresourceLoader.h b/WebCore/loader/SubresourceLoader.h
index d75c1f7..907d917 100644
--- a/WebCore/loader/SubresourceLoader.h
+++ b/WebCore/loader/SubresourceLoader.h
@@ -30,7 +30,6 @@
#define SubresourceLoader_h
#include "FrameLoaderTypes.h"
-#include "Request.h"
#include "ResourceLoader.h"
namespace WebCore {
@@ -40,7 +39,7 @@ namespace WebCore {
class SubresourceLoader : public ResourceLoader {
public:
- static PassRefPtr<SubresourceLoader> create(Frame*, SubresourceLoaderClient*, const ResourceRequest&, SecurityCheckPolicy = DoSecurityCheck, OutlivePagePolicy = DoNotOutlivePage, bool sendResourceLoadCallbacks = true, bool shouldContentSniff = true);
+ static PassRefPtr<SubresourceLoader> create(Frame*, SubresourceLoaderClient*, const ResourceRequest&, SecurityCheckPolicy = DoSecurityCheck, bool sendResourceLoadCallbacks = true, bool shouldContentSniff = true);
void clearClient() { m_client = 0; }
diff --git a/WebCore/loader/loader.cpp b/WebCore/loader/loader.cpp
index 7536f6a..a99bf87 100644
--- a/WebCore/loader/loader.cpp
+++ b/WebCore/loader/loader.cpp
@@ -120,16 +120,7 @@ Loader::Priority Loader::determinePriority(const CachedResource* resource) const
void Loader::load(DocLoader* docLoader, CachedResource* resource, bool incremental, SecurityCheckPolicy securityCheck, bool sendResourceLoadCallbacks)
{
ASSERT(docLoader);
-
- // If we are loading an image during an unload event, we want to allow the request to outlive the page
- // that we are leaving. Some sites (most commonly ad networks) rely on image requests in beforeunload
- // or unload event handlers to track time spent on the page. This will allow them to do the tracking
- // that they are going to do anyway, but asynchronously so that they don't slow down navigation.
- OutlivePagePolicy outlivePagePolicy = resource->isImage() && docLoader && docLoader->frame()
- && docLoader->frame()->loader()->isDispatchingUnloadFamilyEvent()
- ? OutlivePage : DoNotOutlivePage;
-
- Request* request = new Request(docLoader, resource, incremental, securityCheck, outlivePagePolicy, sendResourceLoadCallbacks);
+ Request* request = new Request(docLoader, resource, incremental, securityCheck, sendResourceLoadCallbacks);
RefPtr<Host> host;
KURL url(ParsedURLString, resource->url());
@@ -147,10 +138,8 @@ void Loader::load(DocLoader* docLoader, CachedResource* resource, bool increment
Priority priority = determinePriority(resource);
host->addRequest(request, priority);
docLoader->incrementRequestCount();
-
- // We want to guarantee that requests which outlive the page are run asynchronously, so only
- // serve the request immediately if the request doesn't need to outlive the page.
- if (request->canOutlivePage() == DoNotOutlivePage && (priority > Low || !url.protocolInHTTPFamily() || !hadRequests)) {
+
+ if (priority > Low || !url.protocolInHTTPFamily() || !hadRequests) {
// Try to request important resources immediately
host->servePendingRequests(priority);
} else {
@@ -259,6 +248,8 @@ void Loader::cancelRequests(DocLoader* docLoader)
}
scheduleServePendingRequests();
+
+ ASSERT(docLoader->requestCount() == (docLoader->loadInProgress() ? 1 : 0));
}
Loader::Host::Host(const AtomicString& name, unsigned maxRequestsInFlight)
@@ -355,8 +346,8 @@ void Loader::Host::servePendingRequests(RequestQueue& requestsPending, bool& ser
}
}
- RefPtr<SubresourceLoader> loader = SubresourceLoader::create(request->frame(),
- this, resourceRequest, request->shouldDoSecurityCheck(), request->canOutlivePage(), request->sendResourceLoadCallbacks());
+ RefPtr<SubresourceLoader> loader = SubresourceLoader::create(docLoader->doc()->frame(),
+ this, resourceRequest, request->shouldDoSecurityCheck(), request->sendResourceLoadCallbacks());
if (loader) {
m_requestsLoading.add(loader.release(), request);
request->cachedResource()->setRequestedFromNetworkingLayer();
@@ -559,7 +550,7 @@ void Loader::Host::cancelPendingRequests(RequestQueue& requestsPending, DocLoade
RequestQueue::iterator end = requestsPending.end();
for (RequestQueue::iterator it = requestsPending.begin(); it != end; ++it) {
Request* request = *it;
- if (request->canOutlivePage() == DoNotOutlivePage && request->docLoader() == docLoader) {
+ if (request->docLoader() == docLoader) {
cache()->remove(request->cachedResource());
delete request;
docLoader->decrementRequestCount();
@@ -579,7 +570,7 @@ void Loader::Host::cancelRequests(DocLoader* docLoader)
RequestMap::iterator end = m_requestsLoading.end();
for (RequestMap::iterator i = m_requestsLoading.begin(); i != end; ++i) {
Request* r = i->second;
- if (r->canOutlivePage() == DoNotOutlivePage && r->docLoader() == docLoader)
+ if (r->docLoader() == docLoader)
loadersToCancel.append(i->first.get());
}
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list