OLD | NEW |
1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2014 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 #ifndef CHROME_COMMON_CONTENT_SETTINGS_PATTERN_SERIALIZER_H_ | 5 #ifndef CHROME_COMMON_CONTENT_SETTINGS_PATTERN_SERIALIZER_H_ |
6 #define CHROME_COMMON_CONTENT_SETTINGS_PATTERN_SERIALIZER_H_ | 6 #define CHROME_COMMON_CONTENT_SETTINGS_PATTERN_SERIALIZER_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 | 9 |
| 10 namespace base { |
| 11 class PickleIterator; |
| 12 } |
| 13 |
10 namespace IPC { | 14 namespace IPC { |
11 class Message; | 15 class Message; |
12 } | 16 } |
13 | 17 |
14 class ContentSettingsPattern; | 18 class ContentSettingsPattern; |
15 class PickleIterator; | |
16 | 19 |
17 class ContentSettingsPatternSerializer { | 20 class ContentSettingsPatternSerializer { |
18 public: | 21 public: |
19 // Serializes the pattern to an IPC message. | 22 // Serializes the pattern to an IPC message. |
20 static void WriteToMessage(const ContentSettingsPattern& pattern, | 23 static void WriteToMessage(const ContentSettingsPattern& pattern, |
21 IPC::Message* m); | 24 IPC::Message* m); |
22 // Deserializes the pattern from the IPC message. | 25 // Deserializes the pattern from the IPC message. |
23 static bool ReadFromMessage(const IPC::Message* m, PickleIterator* iter, | 26 static bool ReadFromMessage(const IPC::Message* m, |
| 27 base::PickleIterator* iter, |
24 ContentSettingsPattern* pattern); | 28 ContentSettingsPattern* pattern); |
25 | 29 |
26 private: | 30 private: |
27 DISALLOW_IMPLICIT_CONSTRUCTORS(ContentSettingsPatternSerializer); | 31 DISALLOW_IMPLICIT_CONSTRUCTORS(ContentSettingsPatternSerializer); |
28 }; | 32 }; |
29 | 33 |
30 #endif // CHROME_COMMON_CONTENT_SETTINGS_PATTERN_SERIALIZER_H_ | 34 #endif // CHROME_COMMON_CONTENT_SETTINGS_PATTERN_SERIALIZER_H_ |
OLD | NEW |