| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_message_loop_proxy.h" | 5 #include "ppapi/proxy/ppb_message_loop_proxy.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| 11 #include "base/message_loop.h" | 11 #include "base/message_loop.h" |
| 12 #include "base/message_loop_proxy.h" | 12 #include "base/message_loop_proxy.h" |
| 13 #include "ppapi/c/dev/ppb_message_loop_dev.h" | |
| 14 #include "ppapi/c/pp_errors.h" | 13 #include "ppapi/c/pp_errors.h" |
| 14 #include "ppapi/c/ppb_message_loop.h" |
| 15 #include "ppapi/proxy/plugin_dispatcher.h" | 15 #include "ppapi/proxy/plugin_dispatcher.h" |
| 16 #include "ppapi/proxy/plugin_globals.h" | 16 #include "ppapi/proxy/plugin_globals.h" |
| 17 #include "ppapi/shared_impl/proxy_lock.h" | 17 #include "ppapi/shared_impl/proxy_lock.h" |
| 18 #include "ppapi/thunk/enter.h" | 18 #include "ppapi/thunk/enter.h" |
| 19 | 19 |
| 20 using ppapi::thunk::PPB_MessageLoop_API; | 20 using ppapi::thunk::PPB_MessageLoop_API; |
| 21 | 21 |
| 22 namespace ppapi { | 22 namespace ppapi { |
| 23 namespace proxy { | 23 namespace proxy { |
| 24 | 24 |
| (...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 241 return PP_ERROR_BADRESOURCE; | 241 return PP_ERROR_BADRESOURCE; |
| 242 } | 242 } |
| 243 | 243 |
| 244 int32_t PostQuit(PP_Resource message_loop, PP_Bool should_destroy) { | 244 int32_t PostQuit(PP_Resource message_loop, PP_Bool should_destroy) { |
| 245 EnterMessageLoop enter(message_loop, true); | 245 EnterMessageLoop enter(message_loop, true); |
| 246 if (enter.succeeded()) | 246 if (enter.succeeded()) |
| 247 return enter.object()->PostQuit(should_destroy); | 247 return enter.object()->PostQuit(should_destroy); |
| 248 return PP_ERROR_BADRESOURCE; | 248 return PP_ERROR_BADRESOURCE; |
| 249 } | 249 } |
| 250 | 250 |
| 251 const PPB_MessageLoop_Dev_0_1 ppb_message_loop_interface = { | 251 const PPB_MessageLoop_1_0 ppb_message_loop_interface = { |
| 252 &Create, | 252 &Create, |
| 253 &GetForMainThread, | 253 &GetForMainThread, |
| 254 &GetCurrent, | 254 &GetCurrent, |
| 255 &AttachToCurrentThread, | 255 &AttachToCurrentThread, |
| 256 &Run, | 256 &Run, |
| 257 &PostWork, | 257 &PostWork, |
| 258 &PostQuit | 258 &PostQuit |
| 259 }; | 259 }; |
| 260 | 260 |
| 261 PPB_MessageLoop_Proxy::PPB_MessageLoop_Proxy(Dispatcher* dispatcher) | 261 PPB_MessageLoop_Proxy::PPB_MessageLoop_Proxy(Dispatcher* dispatcher) |
| 262 : InterfaceProxy(dispatcher) { | 262 : InterfaceProxy(dispatcher) { |
| 263 } | 263 } |
| 264 | 264 |
| 265 PPB_MessageLoop_Proxy::~PPB_MessageLoop_Proxy() { | 265 PPB_MessageLoop_Proxy::~PPB_MessageLoop_Proxy() { |
| 266 } | 266 } |
| 267 | 267 |
| 268 // static | 268 // static |
| 269 const PPB_MessageLoop_Dev_0_1* PPB_MessageLoop_Proxy::GetInterface() { | 269 const PPB_MessageLoop_1_0* PPB_MessageLoop_Proxy::GetInterface() { |
| 270 return &ppb_message_loop_interface; | 270 return &ppb_message_loop_interface; |
| 271 } | 271 } |
| 272 | 272 |
| 273 } // namespace proxy | 273 } // namespace proxy |
| 274 } // namespace ppapi | 274 } // namespace ppapi |
| OLD | NEW |