summaryrefslogtreecommitdiffstats
path: root/chrome/common/resource_dispatcher.h
diff options
context:
space:
mode:
authorjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-12 21:42:52 +0000
committerjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-12 21:42:52 +0000
commiteb9989097eb86b7cc6e535a1d69112b3a38a02c0 (patch)
treec9918e47c10ae09ca9d0f82928075624b10c9c2a /chrome/common/resource_dispatcher.h
parent3e896efc285b9656fab36fa855d796b16634bd94 (diff)
downloadchromium_src-eb9989097eb86b7cc6e535a1d69112b3a38a02c0.zip
chromium_src-eb9989097eb86b7cc6e535a1d69112b3a38a02c0.tar.gz
chromium_src-eb9989097eb86b7cc6e535a1d69112b3a38a02c0.tar.bz2
Switch to using one ResourceDispatcher per render process, and move it to ChildThread so that the same code is used by the plugin process (and soon, workers).
Review URL: http://codereview.chromium.org/42108 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@11581 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common/resource_dispatcher.h')
-rw-r--r--chrome/common/resource_dispatcher.h26
1 files changed, 11 insertions, 15 deletions
diff --git a/chrome/common/resource_dispatcher.h b/chrome/common/resource_dispatcher.h
index b4e7fb1..3cdf1ee 100644
--- a/chrome/common/resource_dispatcher.h
+++ b/chrome/common/resource_dispatcher.h
@@ -20,15 +20,10 @@
struct ResourceResponseHead;
-// Uncomment this to disable loading resources via the parent process. This
-// may be useful for debugging purposes.
-//#define USING_SIMPLE_RESOURCE_LOADER_BRIDGE
-
// This class serves as a communication interface between the
// ResourceDispatcherHost in the browser process and the ResourceLoaderBridge in
-// the child process. It can be used from either the renderer or plugin
-// processes.
-class ResourceDispatcher : public base::RefCounted<ResourceDispatcher> {
+// the child process. It can be used from any child process.
+class ResourceDispatcher {
public:
explicit ResourceDispatcher(IPC::Message::Sender* sender);
~ResourceDispatcher();
@@ -49,7 +44,8 @@ class ResourceDispatcher : public base::RefCounted<ResourceDispatcher> {
int origin_pid,
ResourceType::Type resource_type,
bool mixed_content,
- uint32 request_context /* used for plugin->browser requests */);
+ uint32 request_context /* used for plugin->browser requests */,
+ int route_id);
// Adds a request from the pending_requests_ list, returning the new
// requests' ID
@@ -68,11 +64,6 @@ class ResourceDispatcher : public base::RefCounted<ResourceDispatcher> {
// Toggles the is_deferred attribute for the specified request.
void SetDefersLoading(int request_id, bool value);
- // We can no longer use message sender
- void ClearMessageSender() {
- message_sender_ = NULL;
- }
-
// Returns true if the message passed in is a resource related
// message.
bool IsResourceMessage(const IPC::Message& message) const;
@@ -103,10 +94,15 @@ class ResourceDispatcher : public base::RefCounted<ResourceDispatcher> {
typedef base::hash_map<int, PendingRequestInfo> PendingRequestList;
// Message response handlers, called by the message handler for this process.
- void OnUploadProgress(int request_id, int64 position, int64 size);
+ void OnUploadProgress(const IPC::Message& message,
+ int request_id,
+ int64 position,
+ int64 size);
void OnReceivedResponse(int request_id, const ResourceResponseHead&);
void OnReceivedRedirect(int request_id, const GURL& new_url);
- void OnReceivedData(int request_id, base::SharedMemoryHandle data,
+ void OnReceivedData(const IPC::Message& message,
+ int request_id,
+ base::SharedMemoryHandle data,
int data_len);
void OnRequestComplete(int request_id,
const URLRequestStatus& status,