Chromium Code Reviews| 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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 66 | 66 |
| 67 // If the content-length header is not present (or contains something other | 67 // If the content-length header is not present (or contains something other |
| 68 // than numbers), StringToInt64 returns 0, which indicates 'unknown size' and | 68 // than numbers), StringToInt64 returns 0, which indicates 'unknown size' and |
| 69 // is handled correctly by the SaveManager. | 69 // is handled correctly by the SaveManager. |
| 70 void set_content_length(const std::string& content_length); | 70 void set_content_length(const std::string& content_length); |
| 71 | 71 |
| 72 void set_content_disposition(const std::string& content_disposition) { | 72 void set_content_disposition(const std::string& content_disposition) { |
| 73 content_disposition_ = content_disposition; | 73 content_disposition_ = content_disposition; |
| 74 } | 74 } |
| 75 | 75 |
| 76 void MarkAsUnauthorized() { is_authorized_ = false; } | |
|
mmenke
2016/07/27 14:45:18
optional: Could add a comment either here or mayb
mmenke
2016/07/27 14:45:18
optional suggestion: To be really paranoid about
| |
| 77 | |
| 76 private: | 78 private: |
| 77 SaveItemId save_item_id_; | 79 SaveItemId save_item_id_; |
| 78 SavePackageId save_package_id_; | 80 SavePackageId save_package_id_; |
| 79 int render_process_id_; | 81 int render_process_id_; |
| 80 int render_frame_routing_id_; | 82 int render_frame_routing_id_; |
| 81 scoped_refptr<net::IOBuffer> read_buffer_; | 83 scoped_refptr<net::IOBuffer> read_buffer_; |
| 82 std::string content_disposition_; | 84 std::string content_disposition_; |
| 83 GURL url_; | 85 GURL url_; |
| 84 GURL final_url_; | 86 GURL final_url_; |
| 85 int64_t content_length_; | 87 int64_t content_length_; |
| 86 SaveFileManager* save_manager_; | 88 SaveFileManager* save_manager_; |
| 87 | 89 |
| 90 bool is_authorized_; | |
| 91 | |
| 88 static const int kReadBufSize = 32768; // bytes | 92 static const int kReadBufSize = 32768; // bytes |
| 89 | 93 |
| 90 DISALLOW_COPY_AND_ASSIGN(SaveFileResourceHandler); | 94 DISALLOW_COPY_AND_ASSIGN(SaveFileResourceHandler); |
| 91 }; | 95 }; |
| 92 | 96 |
| 93 } // namespace content | 97 } // namespace content |
| 94 | 98 |
| 95 #endif // CONTENT_BROWSER_DOWNLOAD_SAVE_FILE_RESOURCE_HANDLER_H_ | 99 #endif // CONTENT_BROWSER_DOWNLOAD_SAVE_FILE_RESOURCE_HANDLER_H_ |
| OLD | NEW |