OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "content/public/common/page_state.h" |
| 6 |
| 7 namespace content { |
| 8 |
| 9 // static |
| 10 PageState PageState::CreateFromEncodedData(const std::string& data) { |
| 11 return PageState(data); |
| 12 } |
| 13 |
| 14 PageState::PageState() { |
| 15 } |
| 16 |
| 17 bool PageState::IsValid() const { |
| 18 return !data_.empty(); |
| 19 } |
| 20 |
| 21 bool PageState::Equals(const PageState& other) const { |
| 22 return data_ == other.data_; |
| 23 } |
| 24 |
| 25 const std::string& PageState::ToEncodedData() const { |
| 26 return data_; |
| 27 } |
| 28 |
| 29 PageState::PageState(const std::string& data) |
| 30 : data_(data) { |
| 31 // TODO(darin): Enable this DCHECK once tests have been fixed up to not pass |
| 32 // bogus encoded data to CreateFromEncodedData. |
| 33 //DCHECK(IsValid()); |
| 34 } |
| 35 |
| 36 } // namespace content |
OLD | NEW |