| 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 #ifndef CHROME_BROWSER_DOWNLOAD_DOWNLOAD_RESOURCE_THROTTLE_H_ | 5 #ifndef CHROME_BROWSER_DOWNLOAD_DOWNLOAD_RESOURCE_THROTTLE_H_ |
| 6 #define CHROME_BROWSER_DOWNLOAD_DOWNLOAD_RESOURCE_THROTTLE_H_ | 6 #define CHROME_BROWSER_DOWNLOAD_DOWNLOAD_RESOURCE_THROTTLE_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" |
| 8 #include "base/memory/weak_ptr.h" | 9 #include "base/memory/weak_ptr.h" |
| 9 #include "chrome/browser/download/download_request_limiter.h" | 10 #include "chrome/browser/download/download_request_limiter.h" |
| 10 #include "content/public/browser/resource_throttle.h" | 11 #include "content/public/browser/resource_throttle.h" |
| 11 | 12 |
| 12 class GURL; | 13 class GURL; |
| 13 | 14 |
| 14 // DownloadResourceThrottle is used to determine if a download should be | 15 // DownloadResourceThrottle is used to determine if a download should be |
| 15 // allowed. When a DownloadResourceThrottle is created it pauses the download | 16 // allowed. When a DownloadResourceThrottle is created it pauses the download |
| 16 // and asks the DownloadRequestLimiter if the download should be allowed. The | 17 // and asks the DownloadRequestLimiter if the download should be allowed. The |
| 17 // DownloadRequestLimiter notifies us asynchronously as to whether the download | 18 // DownloadRequestLimiter notifies us asynchronously as to whether the download |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 // Set to true when we know that the request is allowed to start. | 70 // Set to true when we know that the request is allowed to start. |
| 70 bool request_allowed_; | 71 bool request_allowed_; |
| 71 | 72 |
| 72 // Set to true when we have deferred the request. | 73 // Set to true when we have deferred the request. |
| 73 bool request_deferred_; | 74 bool request_deferred_; |
| 74 | 75 |
| 75 DISALLOW_COPY_AND_ASSIGN(DownloadResourceThrottle); | 76 DISALLOW_COPY_AND_ASSIGN(DownloadResourceThrottle); |
| 76 }; | 77 }; |
| 77 | 78 |
| 78 #endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_RESOURCE_THROTTLE_H_ | 79 #endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_RESOURCE_THROTTLE_H_ |
| OLD | NEW |