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