| 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" | |
| 8 #include "chrome/common/chrome_constants.h" | 7 #include "chrome/common/chrome_constants.h" |
| 9 #include "chrome/common/content_settings.h" | 8 #include "chrome/common/content_settings.h" |
| 10 #include "chrome/common/geoposition.h" | 9 #include "chrome/common/geoposition.h" |
| 11 #include "chrome/common/thumbnail_score.h" | 10 #include "chrome/common/thumbnail_score.h" |
| 12 #include "gfx/rect.h" | 11 #include "gfx/rect.h" |
| 13 #include "googleurl/src/gurl.h" | 12 #include "googleurl/src/gurl.h" |
| 14 #include "net/base/upload_data.h" | 13 #include "net/base/upload_data.h" |
| 15 #include "printing/native_metafile.h" | 14 #include "printing/native_metafile.h" |
| 16 #include "printing/page_range.h" | 15 #include "printing/page_range.h" |
| 17 | 16 |
| (...skipping 663 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 681 return ReadParam(m, iter, &buffer) && | 680 return ReadParam(m, iter, &buffer) && |
| 682 p->Init(&buffer.front(), static_cast<uint32>(buffer.size())); | 681 p->Init(&buffer.front(), static_cast<uint32>(buffer.size())); |
| 683 #endif // defined(OS_WIN) | 682 #endif // defined(OS_WIN) |
| 684 } | 683 } |
| 685 | 684 |
| 686 void ParamTraits<printing::NativeMetafile>::Log( | 685 void ParamTraits<printing::NativeMetafile>::Log( |
| 687 const param_type& p, std::string* l) { | 686 const param_type& p, std::string* l) { |
| 688 l->append("<printing::NativeMetafile>"); | 687 l->append("<printing::NativeMetafile>"); |
| 689 } | 688 } |
| 690 | 689 |
| 691 void ParamTraits<file_util::FileInfo>::Write( | |
| 692 Message* m, const param_type& p) { | |
| 693 WriteParam(m, p.size); | |
| 694 WriteParam(m, p.is_directory); | |
| 695 WriteParam(m, p.last_modified.ToDoubleT()); | |
| 696 } | |
| 697 | |
| 698 bool ParamTraits<file_util::FileInfo>::Read( | |
| 699 const Message* m, void** iter, param_type* p) { | |
| 700 double last_modified; | |
| 701 bool result = | |
| 702 ReadParam(m, iter, &p->size) && | |
| 703 ReadParam(m, iter, &p->is_directory) && | |
| 704 ReadParam(m, iter, &last_modified); | |
| 705 if (result) | |
| 706 p->last_modified = base::Time::FromDoubleT(last_modified); | |
| 707 return result; | |
| 708 } | |
| 709 | |
| 710 void ParamTraits<file_util::FileInfo>::Log( | |
| 711 const param_type& p, std::string* l) { | |
| 712 l->append("("); | |
| 713 LogParam(p.size, l); | |
| 714 l->append(","); | |
| 715 LogParam(p.is_directory, l); | |
| 716 l->append(","); | |
| 717 LogParam(p.last_modified.ToDoubleT(), l); | |
| 718 l->append(")"); | |
| 719 } | |
| 720 | |
| 721 } // namespace IPC | 690 } // namespace IPC |
| OLD | NEW |