| 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 |
| 220 bool AsyncResourceHandler::OnResponseCompleted( | 226 bool AsyncResourceHandler::OnResponseCompleted( |
| 221 int request_id, | 227 int request_id, |
| 222 const URLRequestStatus& status, | 228 const URLRequestStatus& status, |
| 223 const std::string& security_info) { | 229 const std::string& security_info) { |
| 224 Time completion_time = Time::Now(); | 230 Time completion_time = Time::Now(); |
| 225 receiver_->Send(new ViewMsg_Resource_RequestComplete(routing_id_, | 231 receiver_->Send(new ViewMsg_Resource_RequestComplete(routing_id_, |
| 226 request_id, | 232 request_id, |
| 227 status, | 233 status, |
| 228 security_info, | 234 security_info, |
| 229 completion_time)); | 235 completion_time)); |
| (...skipping 15 matching lines...) Expand all Loading... |
| 245 | 251 |
| 246 // static | 252 // static |
| 247 void AsyncResourceHandler::GlobalCleanup() { | 253 void AsyncResourceHandler::GlobalCleanup() { |
| 248 if (g_spare_read_buffer) { | 254 if (g_spare_read_buffer) { |
| 249 // Avoid the CHECK in SharedIOBuffer::~SharedIOBuffer(). | 255 // Avoid the CHECK in SharedIOBuffer::~SharedIOBuffer(). |
| 250 SharedIOBuffer* tmp = g_spare_read_buffer; | 256 SharedIOBuffer* tmp = g_spare_read_buffer; |
| 251 g_spare_read_buffer = NULL; | 257 g_spare_read_buffer = NULL; |
| 252 tmp->Release(); | 258 tmp->Release(); |
| 253 } | 259 } |
| 254 } | 260 } |
| OLD | NEW |