| 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_core_proxy.h" | 5 #include "ppapi/proxy/ppb_core_proxy.h" |
| 6 | 6 |
| 7 #include <stdlib.h> // For malloc | 7 #include <stdlib.h> // For malloc |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 } | 89 } |
| 90 | 90 |
| 91 const void* PPB_Core_Proxy::GetSourceInterface() const { | 91 const void* PPB_Core_Proxy::GetSourceInterface() const { |
| 92 return &core_interface; | 92 return &core_interface; |
| 93 } | 93 } |
| 94 | 94 |
| 95 InterfaceID PPB_Core_Proxy::GetInterfaceId() const { | 95 InterfaceID PPB_Core_Proxy::GetInterfaceId() const { |
| 96 return INTERFACE_ID_PPB_CORE; | 96 return INTERFACE_ID_PPB_CORE; |
| 97 } | 97 } |
| 98 | 98 |
| 99 void PPB_Core_Proxy::OnMessageReceived(const IPC::Message& msg) { | 99 bool PPB_Core_Proxy::OnMessageReceived(const IPC::Message& msg) { |
| 100 bool handled = true; |
| 100 IPC_BEGIN_MESSAGE_MAP(PPB_Core_Proxy, msg) | 101 IPC_BEGIN_MESSAGE_MAP(PPB_Core_Proxy, msg) |
| 101 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBCore_AddRefResource, | 102 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBCore_AddRefResource, |
| 102 OnMsgAddRefResource) | 103 OnMsgAddRefResource) |
| 103 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBCore_ReleaseResource, | 104 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBCore_ReleaseResource, |
| 104 OnMsgReleaseResource) | 105 OnMsgReleaseResource) |
| 106 IPC_MESSAGE_UNHANDLED(handled = false) |
| 105 IPC_END_MESSAGE_MAP() | 107 IPC_END_MESSAGE_MAP() |
| 106 // TODO(brettw) handle bad messages! | 108 // TODO(brettw) handle bad messages! |
| 109 return handled; |
| 107 } | 110 } |
| 108 | 111 |
| 109 void PPB_Core_Proxy::OnMsgAddRefResource(PP_Resource resource) { | 112 void PPB_Core_Proxy::OnMsgAddRefResource(PP_Resource resource) { |
| 110 ppb_core_target()->AddRefResource(resource); | 113 ppb_core_target()->AddRefResource(resource); |
| 111 } | 114 } |
| 112 | 115 |
| 113 void PPB_Core_Proxy::OnMsgReleaseResource(PP_Resource resource) { | 116 void PPB_Core_Proxy::OnMsgReleaseResource(PP_Resource resource) { |
| 114 ppb_core_target()->ReleaseResource(resource); | 117 ppb_core_target()->ReleaseResource(resource); |
| 115 } | 118 } |
| 116 | 119 |
| 117 } // namespace proxy | 120 } // namespace proxy |
| 118 } // namespace pp | 121 } // namespace pp |
| OLD | NEW |