| 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 CONTENT_COMMON_INDEXED_DB_INDEXED_DB_PARAM_TRAITS_H_ | 5 #ifndef CONTENT_COMMON_INDEXED_DB_INDEXED_DB_PARAM_TRAITS_H_ |
| 6 #define CONTENT_COMMON_INDEXED_DB_INDEXED_DB_PARAM_TRAITS_H_ | 6 #define CONTENT_COMMON_INDEXED_DB_INDEXED_DB_PARAM_TRAITS_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "ipc/ipc_message.h" | 9 #include "ipc/ipc_message.h" |
| 10 #include "ipc/ipc_param_traits.h" | 10 #include "ipc/ipc_param_traits.h" |
| 11 | 11 |
| 12 class IndexedDBKey; | 12 class IndexedDBKey; |
| 13 class IndexedDBKeyRange; | 13 class IndexedDBKeyRange; |
| 14 | 14 |
| 15 namespace content { | 15 namespace content { |
| 16 class IndexedDBKeyPath; |
| 16 class SerializedScriptValue; | 17 class SerializedScriptValue; |
| 17 } | 18 } |
| 18 | 19 |
| 19 namespace IPC { | 20 namespace IPC { |
| 20 | 21 |
| 21 // These datatypes are used by utility_messages.h and render_messages.h. | 22 // These datatypes are used by utility_messages.h and render_messages.h. |
| 22 // Unfortunately we can't move it to common: MSVC linker complains about | 23 // Unfortunately we can't move it to common: MSVC linker complains about |
| 23 // WebKit datatypes that are not linked on npchrome_frame (even though it's | 24 // WebKit datatypes that are not linked on npchrome_frame (even though it's |
| 24 // never actually used by that target). | 25 // never actually used by that target). |
| 25 | 26 |
| 26 template <> | 27 template <> |
| 27 struct ParamTraits<content::SerializedScriptValue> { | 28 struct ParamTraits<content::SerializedScriptValue> { |
| 28 typedef content::SerializedScriptValue param_type; | 29 typedef content::SerializedScriptValue param_type; |
| 29 static void Write(Message* m, const param_type& p); | 30 static void Write(Message* m, const param_type& p); |
| 30 static bool Read(const Message* m, PickleIterator* iter, param_type* r); | 31 static bool Read(const Message* m, PickleIterator* iter, param_type* r); |
| 31 static void Log(const param_type& p, std::string* l); | 32 static void Log(const param_type& p, std::string* l); |
| 32 }; | 33 }; |
| 33 | 34 |
| 34 template <> | 35 template <> |
| 35 struct ParamTraits<IndexedDBKey> { | 36 struct ParamTraits<IndexedDBKey> { |
| 36 typedef IndexedDBKey param_type; | 37 typedef IndexedDBKey param_type; |
| 37 static void Write(Message* m, const param_type& p); | 38 static void Write(Message* m, const param_type& p); |
| 38 static bool Read(const Message* m, PickleIterator* iter, param_type* r); | 39 static bool Read(const Message* m, PickleIterator* iter, param_type* r); |
| 39 static void Log(const param_type& p, std::string* l); | 40 static void Log(const param_type& p, std::string* l); |
| 40 }; | 41 }; |
| 41 | 42 |
| 42 template <> | 43 template <> |
| 44 struct ParamTraits<content::IndexedDBKeyPath> { |
| 45 typedef content::IndexedDBKeyPath param_type; |
| 46 static void Write(Message* m, const param_type& p); |
| 47 static bool Read(const Message* m, PickleIterator* iter, param_type* r); |
| 48 static void Log(const param_type& p, std::string* l); |
| 49 }; |
| 50 |
| 51 template <> |
| 43 struct ParamTraits<IndexedDBKeyRange> { | 52 struct ParamTraits<IndexedDBKeyRange> { |
| 44 typedef IndexedDBKeyRange param_type; | 53 typedef IndexedDBKeyRange param_type; |
| 45 static void Write(Message* m, const param_type& p); | 54 static void Write(Message* m, const param_type& p); |
| 46 static bool Read(const Message* m, PickleIterator* iter, param_type* r); | 55 static bool Read(const Message* m, PickleIterator* iter, param_type* r); |
| 47 static void Log(const param_type& p, std::string* l); | 56 static void Log(const param_type& p, std::string* l); |
| 48 }; | 57 }; |
| 49 | 58 |
| 50 } // namespace IPC | 59 } // namespace IPC |
| 51 | 60 |
| 52 #endif // CONTENT_COMMON_INDEXED_DB_INDEXED_DB_PARAM_TRAITS_H_ | 61 #endif // CONTENT_COMMON_INDEXED_DB_INDEXED_DB_PARAM_TRAITS_H_ |
| OLD | NEW |