Only grant permissions to new extensions from sync if they have the expected version
[chromium-blink-merge.git] / ui / gfx / ipc / gfx_param_traits.h
blob5bdd1d37e2ab97f9c4d0accc2e461c3015886466
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
3 // found in the LICENSE file.
5 #ifndef UI_GFX_IPC_GFX_PARAM_TRAITS_H_
6 #define UI_GFX_IPC_GFX_PARAM_TRAITS_H_
8 #include <string>
10 #include "ipc/ipc_message_utils.h"
11 #include "ipc/param_traits_macros.h"
12 #include "ui/gfx/buffer_types.h"
13 #include "ui/gfx/ipc/gfx_ipc_export.h"
14 #include "ui/gfx/ipc/gfx_param_traits_macros.h"
16 class SkBitmap;
18 namespace gfx {
19 class Point;
20 class PointF;
21 class Range;
22 class Rect;
23 class RectF;
24 class Size;
25 class SizeF;
26 class Vector2d;
27 class Vector2dF;
28 } // namespace gfx
30 namespace IPC {
32 template <>
33 struct GFX_IPC_EXPORT ParamTraits<gfx::Point> {
34 typedef gfx::Point param_type;
35 static void Write(Message* m, const param_type& p);
36 static bool Read(const Message* m, base::PickleIterator* iter, param_type* r);
37 static void Log(const param_type& p, std::string* l);
40 template <>
41 struct GFX_IPC_EXPORT ParamTraits<gfx::PointF> {
42 typedef gfx::PointF param_type;
43 static void Write(Message* m, const param_type& p);
44 static bool Read(const Message* m, base::PickleIterator* iter, param_type* r);
45 static void Log(const param_type& p, std::string* l);
48 template <>
49 struct GFX_IPC_EXPORT ParamTraits<gfx::Size> {
50 typedef gfx::Size param_type;
51 static void Write(Message* m, const param_type& p);
52 static bool Read(const Message* m, base::PickleIterator* iter, param_type* r);
53 static void Log(const param_type& p, std::string* l);
56 template <>
57 struct GFX_IPC_EXPORT ParamTraits<gfx::SizeF> {
58 typedef gfx::SizeF param_type;
59 static void Write(Message* m, const param_type& p);
60 static bool Read(const Message* m, base::PickleIterator* iter, param_type* r);
61 static void Log(const param_type& p, std::string* l);
64 template <>
65 struct GFX_IPC_EXPORT ParamTraits<gfx::Vector2d> {
66 typedef gfx::Vector2d param_type;
67 static void Write(Message* m, const param_type& p);
68 static bool Read(const Message* m, base::PickleIterator* iter, param_type* r);
69 static void Log(const param_type& p, std::string* l);
72 template <>
73 struct GFX_IPC_EXPORT ParamTraits<gfx::Vector2dF> {
74 typedef gfx::Vector2dF param_type;
75 static void Write(Message* m, const param_type& p);
76 static bool Read(const Message* m, base::PickleIterator* iter, param_type* r);
77 static void Log(const param_type& p, std::string* l);
80 template <>
81 struct GFX_IPC_EXPORT ParamTraits<gfx::Rect> {
82 typedef gfx::Rect param_type;
83 static void Write(Message* m, const param_type& p);
84 static bool Read(const Message* m, base::PickleIterator* iter, param_type* r);
85 static void Log(const param_type& p, std::string* l);
88 template <>
89 struct GFX_IPC_EXPORT ParamTraits<gfx::RectF> {
90 typedef gfx::RectF param_type;
91 static void Write(Message* m, const param_type& p);
92 static bool Read(const Message* m, base::PickleIterator* iter, param_type* r);
93 static void Log(const param_type& p, std::string* l);
96 template <>
97 struct GFX_IPC_EXPORT ParamTraits<SkBitmap> {
98 typedef SkBitmap param_type;
99 static void Write(Message* m, const param_type& p);
101 // Note: This function expects parameter |r| to be of type &SkBitmap since
102 // r->SetConfig() and r->SetPixels() are called.
103 static bool Read(const Message* m, base::PickleIterator* iter, param_type* r);
105 static void Log(const param_type& p, std::string* l);
108 template <>
109 struct GFX_IPC_EXPORT ParamTraits<gfx::Range> {
110 typedef gfx::Range param_type;
111 static void Write(Message* m, const param_type& p);
112 static bool Read(const Message* m, base::PickleIterator* iter, param_type* r);
113 static void Log(const param_type& p, std::string* l);
116 } // namespace IPC
118 #endif // UI_GFX_IPC_GFX_PARAM_TRAITS_H_