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

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

Issue 2012913002: Deduping conversions between ResourceRequestBody/WebHTTPBody/ExplodedHttpBody. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@get-rid-of-exploded-http-body
Patch Set: Calling ResourceRequestBody::AppendFileRange with optional_body_file_path. Created 4 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
« no previous file with comments | « content/child/web_url_request_util.cc ('k') | content/common/page_state_serialization.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "content/common/resource_request_body.h" 15 #include "content/common/resource_request_body.h"
16 #include "third_party/WebKit/public/platform/WebHTTPBody.h" 16 #include "third_party/WebKit/public/platform/WebHTTPBody.h"
17 #include "third_party/WebKit/public/platform/WebHistoryScrollRestorationType.h" 17 #include "third_party/WebKit/public/platform/WebHistoryScrollRestorationType.h"
18 #include "third_party/WebKit/public/platform/WebReferrerPolicy.h" 18 #include "third_party/WebKit/public/platform/WebReferrerPolicy.h"
19 #include "ui/gfx/geometry/point.h" 19 #include "ui/gfx/geometry/point.h"
20 #include "ui/gfx/geometry/point_f.h" 20 #include "ui/gfx/geometry/point_f.h"
21 #include "url/gurl.h" 21 #include "url/gurl.h"
22 22
23 namespace content { 23 namespace content {
24 24
25 using ExplodedHttpBodyElement = ResourceRequestBody::Element;
26
27 struct CONTENT_EXPORT ExplodedHttpBody { 25 struct CONTENT_EXPORT ExplodedHttpBody {
28 base::NullableString16 http_content_type; 26 base::NullableString16 http_content_type;
29 std::vector<ExplodedHttpBodyElement> elements; 27 scoped_refptr<ResourceRequestBody> request_body;
30 int64_t identifier;
31 bool contains_passwords; 28 bool contains_passwords;
32 bool is_null;
33 29
34 ExplodedHttpBody(); 30 ExplodedHttpBody();
35 ~ExplodedHttpBody(); 31 ~ExplodedHttpBody();
36 }; 32 };
37 33
38 struct CONTENT_EXPORT ExplodedFrameState { 34 struct CONTENT_EXPORT ExplodedFrameState {
39 base::NullableString16 url_string; 35 base::NullableString16 url_string;
40 base::NullableString16 referrer; 36 base::NullableString16 referrer;
41 base::NullableString16 target; 37 base::NullableString16 target;
42 base::NullableString16 state_object; 38 base::NullableString16 state_object;
(...skipping 26 matching lines...) Expand all
69 65
70 ExplodedPageState(); 66 ExplodedPageState();
71 ~ExplodedPageState(); 67 ~ExplodedPageState();
72 }; 68 };
73 69
74 CONTENT_EXPORT bool DecodePageState(const std::string& encoded, 70 CONTENT_EXPORT bool DecodePageState(const std::string& encoded,
75 ExplodedPageState* exploded); 71 ExplodedPageState* exploded);
76 CONTENT_EXPORT bool EncodePageState(const ExplodedPageState& exploded, 72 CONTENT_EXPORT bool EncodePageState(const ExplodedPageState& exploded,
77 std::string* encoded); 73 std::string* encoded);
78 74
79 // This method converts the ExplodedHttpBody into a ResourceRequestBody format.
80 // If |exploded| is not null, initializes |http_body| with the data from
81 // |exploded|. Returns false otherwise.
82 // PlzNavigate: This is used in the browser process when converting the POST
83 // data stored in a PageState into a ResourceRequestBody that can be used by
84 // the network stack.
85 bool GeneratePostData(const ExplodedHttpBody& exploded,
86 ResourceRequestBody* http_body);
87
88 #if defined(OS_ANDROID) 75 #if defined(OS_ANDROID)
89 CONTENT_EXPORT bool DecodePageStateWithDeviceScaleFactorForTesting( 76 CONTENT_EXPORT bool DecodePageStateWithDeviceScaleFactorForTesting(
90 const std::string& encoded, 77 const std::string& encoded,
91 float device_scale_factor, 78 float device_scale_factor,
92 ExplodedPageState* exploded); 79 ExplodedPageState* exploded);
93 #endif 80 #endif
94 81
95 } // namespace content 82 } // namespace content
96 83
97 #endif // CONTENT_COMMON_PAGE_STATE_SERIALIZATION_H_ 84 #endif // CONTENT_COMMON_PAGE_STATE_SERIALIZATION_H_
OLDNEW
« no previous file with comments | « content/child/web_url_request_util.cc ('k') | content/common/page_state_serialization.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698