| 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_PUBLIC_BROWSER_DOWNLOAD_URL_PARAMETERS_H_ | 5 #ifndef CONTENT_PUBLIC_BROWSER_DOWNLOAD_URL_PARAMETERS_H_ |
| 6 #define CONTENT_PUBLIC_BROWSER_DOWNLOAD_URL_PARAMETERS_H_ | 6 #define CONTENT_PUBLIC_BROWSER_DOWNLOAD_URL_PARAMETERS_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 content_initiated_ = content_initiated; | 62 content_initiated_ = content_initiated; |
| 63 } | 63 } |
| 64 void add_request_header(const std::string& name, const std::string& value) { | 64 void add_request_header(const std::string& name, const std::string& value) { |
| 65 request_headers_.push_back(make_pair(name, value)); | 65 request_headers_.push_back(make_pair(name, value)); |
| 66 } | 66 } |
| 67 void set_referrer(const Referrer& referrer) { referrer_ = referrer; } | 67 void set_referrer(const Referrer& referrer) { referrer_ = referrer; } |
| 68 void set_referrer_encoding(const std::string& referrer_encoding) { | 68 void set_referrer_encoding(const std::string& referrer_encoding) { |
| 69 referrer_encoding_ = referrer_encoding; | 69 referrer_encoding_ = referrer_encoding; |
| 70 } | 70 } |
| 71 void set_load_flags(int load_flags) { load_flags_ |= load_flags; } | 71 void set_load_flags(int load_flags) { load_flags_ |= load_flags; } |
| 72 void set_last_modified(const std::string& last_modified) { |
| 73 last_modified_ = last_modified; |
| 74 } |
| 75 void set_etag(const std::string& etag) { |
| 76 etag_ = etag; |
| 77 } |
| 72 void set_method(const std::string& method) { | 78 void set_method(const std::string& method) { |
| 73 method_ = method; | 79 method_ = method; |
| 74 } | 80 } |
| 75 void set_post_body(const std::string& post_body) { | 81 void set_post_body(const std::string& post_body) { |
| 76 post_body_ = post_body; | 82 post_body_ = post_body; |
| 77 } | 83 } |
| 78 void set_prefer_cache(bool prefer_cache) { | 84 void set_prefer_cache(bool prefer_cache) { |
| 79 prefer_cache_ = prefer_cache; | 85 prefer_cache_ = prefer_cache; |
| 80 } | 86 } |
| 81 void set_post_id(int64 post_id) { post_id_ = post_id; } | 87 void set_post_id(int64 post_id) { post_id_ = post_id; } |
| 82 void set_callback(const OnStartedCallback& callback) { | 88 void set_callback(const OnStartedCallback& callback) { |
| 83 callback_ = callback; | 89 callback_ = callback; |
| 84 } | 90 } |
| 85 | 91 |
| 86 const OnStartedCallback& callback() const { return callback_; } | 92 const OnStartedCallback& callback() const { return callback_; } |
| 87 bool content_initiated() const { return content_initiated_; } | 93 bool content_initiated() const { return content_initiated_; } |
| 88 int load_flags() const { return load_flags_; } | 94 int load_flags() const { return load_flags_; } |
| 95 const std::string& last_modified() { return last_modified_; } |
| 96 const std::string& etag() { return etag_; } |
| 89 const std::string& method() const { return method_; } | 97 const std::string& method() const { return method_; } |
| 90 const std::string& post_body() const { return post_body_; } | 98 const std::string& post_body() const { return post_body_; } |
| 91 int64 post_id() const { return post_id_; } | 99 int64 post_id() const { return post_id_; } |
| 92 bool prefer_cache() const { return prefer_cache_; } | 100 bool prefer_cache() const { return prefer_cache_; } |
| 93 const Referrer& referrer() const { return referrer_; } | 101 const Referrer& referrer() const { return referrer_; } |
| 94 const std::string& referrer_encoding() const { return referrer_encoding_; } | 102 const std::string& referrer_encoding() const { return referrer_encoding_; } |
| 95 int render_process_host_id() const { return render_process_host_id_; } | 103 int render_process_host_id() const { return render_process_host_id_; } |
| 96 int render_view_host_routing_id() const { | 104 int render_view_host_routing_id() const { |
| 97 return render_view_host_routing_id_; | 105 return render_view_host_routing_id_; |
| 98 } | 106 } |
| (...skipping 10 matching lines...) Expand all Loading... |
| 109 return resource_dispatcher_host_; | 117 return resource_dispatcher_host_; |
| 110 } | 118 } |
| 111 const DownloadSaveInfo& save_info() const { return save_info_; } | 119 const DownloadSaveInfo& save_info() const { return save_info_; } |
| 112 const GURL& url() const { return url_; } | 120 const GURL& url() const { return url_; } |
| 113 | 121 |
| 114 private: | 122 private: |
| 115 OnStartedCallback callback_; | 123 OnStartedCallback callback_; |
| 116 bool content_initiated_; | 124 bool content_initiated_; |
| 117 RequestHeadersType request_headers_; | 125 RequestHeadersType request_headers_; |
| 118 int load_flags_; | 126 int load_flags_; |
| 127 std::string last_modified_; |
| 128 std::string etag_; |
| 119 std::string method_; | 129 std::string method_; |
| 120 std::string post_body_; | 130 std::string post_body_; |
| 121 int64 post_id_; | 131 int64 post_id_; |
| 122 bool prefer_cache_; | 132 bool prefer_cache_; |
| 123 Referrer referrer_; | 133 Referrer referrer_; |
| 124 std::string referrer_encoding_; | 134 std::string referrer_encoding_; |
| 125 int render_process_host_id_; | 135 int render_process_host_id_; |
| 126 int render_view_host_routing_id_; | 136 int render_view_host_routing_id_; |
| 127 ResourceContext* resource_context_; | 137 ResourceContext* resource_context_; |
| 128 ResourceDispatcherHost* resource_dispatcher_host_; | 138 ResourceDispatcherHost* resource_dispatcher_host_; |
| 129 DownloadSaveInfo save_info_; | 139 DownloadSaveInfo save_info_; |
| 130 GURL url_; | 140 GURL url_; |
| 131 | 141 |
| 132 DISALLOW_COPY_AND_ASSIGN(DownloadUrlParameters); | 142 DISALLOW_COPY_AND_ASSIGN(DownloadUrlParameters); |
| 133 }; | 143 }; |
| 134 | 144 |
| 135 } // namespace content | 145 } // namespace content |
| 136 | 146 |
| 137 #endif // CONTENT_PUBLIC_BROWSER_DOWNLOAD_URL_PARAMETERS_H_ | 147 #endif // CONTENT_PUBLIC_BROWSER_DOWNLOAD_URL_PARAMETERS_H_ |
| OLD | NEW |