OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 CHROME_COMMON_RESOURCE_DISPATCHER_H__ | 7 #ifndef CHROME_COMMON_RESOURCE_DISPATCHER_H__ |
8 #define CHROME_COMMON_RESOURCE_DISPATCHER_H__ | 8 #define CHROME_COMMON_RESOURCE_DISPATCHER_H__ |
9 | 9 |
10 #include <deque> | 10 #include <deque> |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 bool mixed_content; | 91 bool mixed_content; |
92 bool is_deferred; | 92 bool is_deferred; |
93 }; | 93 }; |
94 typedef base::hash_map<int, PendingRequestInfo> PendingRequestList; | 94 typedef base::hash_map<int, PendingRequestInfo> PendingRequestList; |
95 | 95 |
96 // Message response handlers, called by the message handler for this process. | 96 // Message response handlers, called by the message handler for this process. |
97 void OnUploadProgress(const IPC::Message& message, | 97 void OnUploadProgress(const IPC::Message& message, |
98 int request_id, | 98 int request_id, |
99 int64 position, | 99 int64 position, |
100 int64 size); | 100 int64 size); |
| 101 void OnDownloadProgress(int request_id, int64 position, int64 size); |
101 void OnReceivedResponse(int request_id, const ResourceResponseHead&); | 102 void OnReceivedResponse(int request_id, const ResourceResponseHead&); |
102 void OnReceivedRedirect(int request_id, const GURL& new_url); | 103 void OnReceivedRedirect(int request_id, const GURL& new_url); |
103 void OnReceivedData(const IPC::Message& message, | 104 void OnReceivedData(const IPC::Message& message, |
104 int request_id, | 105 int request_id, |
105 base::SharedMemoryHandle data, | 106 base::SharedMemoryHandle data, |
106 int data_len); | 107 int data_len); |
107 void OnRequestComplete(int request_id, | 108 void OnRequestComplete(int request_id, |
108 const URLRequestStatus& status, | 109 const URLRequestStatus& status, |
109 const std::string& security_info); | 110 const std::string& security_info); |
110 | 111 |
111 // Dispatch the message to one of the message response handlers. | 112 // Dispatch the message to one of the message response handlers. |
112 void DispatchMessage(const IPC::Message& message); | 113 void DispatchMessage(const IPC::Message& message); |
113 | 114 |
114 // Dispatch any deferred messages for the given request, provided it is not | 115 // Dispatch any deferred messages for the given request, provided it is not |
115 // again in the deferred state. | 116 // again in the deferred state. |
116 void FlushDeferredMessages(int request_id); | 117 void FlushDeferredMessages(int request_id); |
117 | 118 |
118 IPC::Message::Sender* message_sender_; | 119 IPC::Message::Sender* message_sender_; |
119 | 120 |
120 // All pending requests issued to the host | 121 // All pending requests issued to the host |
121 PendingRequestList pending_requests_; | 122 PendingRequestList pending_requests_; |
122 | 123 |
123 ScopedRunnableMethodFactory<ResourceDispatcher> method_factory_; | 124 ScopedRunnableMethodFactory<ResourceDispatcher> method_factory_; |
124 | 125 |
125 DISALLOW_EVIL_CONSTRUCTORS(ResourceDispatcher); | 126 DISALLOW_EVIL_CONSTRUCTORS(ResourceDispatcher); |
126 }; | 127 }; |
127 | 128 |
128 #endif // CHROME_COMMON_RESOURCE_DISPATCHER_H__ | 129 #endif // CHROME_COMMON_RESOURCE_DISPATCHER_H__ |
OLD | NEW |