| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // See http://dev.chromium.org/developers/design-documents/multi-process-resourc
e-loading | 5 // See http://dev.chromium.org/developers/design-documents/multi-process-resourc
e-loading |
| 6 | 6 |
| 7 #ifndef CONTENT_CHILD_RESOURCE_DISPATCHER_H_ | 7 #ifndef CONTENT_CHILD_RESOURCE_DISPATCHER_H_ |
| 8 #define CONTENT_CHILD_RESOURCE_DISPATCHER_H_ | 8 #define CONTENT_CHILD_RESOURCE_DISPATCHER_H_ |
| 9 | 9 |
| 10 #include <deque> | 10 #include <deque> |
| 11 #include <string> | 11 #include <string> |
| 12 | 12 |
| 13 #include "base/containers/hash_tables.h" | 13 #include "base/containers/hash_tables.h" |
| 14 #include "base/memory/linked_ptr.h" | 14 #include "base/memory/linked_ptr.h" |
| 15 #include "base/memory/shared_memory.h" | 15 #include "base/memory/shared_memory.h" |
| 16 #include "base/memory/weak_ptr.h" | 16 #include "base/memory/weak_ptr.h" |
| 17 #include "base/time/time.h" | 17 #include "base/time/time.h" |
| 18 #include "content/common/content_export.h" | 18 #include "content/common/content_export.h" |
| 19 #include "ipc/ipc_listener.h" | 19 #include "ipc/ipc_listener.h" |
| 20 #include "ipc/ipc_sender.h" | 20 #include "ipc/ipc_sender.h" |
| 21 #include "webkit/child/resource_loader_bridge.h" | 21 #include "webkit/child/resource_loader_bridge.h" |
| 22 | 22 |
| 23 struct ResourceMsg_RequestCompleteData; |
| 24 |
| 23 namespace content { | 25 namespace content { |
| 24 class ResourceDispatcherDelegate; | 26 class ResourceDispatcherDelegate; |
| 25 struct ResourceResponseHead; | 27 struct ResourceResponseHead; |
| 26 | 28 |
| 27 // This class serves as a communication interface between the | 29 // This class serves as a communication interface between the |
| 28 // ResourceDispatcherHost in the browser process and the ResourceLoaderBridge in | 30 // ResourceDispatcherHost in the browser process and the ResourceLoaderBridge in |
| 29 // the child process. It can be used from any child process. | 31 // the child process. It can be used from any child process. |
| 30 class CONTENT_EXPORT ResourceDispatcher : public IPC::Listener { | 32 class CONTENT_EXPORT ResourceDispatcher : public IPC::Listener { |
| 31 public: | 33 public: |
| 32 explicit ResourceDispatcher(IPC::Sender* sender); | 34 explicit ResourceDispatcher(IPC::Sender* sender); |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 int request_id, | 145 int request_id, |
| 144 int data_offset, | 146 int data_offset, |
| 145 int data_length, | 147 int data_length, |
| 146 int encoded_data_length); | 148 int encoded_data_length); |
| 147 void OnDownloadedData( | 149 void OnDownloadedData( |
| 148 int request_id, | 150 int request_id, |
| 149 int data_len, | 151 int data_len, |
| 150 int encoded_data_length); | 152 int encoded_data_length); |
| 151 void OnRequestComplete( | 153 void OnRequestComplete( |
| 152 int request_id, | 154 int request_id, |
| 153 int error_code, | 155 const ResourceMsg_RequestCompleteData &request_complete_data); |
| 154 bool was_ignored_by_handler, | |
| 155 const std::string& security_info, | |
| 156 const base::TimeTicks& completion_time); | |
| 157 | 156 |
| 158 // Dispatch the message to one of the message response handlers. | 157 // Dispatch the message to one of the message response handlers. |
| 159 void DispatchMessage(const IPC::Message& message); | 158 void DispatchMessage(const IPC::Message& message); |
| 160 | 159 |
| 161 // Dispatch any deferred messages for the given request, provided it is not | 160 // Dispatch any deferred messages for the given request, provided it is not |
| 162 // again in the deferred state. | 161 // again in the deferred state. |
| 163 void FlushDeferredMessages(int request_id); | 162 void FlushDeferredMessages(int request_id); |
| 164 | 163 |
| 165 void ToResourceResponseInfo( | 164 void ToResourceResponseInfo( |
| 166 const PendingRequestInfo& request_info, | 165 const PendingRequestInfo& request_info, |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 201 | 200 |
| 202 // IO thread timestamp for ongoing IPC message. | 201 // IO thread timestamp for ongoing IPC message. |
| 203 base::TimeTicks io_timestamp_; | 202 base::TimeTicks io_timestamp_; |
| 204 | 203 |
| 205 DISALLOW_COPY_AND_ASSIGN(ResourceDispatcher); | 204 DISALLOW_COPY_AND_ASSIGN(ResourceDispatcher); |
| 206 }; | 205 }; |
| 207 | 206 |
| 208 } // namespace content | 207 } // namespace content |
| 209 | 208 |
| 210 #endif // CONTENT_CHILD_RESOURCE_DISPATCHER_H_ | 209 #endif // CONTENT_CHILD_RESOURCE_DISPATCHER_H_ |
| OLD | NEW |