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

Unified Diff: content/public/common/page_state.h

Issue 14985014: Introduce content::PageState (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix compilation issues. 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.h
diff --git a/content/public/common/page_state.h b/content/public/common/page_state.h
new file mode 100644
index 0000000000000000000000000000000000000000..701bf9f0bbeaecc47cddd24c87f4fabe6ea60444
--- /dev/null
+++ b/content/public/common/page_state.h
@@ -0,0 +1,58 @@
+// 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.
+
+#ifndef CONTENT_PUBLIC_COMMON_PAGE_STATE_H_
+#define CONTENT_PUBLIC_COMMON_PAGE_STATE_H_
+
+#include <string>
+#include <vector>
+
+#include "content/common/content_export.h"
+
+class GURL;
+
+namespace base {
+class FilePath;
+}
+
+namespace content {
+
+class CONTENT_EXPORT PageState {
+ public:
+ static PageState CreateFromEncodedData(const std::string& data);
+ static PageState CreateFromURL(const GURL& url);
+
+ static PageState CreateForTesting(
+ const GURL& url,
+ bool body_contains_password_data,
+ const char* optional_body_data,
+ const base::FilePath* optional_body_file_path);
+
+ PageState();
+
+ bool IsValid() const;
+ bool Equals(const PageState& page_state) const;
+ const std::string& ToEncodedData() const;
+
+ std::vector<base::FilePath> GetReferencedFiles() const;
+ PageState RemovePasswordData() const;
+ PageState RemoveScrollOffset() const;
+
+ private:
+ PageState(const std::string& data);
+
+ std::string data_;
+};
tfarina 2013/05/16 22:16:48 DISALLOW_COPY_AND_ASSIGN?
+
+// Support DCHECK_EQ(a, b), etc.
+inline bool operator==(const PageState& a, const PageState& b) {
+ return a.Equals(b);
+}
+inline bool operator!=(const PageState& a, const PageState& b) {
+ return !(a == b);
+}
+
+} // namespace content
+
+#endif // CONTENT_PUBLIC_COMMON_PAGE_STATE_H_

Powered by Google App Engine
This is Rietveld 408576698