| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 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 UI_GFX_IPC_GFX_PARAM_TRAITS_H_ | 5 #ifndef UI_GFX_IPC_GFX_PARAM_TRAITS_H_ |
| 6 #define UI_GFX_IPC_GFX_PARAM_TRAITS_H_ | 6 #define UI_GFX_IPC_GFX_PARAM_TRAITS_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "ipc/ipc_message_utils.h" | 10 #include "ipc/ipc_message_utils.h" |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 struct GFX_IPC_EXPORT ParamTraits<gfx::RectF> { | 103 struct GFX_IPC_EXPORT ParamTraits<gfx::RectF> { |
| 104 typedef gfx::RectF param_type; | 104 typedef gfx::RectF param_type; |
| 105 static void Write(Message* m, const param_type& p); | 105 static void Write(Message* m, const param_type& p); |
| 106 static bool Read(const Message* m, base::PickleIterator* iter, param_type* r); | 106 static bool Read(const Message* m, base::PickleIterator* iter, param_type* r); |
| 107 static void Log(const param_type& p, std::string* l); | 107 static void Log(const param_type& p, std::string* l); |
| 108 }; | 108 }; |
| 109 | 109 |
| 110 template <> | 110 template <> |
| 111 struct GFX_IPC_EXPORT ParamTraits<SkBitmap> { | 111 struct GFX_IPC_EXPORT ParamTraits<SkBitmap> { |
| 112 typedef SkBitmap param_type; | 112 typedef SkBitmap param_type; |
| 113 static void Write(Message* m, const param_type& p); | 113 static size_t GetSize(const param_type& p); |
| 114 static void Write(base::Pickle* m, const param_type& p); |
| 114 | 115 |
| 115 // Note: This function expects parameter |r| to be of type &SkBitmap since | 116 // Note: This function expects parameter |r| to be of type &SkBitmap since |
| 116 // r->SetConfig() and r->SetPixels() are called. | 117 // r->SetConfig() and r->SetPixels() are called. |
| 117 static bool Read(const Message* m, base::PickleIterator* iter, param_type* r); | 118 static bool Read(const base::Pickle* m, |
| 119 base::PickleIterator* iter, |
| 120 param_type* r); |
| 118 | 121 |
| 119 static void Log(const param_type& p, std::string* l); | 122 static void Log(const param_type& p, std::string* l); |
| 120 }; | 123 }; |
| 121 | 124 |
| 122 template <> | 125 template <> |
| 123 struct GFX_IPC_EXPORT ParamTraits<gfx::Range> { | 126 struct GFX_IPC_EXPORT ParamTraits<gfx::Range> { |
| 124 typedef gfx::Range param_type; | 127 typedef gfx::Range param_type; |
| 125 static void Write(Message* m, const param_type& p); | 128 static void Write(Message* m, const param_type& p); |
| 126 static bool Read(const Message* m, base::PickleIterator* iter, param_type* r); | 129 static bool Read(const Message* m, base::PickleIterator* iter, param_type* r); |
| 127 static void Log(const param_type& p, std::string* l); | 130 static void Log(const param_type& p, std::string* l); |
| (...skipping 17 matching lines...) Expand all Loading... |
| 145 // called once for a given message, otherwise the singular right will be | 148 // called once for a given message, otherwise the singular right will be |
| 146 // managed and released by two objects. | 149 // managed and released by two objects. |
| 147 static bool Read(const Message* m, base::PickleIterator* iter, param_type* r); | 150 static bool Read(const Message* m, base::PickleIterator* iter, param_type* r); |
| 148 static void Log(const param_type& p, std::string* l); | 151 static void Log(const param_type& p, std::string* l); |
| 149 }; | 152 }; |
| 150 #endif // defined(OS_MACOSX) && !defined(OS_IOS) | 153 #endif // defined(OS_MACOSX) && !defined(OS_IOS) |
| 151 | 154 |
| 152 } // namespace IPC | 155 } // namespace IPC |
| 153 | 156 |
| 154 #endif // UI_GFX_IPC_GFX_PARAM_TRAITS_H_ | 157 #endif // UI_GFX_IPC_GFX_PARAM_TRAITS_H_ |
| OLD | NEW |