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

Side by Side Diff: content/common/page_state_serialization.h

Issue 16867005: Re-implement PageState serialization without a Blink API dependency. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Improvements based on review feedback. 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 #ifndef CONTENT_COMMON_PAGE_STATE_SERIALIZATION_H_
6 #define CONTENT_COMMON_PAGE_STATE_SERIALIZATION_H_
7
8 #include <vector>
9
10 #include "base/strings/nullable_string16.h"
11 #include "content/common/content_export.h"
12 #include "googleurl/src/gurl.h"
13 #include "third_party/WebKit/public/platform/WebHTTPBody.h"
14 #include "ui/gfx/point.h"
15
16 namespace content {
17
18 struct CONTENT_EXPORT ExplodedHttpBodyElement {
19 WebKit::WebHTTPBody::Element::Type type;
20 std::string data;
21 base::NullableString16 file_path;
22 GURL url;
23 int64 file_start;
24 int64 file_length;
25 double file_modification_time;
26
27 ExplodedHttpBodyElement();
28 ~ExplodedHttpBodyElement();
29 };
30
31 struct CONTENT_EXPORT ExplodedHttpBody {
32 base::NullableString16 http_content_type;
33 std::vector<ExplodedHttpBodyElement> elements;
34 int64 identifier;
35 bool contains_passwords;
36 bool is_null;
37
38 ExplodedHttpBody();
39 ~ExplodedHttpBody();
40 };
41
42 struct CONTENT_EXPORT ExplodedFrameState {
43 base::NullableString16 url_string;
44 base::NullableString16 original_url_string;
45 base::NullableString16 referrer;
46 base::NullableString16 target;
47 base::NullableString16 parent;
48 base::NullableString16 title;
49 base::NullableString16 alternate_title;
50 base::NullableString16 state_object;
51 std::vector<base::NullableString16> document_state;
52 gfx::Point scroll_offset;
53 int64 item_sequence_number;
54 int64 document_sequence_number;
55 int visit_count;
56 double visited_time;
57 double page_scale_factor;
58 bool is_target_item;
59 ExplodedHttpBody http_body;
60 std::vector<ExplodedFrameState> children;
61
62 ExplodedFrameState();
63 ~ExplodedFrameState();
64 };
65
66 struct CONTENT_EXPORT ExplodedPageState {
67 std::vector<base::NullableString16> referenced_files;
68 ExplodedFrameState top;
69
70 ExplodedPageState();
71 ~ExplodedPageState();
72 };
73
74 CONTENT_EXPORT bool DecodePageState(const std::string& encoded,
75 ExplodedPageState* exploded);
76 CONTENT_EXPORT bool EncodePageState(const ExplodedPageState& exploded,
77 std::string* encoded);
78
79 } // namespace content
80
81 #endif // CONTENT_COMMON_PAGE_STATE_SERIALIZATION_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698