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 <string> | 8 #include <string> |
9 | 9 |
10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
(...skipping 30 matching lines...) Expand all Loading... |
41 bool* defer) OVERRIDE; | 41 bool* defer) OVERRIDE; |
42 | 42 |
43 // Pass-through implementation. | 43 // Pass-through implementation. |
44 virtual bool OnWillStart(int request_id, | 44 virtual bool OnWillStart(int request_id, |
45 const GURL& url, | 45 const GURL& url, |
46 bool* defer) OVERRIDE; | 46 bool* defer) OVERRIDE; |
47 | 47 |
48 // Creates a new buffer, which will be handed to the download thread for file | 48 // Creates a new buffer, which will be handed to the download thread for file |
49 // writing and deletion. | 49 // writing and deletion. |
50 virtual bool OnWillRead(int request_id, | 50 virtual bool OnWillRead(int request_id, |
51 scoped_refptr<net::IOBuffer>* buf, | 51 net::IOBuffer** buf, |
52 int* buf_size, | 52 int* buf_size, |
53 int min_size) OVERRIDE; | 53 int min_size) OVERRIDE; |
54 | 54 |
55 // Passes the buffer to the download file writer. | 55 // Passes the buffer to the download file writer. |
56 virtual bool OnReadCompleted(int request_id, int bytes_read, | 56 virtual bool OnReadCompleted(int request_id, int bytes_read, |
57 bool* defer) OVERRIDE; | 57 bool* defer) OVERRIDE; |
58 | 58 |
59 virtual bool OnResponseCompleted(int request_id, | 59 virtual bool OnResponseCompleted(int request_id, |
60 const net::URLRequestStatus& status, | 60 const net::URLRequestStatus& status, |
61 const std::string& security_info) OVERRIDE; | 61 const std::string& security_info) OVERRIDE; |
(...skipping 22 matching lines...) Expand all Loading... |
84 SaveFileManager* save_manager_; | 84 SaveFileManager* save_manager_; |
85 | 85 |
86 static const int kReadBufSize = 32768; // bytes | 86 static const int kReadBufSize = 32768; // bytes |
87 | 87 |
88 DISALLOW_COPY_AND_ASSIGN(SaveFileResourceHandler); | 88 DISALLOW_COPY_AND_ASSIGN(SaveFileResourceHandler); |
89 }; | 89 }; |
90 | 90 |
91 } // namespace content | 91 } // namespace content |
92 | 92 |
93 #endif // CONTENT_BROWSER_DOWNLOAD_SAVE_FILE_RESOURCE_HANDLER_H_ | 93 #endif // CONTENT_BROWSER_DOWNLOAD_SAVE_FILE_RESOURCE_HANDLER_H_ |
OLD | NEW |