OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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/public/renderer/history_item_serialization.h" | 5 #include "content/public/renderer/history_item_serialization.h" |
6 | 6 |
7 #include "content/common/page_state_serialization.h" | 7 #include "content/common/page_state_serialization.h" |
8 #include "content/public/common/page_state.h" | 8 #include "content/public/common/page_state.h" |
9 #include "third_party/WebKit/public/platform/WebHTTPBody.h" | 9 #include "third_party/WebKit/public/platform/WebHTTPBody.h" |
10 #include "third_party/WebKit/public/platform/WebPoint.h" | 10 #include "third_party/WebKit/public/platform/WebPoint.h" |
(...skipping 24 matching lines...) Expand all Loading... |
35 case WebHTTPBody::Element::TypeData: | 35 case WebHTTPBody::Element::TypeData: |
36 output->data.assign(input.data.data(), input.data.size()); | 36 output->data.assign(input.data.data(), input.data.size()); |
37 break; | 37 break; |
38 case WebHTTPBody::Element::TypeFile: | 38 case WebHTTPBody::Element::TypeFile: |
39 output->file_path = input.filePath; | 39 output->file_path = input.filePath; |
40 output->file_start = input.fileStart; | 40 output->file_start = input.fileStart; |
41 output->file_length = input.fileLength; | 41 output->file_length = input.fileLength; |
42 output->file_modification_time = input.modificationTime; | 42 output->file_modification_time = input.modificationTime; |
43 break; | 43 break; |
44 case WebHTTPBody::Element::TypeURL: | 44 case WebHTTPBody::Element::TypeURL: |
45 output->url = input.url; | 45 output->filesystem_url = input.url; |
46 output->file_start = input.fileStart; | 46 output->file_start = input.fileStart; |
47 output->file_length = input.fileLength; | 47 output->file_length = input.fileLength; |
48 output->file_modification_time = input.modificationTime; | 48 output->file_modification_time = input.modificationTime; |
49 break; | 49 break; |
50 case WebHTTPBody::Element::TypeBlob: | 50 case WebHTTPBody::Element::TypeBlob: |
51 output->url = input.url; | 51 output->deprecated_blob_url = input.blobURL; |
52 break; | 52 break; |
53 } | 53 } |
54 } | 54 } |
55 | 55 |
56 void AppendHTTPBodyElement(const ExplodedHttpBodyElement& element, | 56 void AppendHTTPBodyElement(const ExplodedHttpBodyElement& element, |
57 WebHTTPBody* http_body) { | 57 WebHTTPBody* http_body) { |
58 switch (element.type) { | 58 switch (element.type) { |
59 case WebHTTPBody::Element::TypeData: | 59 case WebHTTPBody::Element::TypeData: |
60 http_body->appendData(element.data); | 60 http_body->appendData(element.data); |
61 break; | 61 break; |
62 case WebHTTPBody::Element::TypeFile: | 62 case WebHTTPBody::Element::TypeFile: |
63 http_body->appendFileRange( | 63 http_body->appendFileRange( |
64 element.file_path, | 64 element.file_path, |
65 element.file_start, | 65 element.file_start, |
66 element.file_length, | 66 element.file_length, |
67 element.file_modification_time); | 67 element.file_modification_time); |
68 break; | 68 break; |
69 case WebHTTPBody::Element::TypeURL: | 69 case WebHTTPBody::Element::TypeURL: |
70 http_body->appendURLRange( | 70 http_body->appendURLRange( |
71 element.url, | 71 element.filesystem_url, |
72 element.file_start, | 72 element.file_start, |
73 element.file_length, | 73 element.file_length, |
74 element.file_modification_time); | 74 element.file_modification_time); |
75 break; | 75 break; |
76 case WebHTTPBody::Element::TypeBlob: | 76 case WebHTTPBody::Element::TypeBlob: |
77 http_body->appendBlob(element.url); | 77 http_body->appendBlob(element.deprecated_blob_url); |
78 break; | 78 break; |
79 } | 79 } |
80 } | 80 } |
81 | 81 |
82 bool RecursivelyGenerateFrameState(const WebHistoryItem& item, | 82 bool RecursivelyGenerateFrameState(const WebHistoryItem& item, |
83 ExplodedFrameState* state) { | 83 ExplodedFrameState* state) { |
84 state->url_string = item.urlString(); | 84 state->url_string = item.urlString(); |
85 state->original_url_string = item.originalURLString(); | 85 state->original_url_string = item.originalURLString(); |
86 state->referrer = item.referrer(); | 86 state->referrer = item.referrer(); |
87 state->target = item.target(); | 87 state->target = item.target(); |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
196 | 196 |
197 WebHistoryItem item; | 197 WebHistoryItem item; |
198 item.initialize(); | 198 item.initialize(); |
199 if (!RecursivelyGenerateHistoryItem(state.top, &item)) | 199 if (!RecursivelyGenerateHistoryItem(state.top, &item)) |
200 return WebHistoryItem(); | 200 return WebHistoryItem(); |
201 | 201 |
202 return item; | 202 return item; |
203 } | 203 } |
204 | 204 |
205 } // namespace content | 205 } // namespace content |
OLD | NEW |