OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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_RENDERER_HOST_DOWNLOAD_THROTTLING_RESOURCE_HANDLER_H_ | 5 #ifndef CHROME_BROWSER_RENDERER_HOST_DOWNLOAD_THROTTLING_RESOURCE_HANDLER_H_ |
6 #define CHROME_BROWSER_RENDERER_HOST_DOWNLOAD_THROTTLING_RESOURCE_HANDLER_H_ | 6 #define CHROME_BROWSER_RENDERER_HOST_DOWNLOAD_THROTTLING_RESOURCE_HANDLER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "chrome/browser/renderer_host/resource_handler.h" | 10 #include "chrome/browser/renderer_host/resource_handler.h" |
11 #include "googleurl/src/gurl.h" | 11 #include "googleurl/src/gurl.h" |
12 | 12 |
13 #if defined(OS_WIN) | 13 #if defined(OS_WIN) |
14 // TODO(port): Remove ifdef when downloads are ported. | 14 // TODO(port): Remove ifdef when downloads are ported. |
15 #include "chrome/browser/download/download_request_manager.h" | 15 #include "chrome/browser/download/download_request_manager.h" |
16 #elif defined(OS_POSIX) | 16 #elif defined(OS_POSIX) |
17 #include "chrome/common/temp_scaffolding_stubs.h" | 17 #include "chrome/common/temp_scaffolding_stubs.h" |
18 #endif | 18 #endif |
19 | 19 |
20 class DownloadResourceHandler; | 20 class DownloadResourceHandler; |
21 class ResourceDispatcherHost; | 21 class ResourceDispatcherHost; |
| 22 class URLRequest; |
22 | 23 |
23 // DownloadThrottlingResourceHandler is used to determine if a download should | 24 // DownloadThrottlingResourceHandler is used to determine if a download should |
24 // be allowed. When a DownloadThrottlingResourceHandler is created it pauses the | 25 // be allowed. When a DownloadThrottlingResourceHandler is created it pauses the |
25 // download and asks the DownloadRequestManager if the download should be | 26 // download and asks the DownloadRequestManager if the download should be |
26 // allowed. The DownloadRequestManager notifies us asynchronously as to whether | 27 // allowed. The DownloadRequestManager notifies us asynchronously as to whether |
27 // the download is allowed or not. If the download is allowed the request is | 28 // the download is allowed or not. If the download is allowed the request is |
28 // resumed, a DownloadResourceHandler is created and all EventHandler methods | 29 // resumed, a DownloadResourceHandler is created and all EventHandler methods |
29 // are delegated to it. If the download is not allowed the request is canceled. | 30 // are delegated to it. If the download is not allowed the request is canceled. |
30 | 31 |
31 class DownloadThrottlingResourceHandler | 32 class DownloadThrottlingResourceHandler |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 // If true the next call to OnReadCompleted is ignored. This is used if we're | 84 // If true the next call to OnReadCompleted is ignored. This is used if we're |
84 // paused during a call to OnReadCompleted. Pausing during OnReadCompleted | 85 // paused during a call to OnReadCompleted. Pausing during OnReadCompleted |
85 // results in two calls to OnReadCompleted for the same data. This make sure | 86 // results in two calls to OnReadCompleted for the same data. This make sure |
86 // we ignore one of them. | 87 // we ignore one of them. |
87 bool ignore_on_read_complete_; | 88 bool ignore_on_read_complete_; |
88 | 89 |
89 DISALLOW_COPY_AND_ASSIGN(DownloadThrottlingResourceHandler); | 90 DISALLOW_COPY_AND_ASSIGN(DownloadThrottlingResourceHandler); |
90 }; | 91 }; |
91 | 92 |
92 #endif // CHROME_BROWSER_RENDERER_HOST_DOWNLOAD_THROTTLING_RESOURCE_HANDLER_H_ | 93 #endif // CHROME_BROWSER_RENDERER_HOST_DOWNLOAD_THROTTLING_RESOURCE_HANDLER_H_ |
OLD | NEW |