OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #include "ppapi/proxy/ppb_graphics_2d_proxy.h" | 5 #include "ppapi/proxy/ppb_graphics_2d_proxy.h" |
6 | 6 |
7 #include <string.h> // For memset. | 7 #include <string.h> // For memset. |
8 | 8 |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 } | 159 } |
160 | 160 |
161 const void* PPB_Graphics2D_Proxy::GetSourceInterface() const { | 161 const void* PPB_Graphics2D_Proxy::GetSourceInterface() const { |
162 return &ppb_graphics_2d; | 162 return &ppb_graphics_2d; |
163 } | 163 } |
164 | 164 |
165 InterfaceID PPB_Graphics2D_Proxy::GetInterfaceId() const { | 165 InterfaceID PPB_Graphics2D_Proxy::GetInterfaceId() const { |
166 return INTERFACE_ID_PPB_GRAPHICS_2D; | 166 return INTERFACE_ID_PPB_GRAPHICS_2D; |
167 } | 167 } |
168 | 168 |
169 void PPB_Graphics2D_Proxy::OnMessageReceived(const IPC::Message& msg) { | 169 bool PPB_Graphics2D_Proxy::OnMessageReceived(const IPC::Message& msg) { |
| 170 bool handled = true; |
170 IPC_BEGIN_MESSAGE_MAP(PPB_Graphics2D_Proxy, msg) | 171 IPC_BEGIN_MESSAGE_MAP(PPB_Graphics2D_Proxy, msg) |
171 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBGraphics2D_Create, | 172 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBGraphics2D_Create, |
172 OnMsgCreate) | 173 OnMsgCreate) |
173 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBGraphics2D_PaintImageData, | 174 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBGraphics2D_PaintImageData, |
174 OnMsgPaintImageData) | 175 OnMsgPaintImageData) |
175 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBGraphics2D_Scroll, | 176 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBGraphics2D_Scroll, |
176 OnMsgScroll) | 177 OnMsgScroll) |
177 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBGraphics2D_ReplaceContents, | 178 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBGraphics2D_ReplaceContents, |
178 OnMsgReplaceContents) | 179 OnMsgReplaceContents) |
179 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBGraphics2D_Flush, | 180 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBGraphics2D_Flush, |
180 OnMsgFlush) | 181 OnMsgFlush) |
181 | 182 |
182 IPC_MESSAGE_HANDLER(PpapiMsg_PPBGraphics2D_FlushACK, | 183 IPC_MESSAGE_HANDLER(PpapiMsg_PPBGraphics2D_FlushACK, |
183 OnMsgFlushACK) | 184 OnMsgFlushACK) |
| 185 IPC_MESSAGE_UNHANDLED(handled = false) |
184 IPC_END_MESSAGE_MAP() | 186 IPC_END_MESSAGE_MAP() |
185 // FIXME(brettw) handle bad messages! | 187 // FIXME(brettw) handle bad messages! |
| 188 return handled; |
186 } | 189 } |
187 | 190 |
188 void PPB_Graphics2D_Proxy::OnMsgCreate(PP_Module module, | 191 void PPB_Graphics2D_Proxy::OnMsgCreate(PP_Module module, |
189 const PP_Size& size, | 192 const PP_Size& size, |
190 PP_Bool is_always_opaque, | 193 PP_Bool is_always_opaque, |
191 PP_Resource* result) { | 194 PP_Resource* result) { |
192 *result = ppb_graphics_2d_target()->Create( | 195 *result = ppb_graphics_2d_target()->Create( |
193 module, &size, is_always_opaque); | 196 module, &size, is_always_opaque); |
194 } | 197 } |
195 | 198 |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
247 } | 250 } |
248 | 251 |
249 void PPB_Graphics2D_Proxy::SendFlushACKToPlugin(int32_t result, | 252 void PPB_Graphics2D_Proxy::SendFlushACKToPlugin(int32_t result, |
250 PP_Resource graphics_2d) { | 253 PP_Resource graphics_2d) { |
251 dispatcher()->Send(new PpapiMsg_PPBGraphics2D_FlushACK( | 254 dispatcher()->Send(new PpapiMsg_PPBGraphics2D_FlushACK( |
252 INTERFACE_ID_PPB_GRAPHICS_2D, graphics_2d, result)); | 255 INTERFACE_ID_PPB_GRAPHICS_2D, graphics_2d, result)); |
253 } | 256 } |
254 | 257 |
255 } // namespace proxy | 258 } // namespace proxy |
256 } // namespace pp | 259 } // namespace pp |
OLD | NEW |