Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(953)

Side by Side Diff: content/public/common/page_state.cc

Issue 16162003: Introduce content::PageState (again). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698