OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/loader/async_resource_handler.h" | 5 #include "content/browser/loader/async_resource_handler.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
277 "Net.AsyncResourceHandler_PendingDataCount_WhenFull", | 277 "Net.AsyncResourceHandler_PendingDataCount_WhenFull", |
278 pending_data_count_, 0, 100, 100); | 278 pending_data_count_, 0, 100, 100); |
279 *defer = did_defer_ = true; | 279 *defer = did_defer_ = true; |
280 } | 280 } |
281 | 281 |
282 return true; | 282 return true; |
283 } | 283 } |
284 | 284 |
285 void AsyncResourceHandler::OnDataDownloaded( | 285 void AsyncResourceHandler::OnDataDownloaded( |
286 int request_id, int bytes_downloaded) { | 286 int request_id, int bytes_downloaded) { |
287 int encoded_data_length = | |
288 DevToolsNetLogObserver::GetAndResetEncodedDataLength(request_); | |
michaeln
2013/08/29 20:19:05
I'm not familiar with the inspector instrumentatio
Nico
2013/08/31 20:49:47
I'm also curious about this.DevToolsNetLogObserver
yusukesuzuki
2013/09/02 02:05:10
Right. The encoded_data_length is used for the Ins
| |
289 | |
287 filter_->Send(new ResourceMsg_DataDownloaded( | 290 filter_->Send(new ResourceMsg_DataDownloaded( |
288 routing_id_, request_id, bytes_downloaded)); | 291 routing_id_, request_id, bytes_downloaded, encoded_data_length)); |
289 } | 292 } |
290 | 293 |
291 bool AsyncResourceHandler::OnResponseCompleted( | 294 bool AsyncResourceHandler::OnResponseCompleted( |
292 int request_id, | 295 int request_id, |
293 const net::URLRequestStatus& status, | 296 const net::URLRequestStatus& status, |
294 const std::string& security_info) { | 297 const std::string& security_info) { |
295 // If we crash here, figure out what URL the renderer was requesting. | 298 // If we crash here, figure out what URL the renderer was requesting. |
296 // http://crbug.com/107692 | 299 // http://crbug.com/107692 |
297 char url_buf[128]; | 300 char url_buf[128]; |
298 base::strlcpy(url_buf, request_->url().spec().c_str(), arraysize(url_buf)); | 301 base::strlcpy(url_buf, request_->url().spec().c_str(), arraysize(url_buf)); |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
356 } | 359 } |
357 | 360 |
358 void AsyncResourceHandler::ResumeIfDeferred() { | 361 void AsyncResourceHandler::ResumeIfDeferred() { |
359 if (did_defer_) { | 362 if (did_defer_) { |
360 did_defer_ = false; | 363 did_defer_ = false; |
361 controller()->Resume(); | 364 controller()->Resume(); |
362 } | 365 } |
363 } | 366 } |
364 | 367 |
365 } // namespace content | 368 } // namespace content |
OLD | NEW |