OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 return 0; | 109 return 0; |
110 | 110 |
111 return AddProxyResource(result, shm_handle, size); | 111 return AddProxyResource(result, shm_handle, size); |
112 } | 112 } |
113 | 113 |
114 // static | 114 // static |
115 PP_Resource PPB_Buffer_Proxy::AddProxyResource( | 115 PP_Resource PPB_Buffer_Proxy::AddProxyResource( |
116 const HostResource& resource, | 116 const HostResource& resource, |
117 base::SharedMemoryHandle shm_handle, | 117 base::SharedMemoryHandle shm_handle, |
118 uint32_t size) { | 118 uint32_t size) { |
119 linked_ptr<Buffer> object(new Buffer(resource, shm_handle, size)); | 119 return PluginResourceTracker::GetInstance()->AddResource( |
120 return PluginResourceTracker::GetInstance()->AddResource(object); | 120 new Buffer(resource, shm_handle, size)); |
121 } | 121 } |
122 | 122 |
123 bool PPB_Buffer_Proxy::OnMessageReceived(const IPC::Message& msg) { | 123 bool PPB_Buffer_Proxy::OnMessageReceived(const IPC::Message& msg) { |
124 bool handled = true; | 124 bool handled = true; |
125 IPC_BEGIN_MESSAGE_MAP(PPB_Buffer_Proxy, msg) | 125 IPC_BEGIN_MESSAGE_MAP(PPB_Buffer_Proxy, msg) |
126 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBBuffer_Create, OnMsgCreate) | 126 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBBuffer_Create, OnMsgCreate) |
127 IPC_MESSAGE_UNHANDLED(handled = false) | 127 IPC_MESSAGE_UNHANDLED(handled = false) |
128 IPC_END_MESSAGE_MAP() | 128 IPC_END_MESSAGE_MAP() |
129 // TODO(brettw) handle bad messages! | 129 // TODO(brettw) handle bad messages! |
130 return handled; | 130 return handled; |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 #elif defined(OS_POSIX) | 162 #elif defined(OS_POSIX) |
163 local_fd; | 163 local_fd; |
164 #else | 164 #else |
165 #error Not implemented. | 165 #error Not implemented. |
166 #endif | 166 #endif |
167 *result_shm_handle = dispatcher->ShareHandleWithRemote(platform_file, false); | 167 *result_shm_handle = dispatcher->ShareHandleWithRemote(platform_file, false); |
168 } | 168 } |
169 | 169 |
170 } // namespace proxy | 170 } // namespace proxy |
171 } // namespace pp | 171 } // namespace pp |
OLD | NEW |