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 <vector> | 10 #include <vector> |
11 | 11 |
12 #include "base/strings/nullable_string16.h" | 12 #include "base/strings/nullable_string16.h" |
13 #include "build/build_config.h" | 13 #include "build/build_config.h" |
14 #include "content/common/content_export.h" | 14 #include "content/common/content_export.h" |
15 #include "third_party/WebKit/public/platform/WebHTTPBody.h" | 15 #include "third_party/WebKit/public/platform/WebHTTPBody.h" |
16 #include "third_party/WebKit/public/platform/WebHistoryScrollRestorationType.h" | 16 #include "third_party/WebKit/public/platform/WebHistoryScrollRestorationType.h" |
17 #include "third_party/WebKit/public/platform/WebReferrerPolicy.h" | 17 #include "third_party/WebKit/public/platform/WebReferrerPolicy.h" |
18 #include "ui/gfx/geometry/point.h" | 18 #include "ui/gfx/geometry/point.h" |
19 #include "ui/gfx/geometry/point_f.h" | 19 #include "ui/gfx/geometry/point_f.h" |
20 #include "url/gurl.h" | 20 #include "url/gurl.h" |
21 | 21 |
22 namespace content { | 22 namespace content { |
23 | 23 |
| 24 class ResourceRequestBody; |
| 25 |
24 struct CONTENT_EXPORT ExplodedHttpBodyElement { | 26 struct CONTENT_EXPORT ExplodedHttpBodyElement { |
25 blink::WebHTTPBody::Element::Type type; | 27 blink::WebHTTPBody::Element::Type type; |
26 std::string data; | 28 std::string data; |
27 base::NullableString16 file_path; | 29 base::NullableString16 file_path; |
28 GURL filesystem_url; | 30 GURL filesystem_url; |
29 int64_t file_start; | 31 int64_t file_start; |
30 int64_t file_length; | 32 int64_t file_length; |
31 double file_modification_time; | 33 double file_modification_time; |
32 std::string blob_uuid; | 34 std::string blob_uuid; |
33 | 35 |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 | 83 |
82 ExplodedPageState(); | 84 ExplodedPageState(); |
83 ~ExplodedPageState(); | 85 ~ExplodedPageState(); |
84 }; | 86 }; |
85 | 87 |
86 CONTENT_EXPORT bool DecodePageState(const std::string& encoded, | 88 CONTENT_EXPORT bool DecodePageState(const std::string& encoded, |
87 ExplodedPageState* exploded); | 89 ExplodedPageState* exploded); |
88 CONTENT_EXPORT bool EncodePageState(const ExplodedPageState& exploded, | 90 CONTENT_EXPORT bool EncodePageState(const ExplodedPageState& exploded, |
89 std::string* encoded); | 91 std::string* encoded); |
90 | 92 |
| 93 // This method converts the ExplodedHttpBody into a ResourceRequestBody format. |
| 94 // If |exploded| is not null, initializes |http_body| with the data from |
| 95 // |exploded|. Returns false otherwise. |
| 96 // PlzNavigate: This is used in the browser process when converting the POST |
| 97 // data stored in a PageState into a ResourceRequestBody that can be used by |
| 98 // the network stack. |
| 99 bool GeneratePostData(const ExplodedHttpBody& exploded, |
| 100 ResourceRequestBody* http_body); |
| 101 |
91 #if defined(OS_ANDROID) | 102 #if defined(OS_ANDROID) |
92 CONTENT_EXPORT bool DecodePageStateWithDeviceScaleFactorForTesting( | 103 CONTENT_EXPORT bool DecodePageStateWithDeviceScaleFactorForTesting( |
93 const std::string& encoded, | 104 const std::string& encoded, |
94 float device_scale_factor, | 105 float device_scale_factor, |
95 ExplodedPageState* exploded); | 106 ExplodedPageState* exploded); |
96 #endif | 107 #endif |
97 | 108 |
98 } // namespace content | 109 } // namespace content |
99 | 110 |
100 #endif // CONTENT_COMMON_PAGE_STATE_SERIALIZATION_H_ | 111 #endif // CONTENT_COMMON_PAGE_STATE_SERIALIZATION_H_ |
OLD | NEW |