| 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 #ifndef CHROME_COMMON_COMMON_PARAM_TRAITS_H_ | 5 #ifndef CHROME_COMMON_COMMON_PARAM_TRAITS_H_ |
| 6 #define CHROME_COMMON_COMMON_PARAM_TRAITS_H_ | 6 #define CHROME_COMMON_COMMON_PARAM_TRAITS_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 // This file provides declarations of IPC serialization macros that are used |
| 10 // in more than one IPC message file. |
| 10 | 11 |
| 11 #include "chrome/common/content_settings.h" | 12 #include "chrome/common/common_param_traits_macros.h" |
| 12 #include "ipc/ipc_param_traits.h" | |
| 13 | |
| 14 class PickleIterator; | |
| 15 | |
| 16 namespace IPC { | |
| 17 | |
| 18 class Message; | |
| 19 | |
| 20 template <> | |
| 21 struct ParamTraits<ContentSetting> { | |
| 22 typedef ContentSetting param_type; | |
| 23 static void Write(Message* m, const param_type& p); | |
| 24 static bool Read(const Message* m, PickleIterator* iter, param_type* p); | |
| 25 static void Log(const param_type& p, std::string* l); | |
| 26 }; | |
| 27 | |
| 28 template <> | |
| 29 struct ParamTraits<ContentSettingsType> { | |
| 30 typedef ContentSettingsType param_type; | |
| 31 static void Write(Message* m, const param_type& p); | |
| 32 static bool Read(const Message* m, PickleIterator* iter, param_type* p); | |
| 33 static void Log(const param_type& p, std::string* l); | |
| 34 }; | |
| 35 | |
| 36 } // namespace IPC | |
| 37 | 13 |
| 38 #endif // CHROME_COMMON_COMMON_PARAM_TRAITS_H_ | 14 #endif // CHROME_COMMON_COMMON_PARAM_TRAITS_H_ |
| OLD | NEW |