| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 CHROME_BROWSER_RENDERER_HOST_SAVE_FILE_RESOURCE_HANDLER_H_ | 5 #ifndef CHROME_BROWSER_RENDERER_HOST_SAVE_FILE_RESOURCE_HANDLER_H_ |
| 6 #define CHROME_BROWSER_RENDERER_HOST_SAVE_FILE_RESOURCE_HANDLER_H_ | 6 #define CHROME_BROWSER_RENDERER_HOST_SAVE_FILE_RESOURCE_HANDLER_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "chrome/browser/renderer_host/resource_handler.h" | 11 #include "chrome/browser/renderer_host/resource_handler.h" |
| (...skipping 25 matching lines...) Expand all Loading... |
| 37 | 37 |
| 38 // Creates a new buffer, which will be handed to the download thread for file | 38 // Creates a new buffer, which will be handed to the download thread for file |
| 39 // writing and deletion. | 39 // writing and deletion. |
| 40 virtual bool OnWillRead(int request_id, net::IOBuffer** buf, int* buf_size, | 40 virtual bool OnWillRead(int request_id, net::IOBuffer** buf, int* buf_size, |
| 41 int min_size); | 41 int min_size); |
| 42 | 42 |
| 43 // Passes the buffer to the download file writer. | 43 // Passes the buffer to the download file writer. |
| 44 virtual bool OnReadCompleted(int request_id, int* bytes_read); | 44 virtual bool OnReadCompleted(int request_id, int* bytes_read); |
| 45 | 45 |
| 46 virtual bool OnResponseCompleted(int request_id, | 46 virtual bool OnResponseCompleted(int request_id, |
| 47 const URLRequestStatus& status, | 47 const net::URLRequestStatus& status, |
| 48 const std::string& security_info); | 48 const std::string& security_info); |
| 49 | 49 |
| 50 virtual void OnRequestClosed(); | 50 virtual void OnRequestClosed(); |
| 51 | 51 |
| 52 // If the content-length header is not present (or contains something other | 52 // If the content-length header is not present (or contains something other |
| 53 // than numbers), StringToInt64 returns 0, which indicates 'unknown size' and | 53 // than numbers), StringToInt64 returns 0, which indicates 'unknown size' and |
| 54 // is handled correctly by the SaveManager. | 54 // is handled correctly by the SaveManager. |
| 55 void set_content_length(const std::string& content_length); | 55 void set_content_length(const std::string& content_length); |
| 56 | 56 |
| 57 void set_content_disposition(const std::string& content_disposition) { | 57 void set_content_disposition(const std::string& content_disposition) { |
| (...skipping 12 matching lines...) Expand all Loading... |
| 70 GURL final_url_; | 70 GURL final_url_; |
| 71 int64 content_length_; | 71 int64 content_length_; |
| 72 SaveFileManager* save_manager_; | 72 SaveFileManager* save_manager_; |
| 73 | 73 |
| 74 static const int kReadBufSize = 32768; // bytes | 74 static const int kReadBufSize = 32768; // bytes |
| 75 | 75 |
| 76 DISALLOW_COPY_AND_ASSIGN(SaveFileResourceHandler); | 76 DISALLOW_COPY_AND_ASSIGN(SaveFileResourceHandler); |
| 77 }; | 77 }; |
| 78 | 78 |
| 79 #endif // CHROME_BROWSER_RENDERER_HOST_SAVE_FILE_RESOURCE_HANDLER_H_ | 79 #endif // CHROME_BROWSER_RENDERER_HOST_SAVE_FILE_RESOURCE_HANDLER_H_ |
| OLD | NEW |