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

Unified 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, 7 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 side-by-side diff with in-line comments
Download patch
Index: content/public/common/page_state.cc
diff --git a/content/public/common/page_state.cc b/content/public/common/page_state.cc
new file mode 100644
index 0000000000000000000000000000000000000000..7daaaac6546e046ac83bbd7968413e0bbba4b6ae
--- /dev/null
+++ b/content/public/common/page_state.cc
@@ -0,0 +1,36 @@
+// Copyright (c) 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "content/public/common/page_state.h"
+
+namespace content {
+
+// static
+PageState PageState::CreateFromEncodedData(const std::string& data) {
+ return PageState(data);
+}
+
+PageState::PageState() {
+}
+
+bool PageState::IsValid() const {
+ return !data_.empty();
+}
+
+bool PageState::Equals(const PageState& other) const {
+ return data_ == other.data_;
+}
+
+const std::string& PageState::ToEncodedData() const {
+ return data_;
+}
+
+PageState::PageState(const std::string& data)
+ : data_(data) {
+ // TODO(darin): Enable this DCHECK once tests have been fixed up to not pass
+ // bogus encoded data to CreateFromEncodedData.
+ //DCHECK(IsValid());
+}
+
+} // namespace content

Powered by Google App Engine
This is Rietveld 408576698