summaryrefslogtreecommitdiffstats
path: root/content/browser/renderer_host/resource_handler.h
diff options
context:
space:
mode:
authordarin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-01-18 22:53:16 +0000
committerdarin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-01-18 22:53:16 +0000
commit62b4a96eea2fa5f53e751c2d01ba61ded20651a9 (patch)
tree8139c0058f7ba2f22285b471476198f9a91cc16f /content/browser/renderer_host/resource_handler.h
parent42a04b94210311357b97c8afed59afad3a58480f (diff)
downloadchromium_src-62b4a96eea2fa5f53e751c2d01ba61ded20651a9.zip
chromium_src-62b4a96eea2fa5f53e751c2d01ba61ded20651a9.tar.gz
chromium_src-62b4a96eea2fa5f53e751c2d01ba61ded20651a9.tar.bz2
Make CancelRequest trigger the destruction of URLRequest objects asynchronously
in all cases. r77640 introduced code to CancelRequest that calls OnResponseCompleted directly if the URLRequest has not yet been started. That's important, but this has the side-effect of poking ResourceHandlers while they are calling CancelRequest. As a result, CancelRequest can sometimes be the equivalent of "delete this" for a ResourceHandler! This change makes it so that we call OnResponseCompleted asynchronously. Doing so requires referencing the URLRequest by (child_id,request_id) pair. I created default implementations for ResourceDispatcherHostDelegate to simplify the test code, and I made a small tweak to LayeredResourceHandler, allowing it to have a NULL next_handler_ at initialization time since the test wants to set that later. Review URL: http://codereview.chromium.org/9207018 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@118177 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/browser/renderer_host/resource_handler.h')
-rw-r--r--content/browser/renderer_host/resource_handler.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/content/browser/renderer_host/resource_handler.h b/content/browser/renderer_host/resource_handler.h
index 9d8bdda..5f242f01 100644
--- a/content/browser/renderer_host/resource_handler.h
+++ b/content/browser/renderer_host/resource_handler.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -16,6 +16,7 @@
#include <string>
#include "base/message_loop_helpers.h"
+#include "content/common/content_export.h"
#include "content/public/browser/browser_thread.h"
class GURL;
@@ -32,7 +33,7 @@ class URLRequestStatus;
// The resource dispatcher host uses this interface to push load events to the
// renderer, allowing for differences in the types of IPC messages generated.
// See the implementations of this interface defined below.
-class ResourceHandler
+class CONTENT_EXPORT ResourceHandler
: public base::RefCountedThreadSafe<
ResourceHandler, content::BrowserThread::DeleteOnIOThread> {
public:
@@ -92,6 +93,8 @@ class ResourceHandler
protected:
friend class content::BrowserThread;
+ friend class base::RefCountedThreadSafe<
+ ResourceHandler, content::BrowserThread::DeleteOnIOThread>;
friend class base::DeleteHelper<ResourceHandler>;
virtual ~ResourceHandler() {}