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