| 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> |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 // the files referenced by each frame. See http://crbug.com/441966. | 64 // the files referenced by each frame. See http://crbug.com/441966. |
| 65 std::vector<base::NullableString16> referenced_files; | 65 std::vector<base::NullableString16> referenced_files; |
| 66 ExplodedFrameState top; | 66 ExplodedFrameState top; |
| 67 | 67 |
| 68 ExplodedPageState(); | 68 ExplodedPageState(); |
| 69 ~ExplodedPageState(); | 69 ~ExplodedPageState(); |
| 70 }; | 70 }; |
| 71 | 71 |
| 72 CONTENT_EXPORT bool DecodePageState(const std::string& encoded, | 72 CONTENT_EXPORT bool DecodePageState(const std::string& encoded, |
| 73 ExplodedPageState* exploded); | 73 ExplodedPageState* exploded); |
| 74 CONTENT_EXPORT bool EncodePageState(const ExplodedPageState& exploded, | 74 CONTENT_EXPORT void EncodePageState(const ExplodedPageState& exploded, |
| 75 std::string* encoded); | 75 std::string* encoded); |
| 76 | 76 |
| 77 #if defined(OS_ANDROID) | 77 #if defined(OS_ANDROID) |
| 78 CONTENT_EXPORT bool DecodePageStateWithDeviceScaleFactorForTesting( | 78 CONTENT_EXPORT bool DecodePageStateWithDeviceScaleFactorForTesting( |
| 79 const std::string& encoded, | 79 const std::string& encoded, |
| 80 float device_scale_factor, | 80 float device_scale_factor, |
| 81 ExplodedPageState* exploded); | 81 ExplodedPageState* exploded); |
| 82 | 82 |
| 83 // Converts results of EncodeResourceRequestBody (passed in as a pair of |data| | 83 // Converts results of EncodeResourceRequestBody (passed in as a pair of |data| |
| 84 // + |size|) back into a ResourceRequestBodyImpl. Returns nullptr if the | 84 // + |size|) back into a ResourceRequestBodyImpl. Returns nullptr if the |
| 85 // decoding fails (e.g. if |data| is malformed). | 85 // decoding fails (e.g. if |data| is malformed). |
| 86 scoped_refptr<ResourceRequestBodyImpl> DecodeResourceRequestBody( | 86 scoped_refptr<ResourceRequestBodyImpl> DecodeResourceRequestBody( |
| 87 const char* data, | 87 const char* data, |
| 88 size_t size); | 88 size_t size); |
| 89 | 89 |
| 90 // Encodes |resource_request_body| into |encoded|. | 90 // Encodes |resource_request_body| into |encoded|. |
| 91 std::string EncodeResourceRequestBody( | 91 std::string EncodeResourceRequestBody( |
| 92 const ResourceRequestBodyImpl& resource_request_body); | 92 const ResourceRequestBodyImpl& resource_request_body); |
| 93 #endif | 93 #endif |
| 94 | 94 |
| 95 } // namespace content | 95 } // namespace content |
| 96 | 96 |
| 97 #endif // CONTENT_COMMON_PAGE_STATE_SERIALIZATION_H_ | 97 #endif // CONTENT_COMMON_PAGE_STATE_SERIALIZATION_H_ |
| OLD | NEW |