OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/common_param_traits.h" | 5 #include "content/common/common_param_traits.h" |
6 | 6 |
7 #include "content/common/content_constants.h" | 7 #include "content/common/content_constants.h" |
8 #include "net/base/host_port_pair.h" | 8 #include "net/base/host_port_pair.h" |
9 #include "net/base/upload_data.h" | 9 #include "net/base/upload_data.h" |
10 #include "net/http/http_response_headers.h" | 10 #include "net/http/http_response_headers.h" |
(...skipping 491 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
502 l->append(")"); | 502 l->append(")"); |
503 } | 503 } |
504 | 504 |
505 void ParamTraits<base::PlatformFileInfo>::Write( | 505 void ParamTraits<base::PlatformFileInfo>::Write( |
506 Message* m, const param_type& p) { | 506 Message* m, const param_type& p) { |
507 WriteParam(m, p.size); | 507 WriteParam(m, p.size); |
508 WriteParam(m, p.is_directory); | 508 WriteParam(m, p.is_directory); |
509 WriteParam(m, p.last_modified.ToDoubleT()); | 509 WriteParam(m, p.last_modified.ToDoubleT()); |
510 WriteParam(m, p.last_accessed.ToDoubleT()); | 510 WriteParam(m, p.last_accessed.ToDoubleT()); |
511 WriteParam(m, p.creation_time.ToDoubleT()); | 511 WriteParam(m, p.creation_time.ToDoubleT()); |
| 512 WriteParam(m, p.path); |
512 } | 513 } |
513 | 514 |
514 bool ParamTraits<base::PlatformFileInfo>::Read( | 515 bool ParamTraits<base::PlatformFileInfo>::Read( |
515 const Message* m, void** iter, param_type* p) { | 516 const Message* m, void** iter, param_type* p) { |
516 double last_modified; | 517 double last_modified; |
517 double last_accessed; | 518 double last_accessed; |
518 double creation_time; | 519 double creation_time; |
519 bool result = | 520 bool result = |
520 ReadParam(m, iter, &p->size) && | 521 ReadParam(m, iter, &p->size) && |
521 ReadParam(m, iter, &p->is_directory) && | 522 ReadParam(m, iter, &p->is_directory) && |
522 ReadParam(m, iter, &last_modified) && | 523 ReadParam(m, iter, &last_modified) && |
523 ReadParam(m, iter, &last_accessed) && | 524 ReadParam(m, iter, &last_accessed) && |
524 ReadParam(m, iter, &creation_time); | 525 ReadParam(m, iter, &creation_time) && |
| 526 ReadParam(m, iter, &p->path); |
525 if (result) { | 527 if (result) { |
526 p->last_modified = base::Time::FromDoubleT(last_modified); | 528 p->last_modified = base::Time::FromDoubleT(last_modified); |
527 p->last_accessed = base::Time::FromDoubleT(last_accessed); | 529 p->last_accessed = base::Time::FromDoubleT(last_accessed); |
528 p->creation_time = base::Time::FromDoubleT(creation_time); | 530 p->creation_time = base::Time::FromDoubleT(creation_time); |
529 } | 531 } |
530 return result; | 532 return result; |
531 } | 533 } |
532 | 534 |
533 void ParamTraits<base::PlatformFileInfo>::Log( | 535 void ParamTraits<base::PlatformFileInfo>::Log( |
534 const param_type& p, std::string* l) { | 536 const param_type& p, std::string* l) { |
535 l->append("("); | 537 l->append("("); |
536 LogParam(p.size, l); | 538 LogParam(p.size, l); |
537 l->append(","); | 539 l->append(","); |
538 LogParam(p.is_directory, l); | 540 LogParam(p.is_directory, l); |
539 l->append(","); | 541 l->append(","); |
540 LogParam(p.last_modified.ToDoubleT(), l); | 542 LogParam(p.last_modified.ToDoubleT(), l); |
541 l->append(","); | 543 l->append(","); |
542 LogParam(p.last_accessed.ToDoubleT(), l); | 544 LogParam(p.last_accessed.ToDoubleT(), l); |
543 l->append(","); | 545 l->append(","); |
544 LogParam(p.creation_time.ToDoubleT(), l); | 546 LogParam(p.creation_time.ToDoubleT(), l); |
| 547 l->append(","); |
| 548 LogParam(p.path, l); |
545 l->append(")"); | 549 l->append(")"); |
546 } | 550 } |
547 | 551 |
548 void ParamTraits<gfx::Point>::Write(Message* m, const gfx::Point& p) { | 552 void ParamTraits<gfx::Point>::Write(Message* m, const gfx::Point& p) { |
549 m->WriteInt(p.x()); | 553 m->WriteInt(p.x()); |
550 m->WriteInt(p.y()); | 554 m->WriteInt(p.y()); |
551 } | 555 } |
552 | 556 |
553 bool ParamTraits<gfx::Point>::Read(const Message* m, void** iter, | 557 bool ParamTraits<gfx::Point>::Read(const Message* m, void** iter, |
554 gfx::Point* r) { | 558 gfx::Point* r) { |
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
830 const SkBitmap_Data* bmp_data = | 834 const SkBitmap_Data* bmp_data = |
831 reinterpret_cast<const SkBitmap_Data*>(fixed_data); | 835 reinterpret_cast<const SkBitmap_Data*>(fixed_data); |
832 return bmp_data->InitSkBitmapFromData(r, variable_data, variable_data_size); | 836 return bmp_data->InitSkBitmapFromData(r, variable_data, variable_data_size); |
833 } | 837 } |
834 | 838 |
835 void ParamTraits<SkBitmap>::Log(const SkBitmap& p, std::string* l) { | 839 void ParamTraits<SkBitmap>::Log(const SkBitmap& p, std::string* l) { |
836 l->append("<SkBitmap>"); | 840 l->append("<SkBitmap>"); |
837 } | 841 } |
838 | 842 |
839 } // namespace IPC | 843 } // namespace IPC |
OLD | NEW |