Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_MEDIA_MEDIA_PARAM_TRAITS_H_ | 5 #ifndef UI_GFX_IPC_GFX_SKIA_PARAM_TRAITS_H_ |
| 6 #define CONTENT_COMMON_MEDIA_MEDIA_PARAM_TRAITS_H_ | 6 #define UI_GFX_IPC_GFX_SKIA_PARAM_TRAITS_H_ |
| 7 | 7 |
| 8 #include "content/common/content_export.h" | 8 #include <string> |
| 9 #include "ipc/ipc_message.h" | 9 |
| 10 #include "ipc/ipc_message_utils.h" | |
| 10 #include "ipc/ipc_param_traits.h" | 11 #include "ipc/ipc_param_traits.h" |
| 12 #include "ui/gfx/ipc/skia/gfx_skia_ipc_export.h" | |
| 11 | 13 |
| 12 namespace media { | 14 class SkBitmap; |
| 13 class AudioParameters; | 15 |
| 14 struct VideoCaptureFormat; | 16 namespace base { |
| 17 class Pickle; | |
| 18 class PickleIterator; | |
| 19 } | |
| 20 | |
| 21 namespace gfx { | |
| 22 class Transform; | |
| 15 } | 23 } |
| 16 | 24 |
| 17 namespace IPC { | 25 namespace IPC { |
| 18 | 26 |
| 19 template <> | 27 template <> |
| 20 struct CONTENT_EXPORT ParamTraits<media::AudioParameters> { | 28 struct GFX_SKIA_IPC_EXPORT ParamTraits<SkBitmap> { |
| 21 typedef media::AudioParameters param_type; | 29 using param_type = SkBitmap; |
| 22 static void Write(base::Pickle* m, const param_type& p); | 30 static void Write(base::Pickle* m, const param_type& p); |
| 23 static bool Read(const base::Pickle* m, | 31 static bool Read(const base::Pickle* m, |
| 24 base::PickleIterator* iter, | 32 base::PickleIterator* iter, |
| 25 param_type* r); | 33 param_type* r); |
| 26 static void Log(const param_type& p, std::string* l); | 34 static void Log(const param_type& p, std::string* l); |
| 27 }; | 35 }; |
| 28 | 36 |
| 29 template <> | 37 template <> |
| 30 struct CONTENT_EXPORT ParamTraits<media::VideoCaptureFormat> { | 38 struct GFX_SKIA_IPC_EXPORT ParamTraits<gfx::Transform> { |
| 31 typedef media::VideoCaptureFormat param_type; | 39 typedef gfx::Transform param_type; |
|
Tom Sepez
2016/03/31 16:01:34
nit: use "using" while we're at it.
Mark Dittmer
2016/03/31 16:21:29
Done.
| |
| 32 static void Write(base::Pickle* m, const param_type& p); | 40 static void Write(base::Pickle* m, const param_type& p); |
| 33 static bool Read(const base::Pickle* m, | 41 static bool Read(const base::Pickle* m, |
| 34 base::PickleIterator* iter, | 42 base::PickleIterator* iter, |
| 35 param_type* r); | 43 param_type* r); |
| 36 static void Log(const param_type& p, std::string* l); | 44 static void Log(const param_type& p, std::string* l); |
| 37 }; | 45 }; |
| 38 | 46 |
| 39 } // namespace IPC | 47 } // namespace IPC |
| 40 | 48 |
| 41 #endif // CONTENT_COMMON_MEDIA_MEDIA_PARAM_TRAITS_H_ | 49 #endif // UI_GFX_IPC_GFX_SKIA_PARAM_TRAITS_H_ |
| OLD | NEW |