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_testing_proxy.h" | 5 #include "ppapi/proxy/ppb_testing_proxy.h" |
6 | 6 |
7 #include "base/message_loop.h" | 7 #include "base/message_loop.h" |
8 #include "ppapi/c/dev/ppb_testing_dev.h" | 8 #include "ppapi/c/dev/ppb_testing_dev.h" |
9 #include "ppapi/proxy/plugin_dispatcher.h" | 9 #include "ppapi/proxy/plugin_dispatcher.h" |
10 #include "ppapi/proxy/ppapi_messages.h" | 10 #include "ppapi/proxy/ppapi_messages.h" |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 } | 59 } |
60 | 60 |
61 const void* PPB_Testing_Proxy::GetSourceInterface() const { | 61 const void* PPB_Testing_Proxy::GetSourceInterface() const { |
62 return &testing_interface; | 62 return &testing_interface; |
63 } | 63 } |
64 | 64 |
65 InterfaceID PPB_Testing_Proxy::GetInterfaceId() const { | 65 InterfaceID PPB_Testing_Proxy::GetInterfaceId() const { |
66 return INTERFACE_ID_PPB_TESTING; | 66 return INTERFACE_ID_PPB_TESTING; |
67 } | 67 } |
68 | 68 |
69 void PPB_Testing_Proxy::OnMessageReceived(const IPC::Message& msg) { | 69 bool PPB_Testing_Proxy::OnMessageReceived(const IPC::Message& msg) { |
| 70 bool handled = true; |
70 IPC_BEGIN_MESSAGE_MAP(PPB_Testing_Proxy, msg) | 71 IPC_BEGIN_MESSAGE_MAP(PPB_Testing_Proxy, msg) |
71 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBTesting_ReadImageData, | 72 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBTesting_ReadImageData, |
72 OnMsgReadImageData) | 73 OnMsgReadImageData) |
73 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBTesting_RunMessageLoop, | 74 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBTesting_RunMessageLoop, |
74 OnMsgRunMessageLoop) | 75 OnMsgRunMessageLoop) |
75 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBTesting_QuitMessageLoop, | 76 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBTesting_QuitMessageLoop, |
76 OnMsgQuitMessageLoop) | 77 OnMsgQuitMessageLoop) |
77 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBTesting_GetLiveObjectCount, | 78 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBTesting_GetLiveObjectCount, |
78 OnMsgGetLiveObjectCount) | 79 OnMsgGetLiveObjectCount) |
| 80 IPC_MESSAGE_UNHANDLED(handled = false) |
79 IPC_END_MESSAGE_MAP() | 81 IPC_END_MESSAGE_MAP() |
| 82 return handled; |
80 } | 83 } |
81 | 84 |
82 void PPB_Testing_Proxy::OnMsgReadImageData(PP_Resource device_context_2d, | 85 void PPB_Testing_Proxy::OnMsgReadImageData(PP_Resource device_context_2d, |
83 PP_Resource image, | 86 PP_Resource image, |
84 const PP_Point& top_left, | 87 const PP_Point& top_left, |
85 PP_Bool* result) { | 88 PP_Bool* result) { |
86 *result = ppb_testing_target()->ReadImageData( | 89 *result = ppb_testing_target()->ReadImageData( |
87 device_context_2d, image, &top_left); | 90 device_context_2d, image, &top_left); |
88 } | 91 } |
89 | 92 |
90 void PPB_Testing_Proxy::OnMsgRunMessageLoop(bool* dummy) { | 93 void PPB_Testing_Proxy::OnMsgRunMessageLoop(bool* dummy) { |
91 ppb_testing_target()->RunMessageLoop(); | 94 ppb_testing_target()->RunMessageLoop(); |
92 *dummy = false; | 95 *dummy = false; |
93 } | 96 } |
94 | 97 |
95 void PPB_Testing_Proxy::OnMsgQuitMessageLoop() { | 98 void PPB_Testing_Proxy::OnMsgQuitMessageLoop() { |
96 ppb_testing_target()->QuitMessageLoop(); | 99 ppb_testing_target()->QuitMessageLoop(); |
97 } | 100 } |
98 | 101 |
99 void PPB_Testing_Proxy::OnMsgGetLiveObjectCount(PP_Module module_id, | 102 void PPB_Testing_Proxy::OnMsgGetLiveObjectCount(PP_Module module_id, |
100 uint32_t* result) { | 103 uint32_t* result) { |
101 *result = ppb_testing_target()->GetLiveObjectCount(module_id); | 104 *result = ppb_testing_target()->GetLiveObjectCount(module_id); |
102 } | 105 } |
103 | 106 |
104 } // namespace proxy | 107 } // namespace proxy |
105 } // namespace pp | 108 } // namespace pp |
OLD | NEW |