| 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_buffer_proxy.h" | 5 #include "ppapi/proxy/ppb_buffer_proxy.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 } | 124 } |
| 125 | 125 |
| 126 const void* PPB_Buffer_Proxy::GetSourceInterface() const { | 126 const void* PPB_Buffer_Proxy::GetSourceInterface() const { |
| 127 return &ppb_buffer; | 127 return &ppb_buffer; |
| 128 } | 128 } |
| 129 | 129 |
| 130 InterfaceID PPB_Buffer_Proxy::GetInterfaceId() const { | 130 InterfaceID PPB_Buffer_Proxy::GetInterfaceId() const { |
| 131 return INTERFACE_ID_PPB_BUFFER; | 131 return INTERFACE_ID_PPB_BUFFER; |
| 132 } | 132 } |
| 133 | 133 |
| 134 void PPB_Buffer_Proxy::OnMessageReceived(const IPC::Message& msg) { | 134 bool PPB_Buffer_Proxy::OnMessageReceived(const IPC::Message& msg) { |
| 135 bool handled = true; |
| 135 IPC_BEGIN_MESSAGE_MAP(PPB_Buffer_Proxy, msg) | 136 IPC_BEGIN_MESSAGE_MAP(PPB_Buffer_Proxy, msg) |
| 136 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBBuffer_Create, OnMsgCreate) | 137 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBBuffer_Create, OnMsgCreate) |
| 138 IPC_MESSAGE_UNHANDLED(handled = false) |
| 137 IPC_END_MESSAGE_MAP() | 139 IPC_END_MESSAGE_MAP() |
| 138 // TODO(brettw) handle bad messages! | 140 // TODO(brettw) handle bad messages! |
| 141 return handled; |
| 139 } | 142 } |
| 140 | 143 |
| 141 void PPB_Buffer_Proxy::OnMsgCreate(PP_Module module, | 144 void PPB_Buffer_Proxy::OnMsgCreate(PP_Module module, |
| 142 uint32_t size, | 145 uint32_t size, |
| 143 PP_Resource* result_resource, | 146 PP_Resource* result_resource, |
| 144 int* result_shm_handle) { | 147 int* result_shm_handle) { |
| 145 *result_resource = ppb_buffer_target()->Create(module, size); | 148 *result_resource = ppb_buffer_target()->Create(module, size); |
| 146 // TODO(brettw) set the shm handle from a trusted interface. | 149 // TODO(brettw) set the shm handle from a trusted interface. |
| 147 *result_shm_handle = 0; | 150 *result_shm_handle = 0; |
| 148 } | 151 } |
| 149 | 152 |
| 150 } // namespace proxy | 153 } // namespace proxy |
| 151 } // namespace pp | 154 } // namespace pp |
| OLD | NEW |