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 |
11 namespace content { | 11 namespace content { |
12 namespace { | 12 namespace { |
13 | 13 |
14 base::NullableString16 ToNullableString16(const std::string& utf8) { | 14 base::NullableString16 ToNullableString16(const std::string& utf8) { |
15 return base::NullableString16(UTF8ToUTF16(utf8), false); | 15 return base::NullableString16(base::UTF8ToUTF16(utf8), false); |
16 } | 16 } |
17 | 17 |
18 base::FilePath ToFilePath(const base::NullableString16& s) { | 18 base::FilePath ToFilePath(const base::NullableString16& s) { |
19 return base::FilePath::FromUTF16Unsafe(s.string()); | 19 return base::FilePath::FromUTF16Unsafe(s.string()); |
20 } | 20 } |
21 | 21 |
22 void ToFilePathVector(const std::vector<base::NullableString16>& input, | 22 void ToFilePathVector(const std::vector<base::NullableString16>& input, |
23 std::vector<base::FilePath>* output) { | 23 std::vector<base::FilePath>* output) { |
24 output->clear(); | 24 output->clear(); |
25 output->reserve(input.size()); | 25 output->reserve(input.size()); |
(...skipping 115 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 |