OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CONTENT_COMMON_PAGE_STATE_SERIALIZATION_H_ | 5 #ifndef CONTENT_COMMON_PAGE_STATE_SERIALIZATION_H_ |
6 #define CONTENT_COMMON_PAGE_STATE_SERIALIZATION_H_ | 6 #define CONTENT_COMMON_PAGE_STATE_SERIALIZATION_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <string> | 10 #include <string> |
11 #include <vector> | 11 #include <vector> |
12 | 12 |
13 #include "base/strings/nullable_string16.h" | 13 #include "base/strings/nullable_string16.h" |
14 #include "build/build_config.h" | 14 #include "build/build_config.h" |
15 #include "content/common/content_export.h" | 15 #include "content/common/content_export.h" |
16 #include "content/common/resource_request_body_impl.h" | 16 #include "content/public/common/resource_request_body.h" |
17 #include "third_party/WebKit/public/platform/WebHTTPBody.h" | 17 #include "third_party/WebKit/public/platform/WebHTTPBody.h" |
18 #include "third_party/WebKit/public/platform/WebHistoryScrollRestorationType.h" | 18 #include "third_party/WebKit/public/platform/WebHistoryScrollRestorationType.h" |
19 #include "third_party/WebKit/public/platform/WebReferrerPolicy.h" | 19 #include "third_party/WebKit/public/platform/WebReferrerPolicy.h" |
20 #include "ui/gfx/geometry/point.h" | 20 #include "ui/gfx/geometry/point.h" |
21 #include "ui/gfx/geometry/point_f.h" | 21 #include "ui/gfx/geometry/point_f.h" |
22 #include "url/gurl.h" | 22 #include "url/gurl.h" |
23 | 23 |
24 namespace content { | 24 namespace content { |
25 | 25 |
26 struct CONTENT_EXPORT ExplodedHttpBody { | 26 struct CONTENT_EXPORT ExplodedHttpBody { |
27 base::NullableString16 http_content_type; | 27 base::NullableString16 http_content_type; |
28 scoped_refptr<ResourceRequestBodyImpl> request_body; | 28 scoped_refptr<ResourceRequestBody> request_body; |
29 bool contains_passwords; | 29 bool contains_passwords; |
30 | 30 |
31 ExplodedHttpBody(); | 31 ExplodedHttpBody(); |
32 ~ExplodedHttpBody(); | 32 ~ExplodedHttpBody(); |
33 }; | 33 }; |
34 | 34 |
35 struct CONTENT_EXPORT ExplodedFrameState { | 35 struct CONTENT_EXPORT ExplodedFrameState { |
36 base::NullableString16 url_string; | 36 base::NullableString16 url_string; |
37 base::NullableString16 referrer; | 37 base::NullableString16 referrer; |
38 base::NullableString16 target; | 38 base::NullableString16 target; |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 CONTENT_EXPORT void EncodePageState(const ExplodedPageState& exploded, | 75 CONTENT_EXPORT void EncodePageState(const ExplodedPageState& exploded, |
76 std::string* encoded); | 76 std::string* encoded); |
77 | 77 |
78 #if defined(OS_ANDROID) | 78 #if defined(OS_ANDROID) |
79 CONTENT_EXPORT bool DecodePageStateWithDeviceScaleFactorForTesting( | 79 CONTENT_EXPORT bool DecodePageStateWithDeviceScaleFactorForTesting( |
80 const std::string& encoded, | 80 const std::string& encoded, |
81 float device_scale_factor, | 81 float device_scale_factor, |
82 ExplodedPageState* exploded); | 82 ExplodedPageState* exploded); |
83 | 83 |
84 // Converts results of EncodeResourceRequestBody (passed in as a pair of |data| | 84 // Converts results of EncodeResourceRequestBody (passed in as a pair of |data| |
85 // + |size|) back into a ResourceRequestBodyImpl. Returns nullptr if the | 85 // + |size|) back into a ResourceRequestBody. Returns nullptr if the |
86 // decoding fails (e.g. if |data| is malformed). | 86 // decoding fails (e.g. if |data| is malformed). |
87 scoped_refptr<ResourceRequestBodyImpl> DecodeResourceRequestBody( | 87 scoped_refptr<ResourceRequestBody> DecodeResourceRequestBody(const char* data, |
88 const char* data, | 88 size_t size); |
89 size_t size); | |
90 | 89 |
91 // Encodes |resource_request_body| into |encoded|. | 90 // Encodes |resource_request_body| into |encoded|. |
92 std::string EncodeResourceRequestBody( | 91 std::string EncodeResourceRequestBody( |
93 const ResourceRequestBodyImpl& resource_request_body); | 92 const ResourceRequestBody& resource_request_body); |
94 #endif | 93 #endif |
95 | 94 |
96 } // namespace content | 95 } // namespace content |
97 | 96 |
98 #endif // CONTENT_COMMON_PAGE_STATE_SERIALIZATION_H_ | 97 #endif // CONTENT_COMMON_PAGE_STATE_SERIALIZATION_H_ |
OLD | NEW |