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 CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_RESOURCE_HANDLER_H_ | 5 #ifndef CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_RESOURCE_HANDLER_H_ |
6 #define CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_RESOURCE_HANDLER_H_ | 6 #define CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_RESOURCE_HANDLER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 30 matching lines...) Expand all Loading... |
41 // started_cb will be called exactly once on the UI thread. | 41 // started_cb will be called exactly once on the UI thread. |
42 // |id| should be invalid if the id should be automatically assigned. | 42 // |id| should be invalid if the id should be automatically assigned. |
43 DownloadResourceHandler( | 43 DownloadResourceHandler( |
44 uint32 id, | 44 uint32 id, |
45 net::URLRequest* request, | 45 net::URLRequest* request, |
46 const DownloadUrlParameters::OnStartedCallback& started_cb, | 46 const DownloadUrlParameters::OnStartedCallback& started_cb, |
47 scoped_ptr<DownloadSaveInfo> save_info); | 47 scoped_ptr<DownloadSaveInfo> save_info); |
48 | 48 |
49 virtual bool OnUploadProgress(uint64 position, uint64 size) OVERRIDE; | 49 virtual bool OnUploadProgress(uint64 position, uint64 size) OVERRIDE; |
50 | 50 |
51 virtual bool OnRequestRedirected(const GURL& url, | 51 virtual bool OnRequestRedirected(const net::RedirectInfo& redirect_info, |
52 ResourceResponse* response, | 52 ResourceResponse* response, |
53 bool* defer) OVERRIDE; | 53 bool* defer) OVERRIDE; |
54 | 54 |
55 // Send the download creation information to the download thread. | 55 // Send the download creation information to the download thread. |
56 virtual bool OnResponseStarted(ResourceResponse* response, | 56 virtual bool OnResponseStarted(ResourceResponse* response, |
57 bool* defer) OVERRIDE; | 57 bool* defer) OVERRIDE; |
58 | 58 |
59 // Pass-through implementation. | 59 // Pass-through implementation. |
60 virtual bool OnWillStart(const GURL& url, bool* defer) OVERRIDE; | 60 virtual bool OnWillStart(const GURL& url, bool* defer) OVERRIDE; |
61 | 61 |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 | 131 |
132 static const int kReadBufSize = 32768; // bytes | 132 static const int kReadBufSize = 32768; // bytes |
133 static const int kThrottleTimeMs = 200; // milliseconds | 133 static const int kThrottleTimeMs = 200; // milliseconds |
134 | 134 |
135 DISALLOW_COPY_AND_ASSIGN(DownloadResourceHandler); | 135 DISALLOW_COPY_AND_ASSIGN(DownloadResourceHandler); |
136 }; | 136 }; |
137 | 137 |
138 } // namespace content | 138 } // namespace content |
139 | 139 |
140 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_RESOURCE_HANDLER_H_ | 140 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_RESOURCE_HANDLER_H_ |
OLD | NEW |