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 27 matching lines...) Expand all Loading... |
38 // Sends the download creation information to the download thread. | 38 // Sends the download creation information to the download thread. |
39 virtual bool OnResponseStarted(int request_id, | 39 virtual bool OnResponseStarted(int request_id, |
40 ResourceResponse* response, | 40 ResourceResponse* response, |
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 // Pass-through implementation. |
| 49 virtual bool OnBeforeNetworkStart(int request_id, |
| 50 const GURL& url, |
| 51 bool* defer) OVERRIDE; |
| 52 |
48 // Creates a new buffer, which will be handed to the download thread for file | 53 // Creates a new buffer, which will be handed to the download thread for file |
49 // writing and deletion. | 54 // writing and deletion. |
50 virtual bool OnWillRead(int request_id, | 55 virtual bool OnWillRead(int request_id, |
51 scoped_refptr<net::IOBuffer>* buf, | 56 scoped_refptr<net::IOBuffer>* buf, |
52 int* buf_size, | 57 int* buf_size, |
53 int min_size) OVERRIDE; | 58 int min_size) OVERRIDE; |
54 | 59 |
55 // Passes the buffer to the download file writer. | 60 // Passes the buffer to the download file writer. |
56 virtual bool OnReadCompleted(int request_id, int bytes_read, | 61 virtual bool OnReadCompleted(int request_id, int bytes_read, |
57 bool* defer) OVERRIDE; | 62 bool* defer) OVERRIDE; |
(...skipping 27 matching lines...) Expand all Loading... |
85 SaveFileManager* save_manager_; | 90 SaveFileManager* save_manager_; |
86 | 91 |
87 static const int kReadBufSize = 32768; // bytes | 92 static const int kReadBufSize = 32768; // bytes |
88 | 93 |
89 DISALLOW_COPY_AND_ASSIGN(SaveFileResourceHandler); | 94 DISALLOW_COPY_AND_ASSIGN(SaveFileResourceHandler); |
90 }; | 95 }; |
91 | 96 |
92 } // namespace content | 97 } // namespace content |
93 | 98 |
94 #endif // CONTENT_BROWSER_DOWNLOAD_SAVE_FILE_RESOURCE_HANDLER_H_ | 99 #endif // CONTENT_BROWSER_DOWNLOAD_SAVE_FILE_RESOURCE_HANDLER_H_ |
OLD | NEW |