OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/render_messages.h" | 5 #include "chrome/common/render_messages.h" |
6 | 6 |
7 #include "chrome/common/content_settings_pattern_serializer.h" | 7 #include "chrome/common/content_settings_pattern_serializer.h" |
8 | 8 |
9 namespace IPC { | 9 namespace IPC { |
10 | 10 |
11 void ParamTraits<ContentSettingsPattern>::Write( | 11 void ParamTraits<ContentSettingsPattern>::Write( |
12 Message* m, const ContentSettingsPattern& pattern) { | 12 Message* m, const ContentSettingsPattern& pattern) { |
13 ContentSettingsPatternSerializer::WriteToMessage(pattern, m); | 13 ContentSettingsPatternSerializer::WriteToMessage(pattern, m); |
14 } | 14 } |
15 | 15 |
16 bool ParamTraits<ContentSettingsPattern>::Read( | 16 bool ParamTraits<ContentSettingsPattern>::Read( |
17 const Message* m, | 17 const Message* m, |
18 base::PickleIterator* iter, | 18 base::PickleIterator* iter, |
19 ContentSettingsPattern* pattern) { | 19 ContentSettingsPattern* pattern) { |
20 return ContentSettingsPatternSerializer::ReadFromMessage(m, iter, pattern); | 20 return ContentSettingsPatternSerializer::ReadFromMessage(m, iter, pattern); |
21 } | 21 } |
22 | 22 |
23 void ParamTraits<ContentSettingsPattern>::Log( | 23 void ParamTraits<ContentSettingsPattern>::Log( |
24 const ContentSettingsPattern& p, std::string* l) { | 24 const ContentSettingsPattern& p, std::string* l) { |
25 l->append("<ContentSettingsPattern: "); | 25 l->append("<ContentSettingsPattern: "); |
26 l->append(p.ToString()); | 26 l->append(p.ToString()); |
27 l->append(">"); | 27 l->append(">"); |
28 } | 28 } |
29 | 29 |
| 30 void ParamTraits<blink::WebCache::UsageStats>::Write( |
| 31 Message* m, const blink::WebCache::UsageStats& u) { |
| 32 m->WriteSizeT(u.minDeadCapacity); |
| 33 m->WriteSizeT(u.maxDeadCapacity); |
| 34 m->WriteSizeT(u.capacity); |
| 35 m->WriteSizeT(u.liveSize); |
| 36 m->WriteSizeT(u.deadSize); |
| 37 } |
| 38 |
| 39 bool ParamTraits<blink::WebCache::UsageStats>::Read( |
| 40 const Message* m, |
| 41 base::PickleIterator* iter, |
| 42 blink::WebCache::UsageStats* u) { |
| 43 return iter->ReadSizeT(&u->minDeadCapacity) && |
| 44 iter->ReadSizeT(&u->maxDeadCapacity) && |
| 45 iter->ReadSizeT(&u->capacity) && |
| 46 iter->ReadSizeT(&u->liveSize) && |
| 47 iter->ReadSizeT(&u->deadSize); |
| 48 } |
| 49 |
| 50 void ParamTraits<blink::WebCache::UsageStats>::Log( |
| 51 const blink::WebCache::UsageStats& p, std::string* l) { |
| 52 l->append("<blink::WebCache::UsageStats>"); |
| 53 } |
| 54 |
30 } // namespace IPC | 55 } // namespace IPC |
OLD | NEW |