OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 #include "content/public/common/page_state.h" | 5 #include "content/public/common/page_state.h" |
6 | 6 |
7 #include "base/files/file_path.h" | 7 #include "base/files/file_path.h" |
8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
9 #include "content/common/page_state_serialization.h" | 9 #include "content/common/page_state_serialization.h" |
10 | 10 |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 const base::FilePath* optional_body_file_path) { | 69 const base::FilePath* optional_body_file_path) { |
70 ExplodedPageState state; | 70 ExplodedPageState state; |
71 | 71 |
72 state.top.url_string = state.top.original_url_string = | 72 state.top.url_string = state.top.original_url_string = |
73 ToNullableString16(url.possibly_invalid_spec()); | 73 ToNullableString16(url.possibly_invalid_spec()); |
74 | 74 |
75 if (optional_body_data || optional_body_file_path) { | 75 if (optional_body_data || optional_body_file_path) { |
76 state.top.http_body.is_null = false; | 76 state.top.http_body.is_null = false; |
77 if (optional_body_data) { | 77 if (optional_body_data) { |
78 ExplodedHttpBodyElement element; | 78 ExplodedHttpBodyElement element; |
79 element.type = WebKit::WebHTTPBody::Element::TypeData; | 79 element.type = blink::WebHTTPBody::Element::TypeData; |
80 element.data = optional_body_data; | 80 element.data = optional_body_data; |
81 state.top.http_body.elements.push_back(element); | 81 state.top.http_body.elements.push_back(element); |
82 } | 82 } |
83 if (optional_body_file_path) { | 83 if (optional_body_file_path) { |
84 ExplodedHttpBodyElement element; | 84 ExplodedHttpBodyElement element; |
85 element.type = WebKit::WebHTTPBody::Element::TypeFile; | 85 element.type = blink::WebHTTPBody::Element::TypeFile; |
86 element.file_path = | 86 element.file_path = |
87 ToNullableString16(optional_body_file_path->AsUTF8Unsafe()); | 87 ToNullableString16(optional_body_file_path->AsUTF8Unsafe()); |
88 state.top.http_body.elements.push_back(element); | 88 state.top.http_body.elements.push_back(element); |
89 state.referenced_files.push_back(element.file_path); | 89 state.referenced_files.push_back(element.file_path); |
90 } | 90 } |
91 state.top.http_body.contains_passwords = | 91 state.top.http_body.contains_passwords = |
92 body_contains_password_data; | 92 body_contains_password_data; |
93 } | 93 } |
94 | 94 |
95 return ToPageState(state); | 95 return ToPageState(state); |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 } | 141 } |
142 | 142 |
143 PageState::PageState(const std::string& data) | 143 PageState::PageState(const std::string& data) |
144 : data_(data) { | 144 : data_(data) { |
145 // TODO(darin): Enable this DCHECK once tests have been fixed up to not pass | 145 // TODO(darin): Enable this DCHECK once tests have been fixed up to not pass |
146 // bogus encoded data to CreateFromEncodedData. | 146 // bogus encoded data to CreateFromEncodedData. |
147 //DCHECK(IsValid()); | 147 //DCHECK(IsValid()); |
148 } | 148 } |
149 | 149 |
150 } // namespace content | 150 } // namespace content |
OLD | NEW |