OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
11 #include "chrome/browser/download/download_request_limiter.h" | 11 #include "chrome/browser/download/download_request_limiter.h" |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 uint64 position, | 44 uint64 position, |
45 uint64 size); | 45 uint64 size); |
46 virtual bool OnRequestRedirected(int request_id, const GURL& url, | 46 virtual bool OnRequestRedirected(int request_id, const GURL& url, |
47 ResourceResponse* response, bool* defer); | 47 ResourceResponse* response, bool* defer); |
48 virtual bool OnResponseStarted(int request_id, ResourceResponse* response); | 48 virtual bool OnResponseStarted(int request_id, ResourceResponse* response); |
49 virtual bool OnWillStart(int request_id, const GURL& url, bool* defer); | 49 virtual bool OnWillStart(int request_id, const GURL& url, bool* defer); |
50 virtual bool OnWillRead(int request_id, net::IOBuffer** buf, int* buf_size, | 50 virtual bool OnWillRead(int request_id, net::IOBuffer** buf, int* buf_size, |
51 int min_size); | 51 int min_size); |
52 virtual bool OnReadCompleted(int request_id, int* bytes_read); | 52 virtual bool OnReadCompleted(int request_id, int* bytes_read); |
53 virtual bool OnResponseCompleted(int request_id, | 53 virtual bool OnResponseCompleted(int request_id, |
54 const URLRequestStatus& status, | 54 const net::URLRequestStatus& status, |
55 const std::string& security_info); | 55 const std::string& security_info); |
56 virtual void OnRequestClosed(); | 56 virtual void OnRequestClosed(); |
57 | 57 |
58 // DownloadRequestLimiter::Callback implementation: | 58 // DownloadRequestLimiter::Callback implementation: |
59 virtual void CancelDownload(); | 59 virtual void CancelDownload(); |
60 virtual void ContinueDownload(); | 60 virtual void ContinueDownload(); |
61 virtual int GetRequestId(); | 61 virtual int GetRequestId(); |
62 | 62 |
63 private: | 63 private: |
64 virtual ~DownloadThrottlingResourceHandler(); | 64 virtual ~DownloadThrottlingResourceHandler(); |
(...skipping 23 matching lines...) Expand all Loading... |
88 // If true the next call to OnReadCompleted is ignored. This is used if we're | 88 // If true the next call to OnReadCompleted is ignored. This is used if we're |
89 // paused during a call to OnReadCompleted. Pausing during OnReadCompleted | 89 // paused during a call to OnReadCompleted. Pausing during OnReadCompleted |
90 // results in two calls to OnReadCompleted for the same data. This make sure | 90 // results in two calls to OnReadCompleted for the same data. This make sure |
91 // we ignore one of them. | 91 // we ignore one of them. |
92 bool ignore_on_read_complete_; | 92 bool ignore_on_read_complete_; |
93 | 93 |
94 DISALLOW_COPY_AND_ASSIGN(DownloadThrottlingResourceHandler); | 94 DISALLOW_COPY_AND_ASSIGN(DownloadThrottlingResourceHandler); |
95 }; | 95 }; |
96 | 96 |
97 #endif // CHROME_BROWSER_RENDERER_HOST_DOWNLOAD_THROTTLING_RESOURCE_HANDLER_H_ | 97 #endif // CHROME_BROWSER_RENDERER_HOST_DOWNLOAD_THROTTLING_RESOURCE_HANDLER_H_ |
OLD | NEW |