| 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 #include "content/common/page_state_serialization.h" | 5 #include "content/common/page_state_serialization.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <limits> | 10 #include <limits> |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 base::NullableString16(elements[i].path().AsUTF16Unsafe(), false)); | 76 base::NullableString16(elements[i].path().AsUTF16Unsafe(), false)); |
| 77 } | 77 } |
| 78 } | 78 } |
| 79 | 79 |
| 80 bool AppendReferencedFilesFromDocumentState( | 80 bool AppendReferencedFilesFromDocumentState( |
| 81 const std::vector<base::NullableString16>& document_state, | 81 const std::vector<base::NullableString16>& document_state, |
| 82 std::vector<base::NullableString16>* referenced_files) { | 82 std::vector<base::NullableString16>* referenced_files) { |
| 83 if (document_state.empty()) | 83 if (document_state.empty()) |
| 84 return true; | 84 return true; |
| 85 | 85 |
| 86 // This algorithm is adapted from Blink's core/html/FormController.cpp code. | 86 // This algorithm is adapted from Blink's FormController code. |
| 87 // We only care about how that code worked when this code snapshot was taken | 87 // We only care about how that code worked when this code snapshot was taken |
| 88 // as this code is only needed for backwards compat. | 88 // as this code is only needed for backwards compat. |
| 89 // | 89 // |
| 90 // For reference, see FormController::formStatesFromStateVector at: | 90 // For reference, see FormController::formStatesFromStateVector in |
| 91 // http://src.chromium.org/viewvc/blink/trunk/Source/core/html/FormController.
cpp?pathrev=152274 | 91 // third_party/WebKit/Source/core/html/forms/FormController.cpp. |
| 92 | 92 |
| 93 size_t index = 0; | 93 size_t index = 0; |
| 94 | 94 |
| 95 if (document_state.size() < 3) | 95 if (document_state.size() < 3) |
| 96 return false; | 96 return false; |
| 97 | 97 |
| 98 index++; // Skip over magic signature. | 98 index++; // Skip over magic signature. |
| 99 index++; // Skip over form key. | 99 index++; // Skip over form key. |
| 100 | 100 |
| 101 size_t item_count; | 101 size_t item_count; |
| (...skipping 679 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 781 // because it covers additional data (e.g.|contains_sensitive_info|) which | 781 // because it covers additional data (e.g.|contains_sensitive_info|) which |
| 782 // is marshaled between native code and java. WriteResourceRequestBody() | 782 // is marshaled between native code and java. WriteResourceRequestBody() |
| 783 // serializes data which needs to be saved out to disk. | 783 // serializes data which needs to be saved out to disk. |
| 784 WriteBoolean(resource_request_body.contains_sensitive_info(), &obj); | 784 WriteBoolean(resource_request_body.contains_sensitive_info(), &obj); |
| 785 return obj.GetAsString(); | 785 return obj.GetAsString(); |
| 786 } | 786 } |
| 787 | 787 |
| 788 #endif | 788 #endif |
| 789 | 789 |
| 790 } // namespace content | 790 } // namespace content |
| OLD | NEW |