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

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

Issue 2388453002: Report upload progress every 100ms (was 10ms) (Closed)
Patch Set: Created 4 years, 2 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 | « no previous file | no next file » | 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 27 matching lines...) Expand all
38 using base::TimeDelta; 38 using base::TimeDelta;
39 using base::TimeTicks; 39 using base::TimeTicks;
40 40
41 namespace content { 41 namespace content {
42 namespace { 42 namespace {
43 43
44 static int kBufferSize = 1024 * 512; 44 static int kBufferSize = 1024 * 512;
45 static int kMinAllocationSize = 1024 * 4; 45 static int kMinAllocationSize = 1024 * 4;
46 static int kMaxAllocationSize = 1024 * 32; 46 static int kMaxAllocationSize = 1024 * 32;
47 // The interval for calls to ReportUploadProgress. 47 // The interval for calls to ReportUploadProgress.
48 static int kUploadProgressIntervalMsec = 10; 48 static int kUploadProgressIntervalMsec = 100;
49 49
50 // Used when kOptimizeLoadingIPCForSmallResources is enabled. 50 // Used when kOptimizeLoadingIPCForSmallResources is enabled.
51 // Small resource typically issues two Read call: one for the content itself 51 // Small resource typically issues two Read call: one for the content itself
52 // and another for getting zero response to detect EOF. 52 // and another for getting zero response to detect EOF.
53 // Inline these two into the IPC message to avoid allocating an expensive 53 // Inline these two into the IPC message to avoid allocating an expensive
54 // SharedMemory for small resources. 54 // SharedMemory for small resources.
55 const int kNumLeadingChunk = 2; 55 const int kNumLeadingChunk = 2;
56 const int kInlinedLeadingChunkSize = 2048; 56 const int kInlinedLeadingChunkSize = 2048;
57 57
58 void GetNumericArg(const std::string& name, int* result) { 58 void GetNumericArg(const std::string& name, int* result) {
(...skipping 544 matching lines...) Expand 10 before | Expand all | Expand 10 after
603 } else { 603 } else {
604 UMA_HISTOGRAM_CUSTOM_COUNTS( 604 UMA_HISTOGRAM_CUSTOM_COUNTS(
605 "Net.ResourceLoader.ResponseStartToEnd.Over_512kB", 605 "Net.ResourceLoader.ResponseStartToEnd.Over_512kB",
606 elapsed_time, 1, 100000, 100); 606 elapsed_time, 1, 100000, 100);
607 } 607 }
608 608
609 inlining_helper_->RecordHistogram(elapsed_time); 609 inlining_helper_->RecordHistogram(elapsed_time);
610 } 610 }
611 611
612 } // namespace content 612 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698