diff options
author | darin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-11 22:20:39 +0000 |
---|---|---|
committer | darin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-11 22:20:39 +0000 |
commit | b2787cf4c95b5e22162a345140a9350bcd5b675e (patch) | |
tree | a2cb733808ccec4cab58919c120b1f0be9dde53d /webkit/api | |
parent | 23bd81e08bf59f02ad164caa42ea1b18807c2420 (diff) | |
download | chromium_src-b2787cf4c95b5e22162a345140a9350bcd5b675e.zip chromium_src-b2787cf4c95b5e22162a345140a9350bcd5b675e.tar.gz chromium_src-b2787cf4c95b5e22162a345140a9350bcd5b675e.tar.bz2 |
Fix javascript-backslash.html layout test failure.
The fix is to break WebURLLoaderImpl into two classes. It now has a
reference counted inner class that is the ResourceLoaderBridge::Peer.
This change allows the inner class to stick around after the loader
has been destroyed. That is necessary since the Peer expects to still
receive OnCompletedRequest after it calls Cancel on the bridge.
R=dglazkov
TEST=covered by layout test
BUG=13786
Review URL: http://codereview.chromium.org/125002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18215 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/api')
-rw-r--r-- | webkit/api/public/WebURLLoader.h | 1 | ||||
-rw-r--r-- | webkit/api/src/ResourceHandle.cpp | 25 |
2 files changed, 1 insertions, 25 deletions
diff --git a/webkit/api/public/WebURLLoader.h b/webkit/api/public/WebURLLoader.h index e9027c4..b279987 100644 --- a/webkit/api/public/WebURLLoader.h +++ b/webkit/api/public/WebURLLoader.h @@ -42,6 +42,7 @@ namespace WebKit { class WebURLLoader { public: + // The WebURLLoader may be deleted in a call to its client. virtual ~WebURLLoader() {} // Load the request synchronously, returning results directly to the diff --git a/webkit/api/src/ResourceHandle.cpp b/webkit/api/src/ResourceHandle.cpp index 7b4043c..b7def8d 100644 --- a/webkit/api/src/ResourceHandle.cpp +++ b/webkit/api/src/ResourceHandle.cpp @@ -41,7 +41,6 @@ #include "WrappedResourceRequest.h" #include "WrappedResourceResponse.h" -#include "MainThread.h" #include "ResourceHandleClient.h" #include "ResourceRequest.h" @@ -49,16 +48,6 @@ using namespace WebKit; namespace WebCore { -static void deleteLoader(void* param) -{ - delete static_cast<WebURLLoader*>(param); -} - -static void deleteLoaderSoon(WebURLLoader* loader) -{ - callOnMainThread(deleteLoader, loader); -} - // ResourceHandleInternal ----------------------------------------------------- class ResourceHandleInternal : public WebURLLoaderClient { @@ -70,8 +59,6 @@ public: { } - ~ResourceHandleInternal(); - void start(); void cancel(); void setDefersLoading(bool); @@ -92,18 +79,6 @@ public: OwnPtr<WebURLLoader> m_loader; }; -ResourceHandleInternal::~ResourceHandleInternal() -{ - if (m_loader.get()) { - m_loader->cancel(); - // The loader is typically already on the stack at this point, so we - // need to defer its destruction. - // FIXME: We should probably add a "dispose" method on WebURLLoader and - // push this deferred destruction logic into the loader implementation. - deleteLoaderSoon(m_loader.release()); - } -} - void ResourceHandleInternal::start() { m_loader.set(webKitClient()->createURLLoader()); |