OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "chrome/common/common_param_traits.h" | 5 #include "chrome/common/common_param_traits.h" |
6 | 6 |
7 #include "base/time.h" | 7 #include "base/time.h" |
8 #include "chrome/common/chrome_constants.h" | 8 #include "chrome/common/chrome_constants.h" |
9 #include "chrome/common/content_settings.h" | 9 #include "chrome/common/content_settings.h" |
10 #include "chrome/common/geoposition.h" | 10 #include "chrome/common/geoposition.h" |
(...skipping 670 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
681 return ReadParam(m, iter, &buffer) && | 681 return ReadParam(m, iter, &buffer) && |
682 p->Init(&buffer.front(), static_cast<uint32>(buffer.size())); | 682 p->Init(&buffer.front(), static_cast<uint32>(buffer.size())); |
683 #endif // defined(OS_WIN) | 683 #endif // defined(OS_WIN) |
684 } | 684 } |
685 | 685 |
686 void ParamTraits<printing::NativeMetafile>::Log( | 686 void ParamTraits<printing::NativeMetafile>::Log( |
687 const param_type& p, std::string* l) { | 687 const param_type& p, std::string* l) { |
688 l->append("<printing::NativeMetafile>"); | 688 l->append("<printing::NativeMetafile>"); |
689 } | 689 } |
690 | 690 |
691 void ParamTraits<file_util::FileInfo>::Write( | 691 void ParamTraits<base::PlatformFileInfo>::Write( |
692 Message* m, const param_type& p) { | 692 Message* m, const param_type& p) { |
693 WriteParam(m, p.size); | 693 WriteParam(m, p.size); |
694 WriteParam(m, p.is_directory); | 694 WriteParam(m, p.is_directory); |
695 WriteParam(m, p.last_modified.ToDoubleT()); | 695 WriteParam(m, p.last_modified.ToDoubleT()); |
| 696 WriteParam(m, p.last_accessed.ToDoubleT()); |
| 697 WriteParam(m, p.creation_time.ToDoubleT()); |
696 } | 698 } |
697 | 699 |
698 bool ParamTraits<file_util::FileInfo>::Read( | 700 bool ParamTraits<base::PlatformFileInfo>::Read( |
699 const Message* m, void** iter, param_type* p) { | 701 const Message* m, void** iter, param_type* p) { |
700 double last_modified; | 702 double last_modified; |
| 703 double last_accessed; |
| 704 double creation_time; |
701 bool result = | 705 bool result = |
702 ReadParam(m, iter, &p->size) && | 706 ReadParam(m, iter, &p->size) && |
703 ReadParam(m, iter, &p->is_directory) && | 707 ReadParam(m, iter, &p->is_directory) && |
704 ReadParam(m, iter, &last_modified); | 708 ReadParam(m, iter, &last_modified) && |
705 if (result) | 709 ReadParam(m, iter, &last_accessed) && |
| 710 ReadParam(m, iter, &creation_time); |
| 711 if (result) { |
706 p->last_modified = base::Time::FromDoubleT(last_modified); | 712 p->last_modified = base::Time::FromDoubleT(last_modified); |
| 713 p->last_accessed = base::Time::FromDoubleT(last_accessed); |
| 714 p->creation_time = base::Time::FromDoubleT(creation_time); |
| 715 } |
707 return result; | 716 return result; |
708 } | 717 } |
709 | 718 |
710 void ParamTraits<file_util::FileInfo>::Log( | 719 void ParamTraits<base::PlatformFileInfo>::Log( |
711 const param_type& p, std::string* l) { | 720 const param_type& p, std::string* l) { |
712 l->append("("); | 721 l->append("("); |
713 LogParam(p.size, l); | 722 LogParam(p.size, l); |
714 l->append(","); | 723 l->append(","); |
715 LogParam(p.is_directory, l); | 724 LogParam(p.is_directory, l); |
716 l->append(","); | 725 l->append(","); |
717 LogParam(p.last_modified.ToDoubleT(), l); | 726 LogParam(p.last_modified.ToDoubleT(), l); |
| 727 l->append(","); |
| 728 LogParam(p.last_accessed.ToDoubleT(), l); |
| 729 l->append(","); |
| 730 LogParam(p.creation_time.ToDoubleT(), l); |
718 l->append(")"); | 731 l->append(")"); |
719 } | 732 } |
720 | 733 |
721 } // namespace IPC | 734 } // namespace IPC |
OLD | NEW |