| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/resource_messages.h" | 5 #include "content/common/resource_messages.h" |
| 6 | 6 |
| 7 #include "net/base/load_timing_info.h" | 7 #include "net/base/load_timing_info.h" |
| 8 #include "net/http/http_response_headers.h" | 8 #include "net/http/http_response_headers.h" |
| 9 | 9 |
| 10 namespace IPC { | 10 namespace IPC { |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 break; | 43 break; |
| 44 } | 44 } |
| 45 case webkit_common::DataElement::TYPE_FILE: { | 45 case webkit_common::DataElement::TYPE_FILE: { |
| 46 WriteParam(m, p.path()); | 46 WriteParam(m, p.path()); |
| 47 WriteParam(m, p.offset()); | 47 WriteParam(m, p.offset()); |
| 48 WriteParam(m, p.length()); | 48 WriteParam(m, p.length()); |
| 49 WriteParam(m, p.expected_modification_time()); | 49 WriteParam(m, p.expected_modification_time()); |
| 50 break; | 50 break; |
| 51 } | 51 } |
| 52 case webkit_common::DataElement::TYPE_FILE_FILESYSTEM: { | 52 case webkit_common::DataElement::TYPE_FILE_FILESYSTEM: { |
| 53 WriteParam(m, p.url()); | 53 WriteParam(m, p.filesystem_url()); |
| 54 WriteParam(m, p.offset()); | 54 WriteParam(m, p.offset()); |
| 55 WriteParam(m, p.length()); | 55 WriteParam(m, p.length()); |
| 56 WriteParam(m, p.expected_modification_time()); | 56 WriteParam(m, p.expected_modification_time()); |
| 57 break; | 57 break; |
| 58 } | 58 } |
| 59 default: { | 59 default: { |
| 60 DCHECK(p.type() == webkit_common::DataElement::TYPE_BLOB); | 60 DCHECK(p.type() == webkit_common::DataElement::TYPE_BLOB); |
| 61 WriteParam(m, p.url()); | 61 WriteParam(m, p.blob_uuid()); |
| 62 WriteParam(m, p.blob_url()); |
| 62 WriteParam(m, p.offset()); | 63 WriteParam(m, p.offset()); |
| 63 WriteParam(m, p.length()); | 64 WriteParam(m, p.length()); |
| 64 break; | 65 break; |
| 65 } | 66 } |
| 66 } | 67 } |
| 67 } | 68 } |
| 68 | 69 |
| 69 bool ParamTraits<webkit_common::DataElement>::Read( | 70 bool ParamTraits<webkit_common::DataElement>::Read( |
| 70 const Message* m, PickleIterator* iter, param_type* r) { | 71 const Message* m, PickleIterator* iter, param_type* r) { |
| 71 int type; | 72 int type; |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 if (!ReadParam(m, iter, &length)) | 108 if (!ReadParam(m, iter, &length)) |
| 108 return false; | 109 return false; |
| 109 if (!ReadParam(m, iter, &expected_modification_time)) | 110 if (!ReadParam(m, iter, &expected_modification_time)) |
| 110 return false; | 111 return false; |
| 111 r->SetToFileSystemUrlRange(file_system_url, offset, length, | 112 r->SetToFileSystemUrlRange(file_system_url, offset, length, |
| 112 expected_modification_time); | 113 expected_modification_time); |
| 113 break; | 114 break; |
| 114 } | 115 } |
| 115 default: { | 116 default: { |
| 116 DCHECK(type == webkit_common::DataElement::TYPE_BLOB); | 117 DCHECK(type == webkit_common::DataElement::TYPE_BLOB); |
| 118 std::string blob_uuid; |
| 117 GURL blob_url; | 119 GURL blob_url; |
| 118 uint64 offset, length; | 120 uint64 offset, length; |
| 121 if (!ReadParam(m, iter, &blob_uuid)) |
| 122 return false; |
| 119 if (!ReadParam(m, iter, &blob_url)) | 123 if (!ReadParam(m, iter, &blob_url)) |
| 120 return false; | 124 return false; |
| 121 if (!ReadParam(m, iter, &offset)) | 125 if (!ReadParam(m, iter, &offset)) |
| 122 return false; | 126 return false; |
| 123 if (!ReadParam(m, iter, &length)) | 127 if (!ReadParam(m, iter, &length)) |
| 124 return false; | 128 return false; |
| 125 r->SetToBlobUrlRange(blob_url, offset, length); | 129 if (!blob_uuid.empty()) |
| 130 r->SetToBlobRange(blob_uuid, offset, length); |
| 131 else |
| 132 r->SetToBlobUrlRange(blob_url, offset, length); |
| 126 break; | 133 break; |
| 127 } | 134 } |
| 128 } | 135 } |
| 129 return true; | 136 return true; |
| 130 } | 137 } |
| 131 | 138 |
| 132 void ParamTraits<webkit_common::DataElement>::Log( | 139 void ParamTraits<webkit_common::DataElement>::Log( |
| 133 const param_type& p, std::string* l) { | 140 const param_type& p, std::string* l) { |
| 134 l->append("<webkit_common::DataElement>"); | 141 l->append("<webkit_common::DataElement>"); |
| 135 } | 142 } |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 289 (*r)->set_identifier(identifier); | 296 (*r)->set_identifier(identifier); |
| 290 return true; | 297 return true; |
| 291 } | 298 } |
| 292 | 299 |
| 293 void ParamTraits<scoped_refptr<webkit_glue::ResourceRequestBody> >::Log( | 300 void ParamTraits<scoped_refptr<webkit_glue::ResourceRequestBody> >::Log( |
| 294 const param_type& p, std::string* l) { | 301 const param_type& p, std::string* l) { |
| 295 l->append("<webkit_glue::ResourceRequestBody>"); | 302 l->append("<webkit_glue::ResourceRequestBody>"); |
| 296 } | 303 } |
| 297 | 304 |
| 298 } // namespace IPC | 305 } // namespace IPC |
| OLD | NEW |