Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "ppapi/cpp/private/flash_message_loop.h" | |
| 6 | |
| 7 #include "ppapi/c/pp_errors.h" | |
| 8 #include "ppapi/c/private/ppb_flash_message_loop.h" | |
| 9 #include "ppapi/cpp/instance.h" | |
| 10 #include "ppapi/cpp/module_impl.h" | |
| 11 | |
| 12 namespace pp { | |
| 13 | |
| 14 namespace { | |
| 15 | |
| 16 template <> const char* interface_name<PPB_Flash_MessageLoop>() { | |
| 17 return PPB_FLASH_MESSAGELOOP_INTERFACE; | |
| 18 } | |
| 19 | |
| 20 } // namespace | |
| 21 | |
| 22 namespace flash { | |
| 23 | |
| 24 MessageLoop::MessageLoop(Instance* instance) { | |
| 25 if (has_interface<PPB_Flash_MessageLoop>() && instance) { | |
|
viettrungluu
2012/01/17 21:26:06
Do we really check |instance| for other things tha
yzshen1
2012/01/18 07:43:35
We don't. I removed it to keep consistency with ot
| |
| 26 PassRefFromConstructor(get_interface<PPB_Flash_MessageLoop>()->Create( | |
| 27 instance->pp_instance())); | |
| 28 } | |
| 29 } | |
| 30 | |
| 31 MessageLoop::~MessageLoop() { | |
| 32 } | |
| 33 | |
| 34 int32_t MessageLoop::Run() { | |
| 35 if (!has_interface<PPB_Flash_MessageLoop>()) | |
| 36 return PP_ERROR_NOINTERFACE; | |
| 37 return get_interface<PPB_Flash_MessageLoop>()->Run(pp_resource()); | |
| 38 } | |
| 39 | |
| 40 void MessageLoop::Quit() { | |
| 41 if (has_interface<PPB_Flash_MessageLoop>()) | |
| 42 get_interface<PPB_Flash_MessageLoop>()->Quit(pp_resource()); | |
| 43 } | |
| 44 | |
| 45 } // namespace flash | |
| 46 } // namespace pp | |
| OLD | NEW |