Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(118)

Side by Side Diff: content/browser/loader/async_resource_handler.cc

Issue 23696002: Propagate the encoded data length through OnDownloadData delegate method (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/renderer/security_filter_peer.h ('k') | content/child/resource_dispatcher.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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_);
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
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
OLDNEW
« no previous file with comments | « chrome/renderer/security_filter_peer.h ('k') | content/child/resource_dispatcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698