| 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 "base/profiler/scoped_tracker.h" |
| 9 #include "chrome/browser/download/download_stats.h" | 9 #include "chrome/browser/download/download_stats.h" |
| 10 #include "content/public/browser/resource_controller.h" | 10 #include "content/public/browser/resource_controller.h" |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 AsWeakPtr())); | 27 AsWeakPtr())); |
| 28 } | 28 } |
| 29 | 29 |
| 30 DownloadResourceThrottle::~DownloadResourceThrottle() { | 30 DownloadResourceThrottle::~DownloadResourceThrottle() { |
| 31 } | 31 } |
| 32 | 32 |
| 33 void DownloadResourceThrottle::WillStartRequest(bool* defer) { | 33 void DownloadResourceThrottle::WillStartRequest(bool* defer) { |
| 34 WillDownload(defer); | 34 WillDownload(defer); |
| 35 } | 35 } |
| 36 | 36 |
| 37 void DownloadResourceThrottle::WillRedirectRequest(const GURL& new_url, | 37 void DownloadResourceThrottle::WillRedirectRequest( |
| 38 bool* defer) { | 38 const net::RedirectInfo& redirect_info, |
| 39 bool* defer) { |
| 39 WillDownload(defer); | 40 WillDownload(defer); |
| 40 } | 41 } |
| 41 | 42 |
| 42 void DownloadResourceThrottle::WillProcessResponse(bool* defer) { | 43 void DownloadResourceThrottle::WillProcessResponse(bool* defer) { |
| 43 // TODO(vadimt): Remove ScopedTracker below once crbug.com/422516 is fixed. | 44 // TODO(vadimt): Remove ScopedTracker below once crbug.com/422516 is fixed. |
| 44 tracked_objects::ScopedTracker tracking_profile( | 45 tracked_objects::ScopedTracker tracking_profile( |
| 45 FROM_HERE_WITH_EXPLICIT_FUNCTION( | 46 FROM_HERE_WITH_EXPLICIT_FUNCTION( |
| 46 "422516 DownloadResourceThrottle::WillProcessResponse")); | 47 "422516 DownloadResourceThrottle::WillProcessResponse")); |
| 47 | 48 |
| 48 WillDownload(defer); | 49 WillDownload(defer); |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 | 81 |
| 81 if (request_deferred_) { | 82 if (request_deferred_) { |
| 82 request_deferred_ = false; | 83 request_deferred_ = false; |
| 83 if (allow) { | 84 if (allow) { |
| 84 controller()->Resume(); | 85 controller()->Resume(); |
| 85 } else { | 86 } else { |
| 86 controller()->Cancel(); | 87 controller()->Cancel(); |
| 87 } | 88 } |
| 88 } | 89 } |
| 89 } | 90 } |
| OLD | NEW |