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 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/memory/weak_ptr.h" | 9 #include "base/memory/weak_ptr.h" |
10 #include "chrome/browser/download/download_request_limiter.h" | 10 #include "chrome/browser/download/download_request_limiter.h" |
(...skipping 18 matching lines...) Expand all Loading... |
29 int request_id); | 29 int request_id); |
30 | 30 |
31 // content::ResourceThrottle implementation: | 31 // content::ResourceThrottle implementation: |
32 virtual void WillStartRequest(bool* defer) OVERRIDE; | 32 virtual void WillStartRequest(bool* defer) OVERRIDE; |
33 virtual void WillRedirectRequest(const GURL& new_url, bool* defer) OVERRIDE; | 33 virtual void WillRedirectRequest(const GURL& new_url, bool* defer) OVERRIDE; |
34 virtual void WillProcessResponse(bool* defer) OVERRIDE; | 34 virtual void WillProcessResponse(bool* defer) OVERRIDE; |
35 | 35 |
36 private: | 36 private: |
37 virtual ~DownloadResourceThrottle(); | 37 virtual ~DownloadResourceThrottle(); |
38 | 38 |
| 39 void WillDownload(bool* defer); |
39 void ContinueDownload(bool allow); | 40 void ContinueDownload(bool allow); |
40 | 41 |
| 42 // Set to true when we are querying the DownloadRequestLimiter. |
| 43 bool querying_limiter_; |
| 44 |
41 // Set to true when we know that the request is allowed to start. | 45 // Set to true when we know that the request is allowed to start. |
42 bool request_allowed_; | 46 bool request_allowed_; |
43 | 47 |
44 // Set to true when we have deferred the request. | 48 // Set to true when we have deferred the request. |
45 bool request_deferred_; | 49 bool request_deferred_; |
46 | 50 |
47 DISALLOW_COPY_AND_ASSIGN(DownloadResourceThrottle); | 51 DISALLOW_COPY_AND_ASSIGN(DownloadResourceThrottle); |
48 }; | 52 }; |
49 | 53 |
50 #endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_RESOURCE_THROTTLE_H_ | 54 #endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_RESOURCE_THROTTLE_H_ |
OLD | NEW |