| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "content/browser/renderer_host/async_resource_handler.h" | 5 #include "content/browser/renderer_host/async_resource_handler.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/hash_tables.h" | 10 #include "base/hash_tables.h" |
| (...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 209 // it's killing our read_buffer_, and we don't want that when we pause | 209 // it's killing our read_buffer_, and we don't want that when we pause |
| 210 // the request. | 210 // the request. |
| 211 rdh_->DataReceivedACK(filter_->child_id(), request_id); | 211 rdh_->DataReceivedACK(filter_->child_id(), request_id); |
| 212 // We just unmapped the memory. | 212 // We just unmapped the memory. |
| 213 read_buffer_ = NULL; | 213 read_buffer_ = NULL; |
| 214 return false; | 214 return false; |
| 215 } | 215 } |
| 216 // We just unmapped the memory. | 216 // We just unmapped the memory. |
| 217 read_buffer_ = NULL; | 217 read_buffer_ = NULL; |
| 218 | 218 |
| 219 net::URLRequest* request = rdh_->GetURLRequest( |
| 220 GlobalRequestID(filter_->child_id(), request_id)); |
| 221 int raw_data_length = |
| 222 DevToolsNetLogObserver::GetAndResetRawDataLength(request); |
| 219 filter_->Send(new ResourceMsg_DataReceived( | 223 filter_->Send(new ResourceMsg_DataReceived( |
| 220 routing_id_, request_id, handle, *bytes_read)); | 224 routing_id_, request_id, handle, *bytes_read, raw_data_length)); |
| 221 | 225 |
| 222 return true; | 226 return true; |
| 223 } | 227 } |
| 224 | 228 |
| 225 void AsyncResourceHandler::OnDataDownloaded( | 229 void AsyncResourceHandler::OnDataDownloaded( |
| 226 int request_id, int bytes_downloaded) { | 230 int request_id, int bytes_downloaded) { |
| 227 filter_->Send(new ResourceMsg_DataDownloaded( | 231 filter_->Send(new ResourceMsg_DataDownloaded( |
| 228 routing_id_, request_id, bytes_downloaded)); | 232 routing_id_, request_id, bytes_downloaded)); |
| 229 } | 233 } |
| 230 | 234 |
| (...skipping 26 matching lines...) Expand all Loading... |
| 257 | 261 |
| 258 // static | 262 // static |
| 259 void AsyncResourceHandler::GlobalCleanup() { | 263 void AsyncResourceHandler::GlobalCleanup() { |
| 260 if (g_spare_read_buffer) { | 264 if (g_spare_read_buffer) { |
| 261 // Avoid the CHECK in SharedIOBuffer::~SharedIOBuffer(). | 265 // Avoid the CHECK in SharedIOBuffer::~SharedIOBuffer(). |
| 262 SharedIOBuffer* tmp = g_spare_read_buffer; | 266 SharedIOBuffer* tmp = g_spare_read_buffer; |
| 263 g_spare_read_buffer = NULL; | 267 g_spare_read_buffer = NULL; |
| 264 tmp->Release(); | 268 tmp->Release(); |
| 265 } | 269 } |
| 266 } | 270 } |
| OLD | NEW |