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

Side by Side Diff: content/common/resource_messages.cc

Issue 1288373002: [BlobAsync] Patch 2: Common Constants (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@async1
Patch Set: Created 5 years, 4 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
OLDNEW
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 24 matching lines...) Expand all
35 l->append("<HttpResponseHeaders>"); 35 l->append("<HttpResponseHeaders>");
36 } 36 }
37 37
38 void ParamTraits<storage::DataElement>::Write(Message* m, const param_type& p) { 38 void ParamTraits<storage::DataElement>::Write(Message* m, const param_type& p) {
39 WriteParam(m, static_cast<int>(p.type())); 39 WriteParam(m, static_cast<int>(p.type()));
40 switch (p.type()) { 40 switch (p.type()) {
41 case storage::DataElement::TYPE_BYTES: { 41 case storage::DataElement::TYPE_BYTES: {
42 m->WriteData(p.bytes(), static_cast<int>(p.length())); 42 m->WriteData(p.bytes(), static_cast<int>(p.length()));
43 break; 43 break;
44 } 44 }
45 case storage::DataElement::TYPE_BYTES_DESCRIPTION: {
46 WriteParam(m, p.length());
47 break;
48 }
45 case storage::DataElement::TYPE_FILE: { 49 case storage::DataElement::TYPE_FILE: {
46 WriteParam(m, p.path()); 50 WriteParam(m, p.path());
47 WriteParam(m, p.offset()); 51 WriteParam(m, p.offset());
48 WriteParam(m, p.length()); 52 WriteParam(m, p.length());
49 WriteParam(m, p.expected_modification_time()); 53 WriteParam(m, p.expected_modification_time());
50 break; 54 break;
51 } 55 }
52 case storage::DataElement::TYPE_FILE_FILESYSTEM: { 56 case storage::DataElement::TYPE_FILE_FILESYSTEM: {
53 WriteParam(m, p.filesystem_url()); 57 WriteParam(m, p.filesystem_url());
54 WriteParam(m, p.offset()); 58 WriteParam(m, p.offset());
(...skipping 26 matching lines...) Expand all
81 return false; 85 return false;
82 switch (type) { 86 switch (type) {
83 case storage::DataElement::TYPE_BYTES: { 87 case storage::DataElement::TYPE_BYTES: {
84 const char* data; 88 const char* data;
85 int len; 89 int len;
86 if (!iter->ReadData(&data, &len)) 90 if (!iter->ReadData(&data, &len))
87 return false; 91 return false;
88 r->SetToBytes(data, len); 92 r->SetToBytes(data, len);
89 break; 93 break;
90 } 94 }
95 case storage::DataElement::TYPE_BYTES_DESCRIPTION: {
96 uint64 length;
97 if (!ReadParam(m, iter, &length))
98 return false;
99 r->SetToBytesDescription(length);
100 break;
101 }
91 case storage::DataElement::TYPE_FILE: { 102 case storage::DataElement::TYPE_FILE: {
92 base::FilePath file_path; 103 base::FilePath file_path;
93 uint64 offset, length; 104 uint64 offset, length;
94 base::Time expected_modification_time; 105 base::Time expected_modification_time;
95 if (!ReadParam(m, iter, &file_path)) 106 if (!ReadParam(m, iter, &file_path))
96 return false; 107 return false;
97 if (!ReadParam(m, iter, &offset)) 108 if (!ReadParam(m, iter, &offset))
98 return false; 109 return false;
99 if (!ReadParam(m, iter, &length)) 110 if (!ReadParam(m, iter, &length))
100 return false; 111 return false;
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
307 (*r)->set_identifier(identifier); 318 (*r)->set_identifier(identifier);
308 return true; 319 return true;
309 } 320 }
310 321
311 void ParamTraits<scoped_refptr<content::ResourceRequestBody> >::Log( 322 void ParamTraits<scoped_refptr<content::ResourceRequestBody> >::Log(
312 const param_type& p, std::string* l) { 323 const param_type& p, std::string* l) {
313 l->append("<ResourceRequestBody>"); 324 l->append("<ResourceRequestBody>");
314 } 325 }
315 326
316 } // namespace IPC 327 } // namespace IPC
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698