Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(685)

Unified Diff: ppapi/cpp/private/flash_message_loop.cc

Issue 9188045: Introduce PPB_Flash_MessageLoop interface for Pepper Flash. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Use base::Callback instead of PP_CompletionCallback in RunFromHostProxy(). Created 8 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ppapi/cpp/private/flash_message_loop.h ('k') | ppapi/ppapi_proxy.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/cpp/private/flash_message_loop.cc
diff --git a/ppapi/cpp/private/flash_message_loop.cc b/ppapi/cpp/private/flash_message_loop.cc
new file mode 100644
index 0000000000000000000000000000000000000000..ea258915aaa9ed4437751cef33bfd38c7c454b6d
--- /dev/null
+++ b/ppapi/cpp/private/flash_message_loop.cc
@@ -0,0 +1,51 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "ppapi/cpp/private/flash_message_loop.h"
+
+#include "ppapi/c/pp_errors.h"
+#include "ppapi/c/private/ppb_flash_message_loop.h"
+#include "ppapi/cpp/instance.h"
+#include "ppapi/cpp/module_impl.h"
+
+namespace pp {
+
+namespace {
+
+template <> const char* interface_name<PPB_Flash_MessageLoop>() {
+ return PPB_FLASH_MESSAGELOOP_INTERFACE;
+}
+
+} // namespace
+
+namespace flash {
+
+MessageLoop::MessageLoop(Instance* instance) {
+ if (has_interface<PPB_Flash_MessageLoop>()) {
+ PassRefFromConstructor(get_interface<PPB_Flash_MessageLoop>()->Create(
+ instance->pp_instance()));
+ }
+}
+
+MessageLoop::~MessageLoop() {
+}
+
+// static
+bool MessageLoop::IsAvailable() {
+ return has_interface<PPB_Flash_MessageLoop>();
+}
+
+int32_t MessageLoop::Run() {
+ if (!has_interface<PPB_Flash_MessageLoop>())
+ return PP_ERROR_NOINTERFACE;
+ return get_interface<PPB_Flash_MessageLoop>()->Run(pp_resource());
+}
+
+void MessageLoop::Quit() {
+ if (has_interface<PPB_Flash_MessageLoop>())
+ get_interface<PPB_Flash_MessageLoop>()->Quit(pp_resource());
+}
+
+} // namespace flash
+} // namespace pp
« no previous file with comments | « ppapi/cpp/private/flash_message_loop.h ('k') | ppapi/ppapi_proxy.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698