| 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_SAVE_FILE_RESOURCE_HANDLER_H_ | 5 #ifndef CONTENT_BROWSER_DOWNLOAD_SAVE_FILE_RESOURCE_HANDLER_H_ |
| 6 #define CONTENT_BROWSER_DOWNLOAD_SAVE_FILE_RESOURCE_HANDLER_H_ | 6 #define CONTENT_BROWSER_DOWNLOAD_SAVE_FILE_RESOURCE_HANDLER_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <string> | 10 #include <string> |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 ResourceResponse* response, | 61 ResourceResponse* response, |
| 62 std::unique_ptr<ResourceController> controller) override; | 62 std::unique_ptr<ResourceController> controller) override; |
| 63 | 63 |
| 64 // Pass-through implementation. | 64 // Pass-through implementation. |
| 65 void OnWillStart(const GURL& url, | 65 void OnWillStart(const GURL& url, |
| 66 std::unique_ptr<ResourceController> controller) override; | 66 std::unique_ptr<ResourceController> controller) override; |
| 67 | 67 |
| 68 // Creates a new buffer, which will be handed to the download thread for file | 68 // Creates a new buffer, which will be handed to the download thread for file |
| 69 // writing and deletion. | 69 // writing and deletion. |
| 70 bool OnWillRead(scoped_refptr<net::IOBuffer>* buf, | 70 bool OnWillRead(scoped_refptr<net::IOBuffer>* buf, |
| 71 int* buf_size, | 71 int* buf_size) override; |
| 72 int min_size) override; | |
| 73 | 72 |
| 74 // Passes the buffer to the download file writer. | 73 // Passes the buffer to the download file writer. |
| 75 void OnReadCompleted(int bytes_read, | 74 void OnReadCompleted(int bytes_read, |
| 76 std::unique_ptr<ResourceController> controller) override; | 75 std::unique_ptr<ResourceController> controller) override; |
| 77 | 76 |
| 78 void OnResponseCompleted( | 77 void OnResponseCompleted( |
| 79 const net::URLRequestStatus& status, | 78 const net::URLRequestStatus& status, |
| 80 std::unique_ptr<ResourceController> controller) override; | 79 std::unique_ptr<ResourceController> controller) override; |
| 81 | 80 |
| 82 // N/A to this flavor of SaveFileResourceHandler. | 81 // N/A to this flavor of SaveFileResourceHandler. |
| (...skipping 23 matching lines...) Expand all Loading... |
| 106 AuthorizationState authorization_state_; | 105 AuthorizationState authorization_state_; |
| 107 | 106 |
| 108 static const int kReadBufSize = 32768; // bytes | 107 static const int kReadBufSize = 32768; // bytes |
| 109 | 108 |
| 110 DISALLOW_COPY_AND_ASSIGN(SaveFileResourceHandler); | 109 DISALLOW_COPY_AND_ASSIGN(SaveFileResourceHandler); |
| 111 }; | 110 }; |
| 112 | 111 |
| 113 } // namespace content | 112 } // namespace content |
| 114 | 113 |
| 115 #endif // CONTENT_BROWSER_DOWNLOAD_SAVE_FILE_RESOURCE_HANDLER_H_ | 114 #endif // CONTENT_BROWSER_DOWNLOAD_SAVE_FILE_RESOURCE_HANDLER_H_ |
| OLD | NEW |