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 492 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
503 l->append(")"); | 503 l->append(")"); |
504 } | 504 } |
505 | 505 |
506 void ParamTraits<base::PlatformFileInfo>::Write( | 506 void ParamTraits<base::PlatformFileInfo>::Write( |
507 Message* m, const param_type& p) { | 507 Message* m, const param_type& p) { |
508 WriteParam(m, p.size); | 508 WriteParam(m, p.size); |
509 WriteParam(m, p.is_directory); | 509 WriteParam(m, p.is_directory); |
510 WriteParam(m, p.last_modified.ToDoubleT()); | 510 WriteParam(m, p.last_modified.ToDoubleT()); |
511 WriteParam(m, p.last_accessed.ToDoubleT()); | 511 WriteParam(m, p.last_accessed.ToDoubleT()); |
512 WriteParam(m, p.creation_time.ToDoubleT()); | 512 WriteParam(m, p.creation_time.ToDoubleT()); |
513 WriteParam(m, p.path); | |
514 } | 513 } |
515 | 514 |
516 bool ParamTraits<base::PlatformFileInfo>::Read( | 515 bool ParamTraits<base::PlatformFileInfo>::Read( |
517 const Message* m, void** iter, param_type* p) { | 516 const Message* m, void** iter, param_type* p) { |
518 double last_modified; | 517 double last_modified; |
519 double last_accessed; | 518 double last_accessed; |
520 double creation_time; | 519 double creation_time; |
521 bool result = | 520 bool result = |
522 ReadParam(m, iter, &p->size) && | 521 ReadParam(m, iter, &p->size) && |
523 ReadParam(m, iter, &p->is_directory) && | 522 ReadParam(m, iter, &p->is_directory) && |
524 ReadParam(m, iter, &last_modified) && | 523 ReadParam(m, iter, &last_modified) && |
525 ReadParam(m, iter, &last_accessed) && | 524 ReadParam(m, iter, &last_accessed) && |
526 ReadParam(m, iter, &creation_time) && | 525 ReadParam(m, iter, &creation_time); |
527 ReadParam(m, iter, &p->path); | |
528 if (result) { | 526 if (result) { |
529 p->last_modified = base::Time::FromDoubleT(last_modified); | 527 p->last_modified = base::Time::FromDoubleT(last_modified); |
530 p->last_accessed = base::Time::FromDoubleT(last_accessed); | 528 p->last_accessed = base::Time::FromDoubleT(last_accessed); |
531 p->creation_time = base::Time::FromDoubleT(creation_time); | 529 p->creation_time = base::Time::FromDoubleT(creation_time); |
532 } | 530 } |
533 return result; | 531 return result; |
534 } | 532 } |
535 | 533 |
536 void ParamTraits<base::PlatformFileInfo>::Log( | 534 void ParamTraits<base::PlatformFileInfo>::Log( |
537 const param_type& p, std::string* l) { | 535 const param_type& p, std::string* l) { |
538 l->append("("); | 536 l->append("("); |
539 LogParam(p.size, l); | 537 LogParam(p.size, l); |
540 l->append(","); | 538 l->append(","); |
541 LogParam(p.is_directory, l); | 539 LogParam(p.is_directory, l); |
542 l->append(","); | 540 l->append(","); |
543 LogParam(p.last_modified.ToDoubleT(), l); | 541 LogParam(p.last_modified.ToDoubleT(), l); |
544 l->append(","); | 542 l->append(","); |
545 LogParam(p.last_accessed.ToDoubleT(), l); | 543 LogParam(p.last_accessed.ToDoubleT(), l); |
546 l->append(","); | 544 l->append(","); |
547 LogParam(p.creation_time.ToDoubleT(), l); | 545 LogParam(p.creation_time.ToDoubleT(), l); |
548 l->append(","); | |
549 LogParam(p.path, l); | |
550 l->append(")"); | 546 l->append(")"); |
551 } | 547 } |
552 | 548 |
553 void ParamTraits<gfx::Point>::Write(Message* m, const gfx::Point& p) { | 549 void ParamTraits<gfx::Point>::Write(Message* m, const gfx::Point& p) { |
554 m->WriteInt(p.x()); | 550 m->WriteInt(p.x()); |
555 m->WriteInt(p.y()); | 551 m->WriteInt(p.y()); |
556 } | 552 } |
557 | 553 |
558 bool ParamTraits<gfx::Point>::Read(const Message* m, void** iter, | 554 bool ParamTraits<gfx::Point>::Read(const Message* m, void** iter, |
559 gfx::Point* r) { | 555 gfx::Point* r) { |
(...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
874 ReadParam(m, iter, &p->ssl_valid) && | 870 ReadParam(m, iter, &p->ssl_valid) && |
875 ReadParam(m, iter, &p->preferred) && | 871 ReadParam(m, iter, &p->preferred) && |
876 ReadParam(m, iter, &p->blacklisted_by_user); | 872 ReadParam(m, iter, &p->blacklisted_by_user); |
877 } | 873 } |
878 void ParamTraits<webkit_glue::PasswordForm>::Log(const param_type& p, | 874 void ParamTraits<webkit_glue::PasswordForm>::Log(const param_type& p, |
879 std::string* l) { | 875 std::string* l) { |
880 l->append("<PasswordForm>"); | 876 l->append("<PasswordForm>"); |
881 } | 877 } |
882 | 878 |
883 } // namespace IPC | 879 } // namespace IPC |
OLD | NEW |