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 "chrome/browser/download/download_resource_throttle.h" | 5 #include "chrome/browser/download/download_resource_throttle.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/profiler/scoped_tracker.h" |
8 #include "chrome/browser/download/download_stats.h" | 9 #include "chrome/browser/download/download_stats.h" |
9 #include "content/public/browser/resource_controller.h" | 10 #include "content/public/browser/resource_controller.h" |
10 | 11 |
11 DownloadResourceThrottle::DownloadResourceThrottle( | 12 DownloadResourceThrottle::DownloadResourceThrottle( |
12 DownloadRequestLimiter* limiter, | 13 DownloadRequestLimiter* limiter, |
13 int render_process_id, | 14 int render_process_id, |
14 int render_view_id, | 15 int render_view_id, |
15 const GURL& url, | 16 const GURL& url, |
16 const std::string& request_method) | 17 const std::string& request_method) |
17 : querying_limiter_(true), | 18 : querying_limiter_(true), |
(...skipping 14 matching lines...) Expand all Loading... |
32 void DownloadResourceThrottle::WillStartRequest(bool* defer) { | 33 void DownloadResourceThrottle::WillStartRequest(bool* defer) { |
33 WillDownload(defer); | 34 WillDownload(defer); |
34 } | 35 } |
35 | 36 |
36 void DownloadResourceThrottle::WillRedirectRequest(const GURL& new_url, | 37 void DownloadResourceThrottle::WillRedirectRequest(const GURL& new_url, |
37 bool* defer) { | 38 bool* defer) { |
38 WillDownload(defer); | 39 WillDownload(defer); |
39 } | 40 } |
40 | 41 |
41 void DownloadResourceThrottle::WillProcessResponse(bool* defer) { | 42 void DownloadResourceThrottle::WillProcessResponse(bool* defer) { |
| 43 // TODO(vadimt): Remove ScopedTracker below once crbug.com/422516 is fixed. |
| 44 tracked_objects::ScopedTracker tracking_profile( |
| 45 FROM_HERE_WITH_EXPLICIT_FUNCTION( |
| 46 "422516 DownloadResourceThrottle::WillProcessResponse")); |
| 47 |
42 WillDownload(defer); | 48 WillDownload(defer); |
43 } | 49 } |
44 | 50 |
45 const char* DownloadResourceThrottle::GetNameForLogging() const { | 51 const char* DownloadResourceThrottle::GetNameForLogging() const { |
46 return "DownloadResourceThrottle"; | 52 return "DownloadResourceThrottle"; |
47 } | 53 } |
48 | 54 |
49 void DownloadResourceThrottle::WillDownload(bool* defer) { | 55 void DownloadResourceThrottle::WillDownload(bool* defer) { |
50 DCHECK(!request_deferred_); | 56 DCHECK(!request_deferred_); |
51 | 57 |
(...skipping 22 matching lines...) Expand all Loading... |
74 | 80 |
75 if (request_deferred_) { | 81 if (request_deferred_) { |
76 request_deferred_ = false; | 82 request_deferred_ = false; |
77 if (allow) { | 83 if (allow) { |
78 controller()->Resume(); | 84 controller()->Resume(); |
79 } else { | 85 } else { |
80 controller()->Cancel(); | 86 controller()->Cancel(); |
81 } | 87 } |
82 } | 88 } |
83 } | 89 } |
OLD | NEW |