| 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 "chrome/common/chrome_constants.h" | 8 #include "chrome/common/chrome_constants.h" |
| 8 #include "chrome/common/content_settings.h" | 9 #include "chrome/common/content_settings.h" |
| 9 #include "chrome/common/geoposition.h" | 10 #include "chrome/common/geoposition.h" |
| 10 #include "chrome/common/thumbnail_score.h" | 11 #include "chrome/common/thumbnail_score.h" |
| 11 #include "gfx/rect.h" | 12 #include "gfx/rect.h" |
| 12 #include "googleurl/src/gurl.h" | 13 #include "googleurl/src/gurl.h" |
| 13 #include "net/base/upload_data.h" | 14 #include "net/base/upload_data.h" |
| 14 #include "printing/native_metafile.h" | 15 #include "printing/native_metafile.h" |
| 15 #include "printing/page_range.h" | 16 #include "printing/page_range.h" |
| 16 | 17 |
| (...skipping 555 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 572 return ReadParam(m, iter, &buffer) && | 573 return ReadParam(m, iter, &buffer) && |
| 573 p->Init(&buffer.front(), static_cast<uint32>(buffer.size())); | 574 p->Init(&buffer.front(), static_cast<uint32>(buffer.size())); |
| 574 #endif // defined(OS_WIN) | 575 #endif // defined(OS_WIN) |
| 575 } | 576 } |
| 576 | 577 |
| 577 void ParamTraits<printing::NativeMetafile>::Log( | 578 void ParamTraits<printing::NativeMetafile>::Log( |
| 578 const param_type& p, std::string* l) { | 579 const param_type& p, std::string* l) { |
| 579 l->append("<printing::NativeMetafile>"); | 580 l->append("<printing::NativeMetafile>"); |
| 580 } | 581 } |
| 581 | 582 |
| 583 void ParamTraits<file_util::FileInfo>::Write( |
| 584 Message* m, const param_type& p) { |
| 585 WriteParam(m, p.size); |
| 586 WriteParam(m, p.is_directory); |
| 587 WriteParam(m, p.last_modified.ToDoubleT()); |
| 588 } |
| 589 |
| 590 bool ParamTraits<file_util::FileInfo>::Read( |
| 591 const Message* m, void** iter, param_type* p) { |
| 592 double last_modified; |
| 593 bool result = |
| 594 ReadParam(m, iter, &p->size) && |
| 595 ReadParam(m, iter, &p->is_directory) && |
| 596 ReadParam(m, iter, &last_modified); |
| 597 if (result) |
| 598 p->last_modified = base::Time::FromDoubleT(last_modified); |
| 599 return result; |
| 600 } |
| 601 |
| 602 void ParamTraits<file_util::FileInfo>::Log( |
| 603 const param_type& p, std::string* l) { |
| 604 l->append("("); |
| 605 LogParam(p.size, l); |
| 606 l->append(","); |
| 607 LogParam(p.is_directory, l); |
| 608 l->append(","); |
| 609 LogParam(p.last_modified.ToDoubleT(), l); |
| 610 l->append(")"); |
| 611 } |
| 612 |
| 582 } // namespace IPC | 613 } // namespace IPC |
| OLD | NEW |