OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #include "chrome/browser/renderer_host/async_resource_handler.h" | 5 #include "chrome/browser/renderer_host/async_resource_handler.h" |
6 | 6 |
7 #include "base/hash_tables.h" | 7 #include "base/hash_tables.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/process.h" | 9 #include "base/process.h" |
10 #include "base/shared_memory.h" | 10 #include "base/shared_memory.h" |
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
210 } | 210 } |
211 // We just unmapped the memory. | 211 // We just unmapped the memory. |
212 read_buffer_ = NULL; | 212 read_buffer_ = NULL; |
213 | 213 |
214 receiver_->Send(new ViewMsg_Resource_DataReceived( | 214 receiver_->Send(new ViewMsg_Resource_DataReceived( |
215 routing_id_, request_id, handle, *bytes_read)); | 215 routing_id_, request_id, handle, *bytes_read)); |
216 | 216 |
217 return true; | 217 return true; |
218 } | 218 } |
219 | 219 |
220 void AsyncResourceHandler::OnDataDownloaded( | |
221 int request_id, int bytes_downloaded) { | |
222 receiver_->Send(new ViewMsg_Resource_DataDownloaded( | |
223 routing_id_, request_id, bytes_downloaded)); | |
224 } | |
225 | |
226 bool AsyncResourceHandler::OnResponseCompleted( | 220 bool AsyncResourceHandler::OnResponseCompleted( |
227 int request_id, | 221 int request_id, |
228 const URLRequestStatus& status, | 222 const URLRequestStatus& status, |
229 const std::string& security_info) { | 223 const std::string& security_info) { |
230 Time completion_time = Time::Now(); | 224 Time completion_time = Time::Now(); |
231 receiver_->Send(new ViewMsg_Resource_RequestComplete(routing_id_, | 225 receiver_->Send(new ViewMsg_Resource_RequestComplete(routing_id_, |
232 request_id, | 226 request_id, |
233 status, | 227 status, |
234 security_info, | 228 security_info, |
235 completion_time)); | 229 completion_time)); |
(...skipping 15 matching lines...) Expand all Loading... |
251 | 245 |
252 // static | 246 // static |
253 void AsyncResourceHandler::GlobalCleanup() { | 247 void AsyncResourceHandler::GlobalCleanup() { |
254 if (g_spare_read_buffer) { | 248 if (g_spare_read_buffer) { |
255 // Avoid the CHECK in SharedIOBuffer::~SharedIOBuffer(). | 249 // Avoid the CHECK in SharedIOBuffer::~SharedIOBuffer(). |
256 SharedIOBuffer* tmp = g_spare_read_buffer; | 250 SharedIOBuffer* tmp = g_spare_read_buffer; |
257 g_spare_read_buffer = NULL; | 251 g_spare_read_buffer = NULL; |
258 tmp->Release(); | 252 tmp->Release(); |
259 } | 253 } |
260 } | 254 } |
OLD | NEW |