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 392 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
403 ReportUploadProgress(); | 403 ReportUploadProgress(); |
404 progress_timer_.Start( | 404 progress_timer_.Start( |
405 FROM_HERE, | 405 FROM_HERE, |
406 base::TimeDelta::FromMilliseconds(kUploadProgressIntervalMsec), | 406 base::TimeDelta::FromMilliseconds(kUploadProgressIntervalMsec), |
407 this, | 407 this, |
408 &AsyncResourceHandler::ReportUploadProgress); | 408 &AsyncResourceHandler::ReportUploadProgress); |
409 } | 409 } |
410 return true; | 410 return true; |
411 } | 411 } |
412 | 412 |
413 bool AsyncResourceHandler::OnBeforeNetworkStart(const GURL& url, bool* defer) { | |
414 return true; | |
415 } | |
416 | |
417 bool AsyncResourceHandler::OnWillRead(scoped_refptr<net::IOBuffer>* buf, | 413 bool AsyncResourceHandler::OnWillRead(scoped_refptr<net::IOBuffer>* buf, |
418 int* buf_size, | 414 int* buf_size, |
419 int min_size) { | 415 int min_size) { |
420 DCHECK_EQ(-1, min_size); | 416 DCHECK_EQ(-1, min_size); |
421 | 417 |
422 if (!CheckForSufficientResource()) | 418 if (!CheckForSufficientResource()) |
423 return false; | 419 return false; |
424 | 420 |
425 // Return early if InliningHelper allocates the buffer, so that we should | 421 // Return early if InliningHelper allocates the buffer, so that we should |
426 // inline the data into the IPC message without allocating SharedMemory. | 422 // inline the data into the IPC message without allocating SharedMemory. |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
609 } else { | 605 } else { |
610 UMA_HISTOGRAM_CUSTOM_COUNTS( | 606 UMA_HISTOGRAM_CUSTOM_COUNTS( |
611 "Net.ResourceLoader.ResponseStartToEnd.Over_512kB", | 607 "Net.ResourceLoader.ResponseStartToEnd.Over_512kB", |
612 elapsed_time, 1, 100000, 100); | 608 elapsed_time, 1, 100000, 100); |
613 } | 609 } |
614 | 610 |
615 inlining_helper_->RecordHistogram(elapsed_time); | 611 inlining_helper_->RecordHistogram(elapsed_time); |
616 } | 612 } |
617 | 613 |
618 } // namespace content | 614 } // namespace content |
OLD | NEW |