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 bytes_received = DevToolsNetLogObserver::GetAndResetTransferSize(request); | |
darin (slow to review)
2011/04/05 19:02:18
nit: it feels like there is too much different ter
vsevik
2011/04/07 16:32:49
As discussed, everything with this meaning is rena
| |
219 filter_->Send(new ResourceMsg_DataReceived( | 222 filter_->Send(new ResourceMsg_DataReceived( |
220 routing_id_, request_id, handle, *bytes_read)); | 223 routing_id_, request_id, handle, *bytes_read, bytes_received)); |
221 | 224 |
222 return true; | 225 return true; |
223 } | 226 } |
224 | 227 |
225 void AsyncResourceHandler::OnDataDownloaded( | 228 void AsyncResourceHandler::OnDataDownloaded( |
226 int request_id, int bytes_downloaded) { | 229 int request_id, int bytes_downloaded) { |
227 filter_->Send(new ResourceMsg_DataDownloaded( | 230 filter_->Send(new ResourceMsg_DataDownloaded( |
228 routing_id_, request_id, bytes_downloaded)); | 231 routing_id_, request_id, bytes_downloaded)); |
229 } | 232 } |
230 | 233 |
(...skipping 26 matching lines...) Expand all Loading... | |
257 | 260 |
258 // static | 261 // static |
259 void AsyncResourceHandler::GlobalCleanup() { | 262 void AsyncResourceHandler::GlobalCleanup() { |
260 if (g_spare_read_buffer) { | 263 if (g_spare_read_buffer) { |
261 // Avoid the CHECK in SharedIOBuffer::~SharedIOBuffer(). | 264 // Avoid the CHECK in SharedIOBuffer::~SharedIOBuffer(). |
262 SharedIOBuffer* tmp = g_spare_read_buffer; | 265 SharedIOBuffer* tmp = g_spare_read_buffer; |
263 g_spare_read_buffer = NULL; | 266 g_spare_read_buffer = NULL; |
264 tmp->Release(); | 267 tmp->Release(); |
265 } | 268 } |
266 } | 269 } |
OLD | NEW |