Cast: Stop logging kVideoFrameSentToEncoder and rename a couple events.
[chromium-blink-merge.git] / content / common / page_state_serialization.h
blob43efb53da447335b90f1e3b4a7aefaf137e20a7f
1 // Copyright 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.
5 #ifndef CONTENT_COMMON_PAGE_STATE_SERIALIZATION_H_
6 #define CONTENT_COMMON_PAGE_STATE_SERIALIZATION_H_
8 #include <vector>
10 #include "base/strings/nullable_string16.h"
11 #include "content/common/content_export.h"
12 #include "third_party/WebKit/public/platform/WebHTTPBody.h"
13 #include "third_party/WebKit/public/platform/WebReferrerPolicy.h"
14 #include "ui/gfx/point.h"
15 #include "url/gurl.h"
17 namespace content {
19 struct CONTENT_EXPORT ExplodedHttpBodyElement {
20 blink::WebHTTPBody::Element::Type type;
21 std::string data;
22 base::NullableString16 file_path;
23 GURL filesystem_url;
24 int64 file_start;
25 int64 file_length;
26 double file_modification_time;
27 std::string blob_uuid;
29 ExplodedHttpBodyElement();
30 ~ExplodedHttpBodyElement();
33 struct CONTENT_EXPORT ExplodedHttpBody {
34 base::NullableString16 http_content_type;
35 std::vector<ExplodedHttpBodyElement> elements;
36 int64 identifier;
37 bool contains_passwords;
38 bool is_null;
40 ExplodedHttpBody();
41 ~ExplodedHttpBody();
44 struct CONTENT_EXPORT ExplodedFrameState {
45 base::NullableString16 url_string;
46 base::NullableString16 referrer;
47 base::NullableString16 target;
48 base::NullableString16 state_object;
49 std::vector<base::NullableString16> document_state;
50 gfx::Point scroll_offset;
51 int64 item_sequence_number;
52 int64 document_sequence_number;
53 double page_scale_factor;
54 blink::WebReferrerPolicy referrer_policy;
55 ExplodedHttpBody http_body;
56 std::vector<ExplodedFrameState> children;
58 ExplodedFrameState();
59 ~ExplodedFrameState();
62 struct CONTENT_EXPORT ExplodedPageState {
63 std::vector<base::NullableString16> referenced_files;
64 ExplodedFrameState top;
66 ExplodedPageState();
67 ~ExplodedPageState();
70 CONTENT_EXPORT bool DecodePageState(const std::string& encoded,
71 ExplodedPageState* exploded);
72 CONTENT_EXPORT bool EncodePageState(const ExplodedPageState& exploded,
73 std::string* encoded);
75 #if defined(OS_ANDROID)
76 CONTENT_EXPORT bool DecodePageStateWithDeviceScaleFactorForTesting(
77 const std::string& encoded,
78 float device_scale_factor,
79 ExplodedPageState* exploded);
80 #endif
82 } // namespace content
84 #endif // CONTENT_COMMON_PAGE_STATE_SERIALIZATION_H_