| 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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 // Send the download creation information to the download thread. | 57 // Send the download creation information to the download thread. |
| 58 virtual bool OnResponseStarted(int request_id, | 58 virtual bool OnResponseStarted(int request_id, |
| 59 ResourceResponse* response, | 59 ResourceResponse* response, |
| 60 bool* defer) OVERRIDE; | 60 bool* defer) OVERRIDE; |
| 61 | 61 |
| 62 // Pass-through implementation. | 62 // Pass-through implementation. |
| 63 virtual bool OnWillStart(int request_id, | 63 virtual bool OnWillStart(int request_id, |
| 64 const GURL& url, | 64 const GURL& url, |
| 65 bool* defer) OVERRIDE; | 65 bool* defer) OVERRIDE; |
| 66 | 66 |
| 67 // Pass-through implementation. |
| 68 virtual bool OnBeforeNetworkStart(int request_id, |
| 69 const GURL& url, |
| 70 bool* defer) OVERRIDE; |
| 71 |
| 67 // Create a new buffer, which will be handed to the download thread for file | 72 // Create a new buffer, which will be handed to the download thread for file |
| 68 // writing and deletion. | 73 // writing and deletion. |
| 69 virtual bool OnWillRead(int request_id, | 74 virtual bool OnWillRead(int request_id, |
| 70 scoped_refptr<net::IOBuffer>* buf, | 75 scoped_refptr<net::IOBuffer>* buf, |
| 71 int* buf_size, | 76 int* buf_size, |
| 72 int min_size) OVERRIDE; | 77 int min_size) OVERRIDE; |
| 73 | 78 |
| 74 virtual bool OnReadCompleted(int request_id, int bytes_read, | 79 virtual bool OnReadCompleted(int request_id, int bytes_read, |
| 75 bool* defer) OVERRIDE; | 80 bool* defer) OVERRIDE; |
| 76 | 81 |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 | 127 |
| 123 static const int kReadBufSize = 32768; // bytes | 128 static const int kReadBufSize = 32768; // bytes |
| 124 static const int kThrottleTimeMs = 200; // milliseconds | 129 static const int kThrottleTimeMs = 200; // milliseconds |
| 125 | 130 |
| 126 DISALLOW_COPY_AND_ASSIGN(DownloadResourceHandler); | 131 DISALLOW_COPY_AND_ASSIGN(DownloadResourceHandler); |
| 127 }; | 132 }; |
| 128 | 133 |
| 129 } // namespace content | 134 } // namespace content |
| 130 | 135 |
| 131 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_RESOURCE_HANDLER_H_ | 136 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_RESOURCE_HANDLER_H_ |
| OLD | NEW |