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

Unified Diff: mojo/examples/pepper_container_app/ppb_core_thunk.cc

Issue 178953003: Mojo container example for hosting Pepper plugins (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 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
Index: mojo/examples/pepper_container_app/ppb_core_thunk.cc
diff --git a/mojo/examples/pepper_container_app/ppb_core_thunk.cc b/mojo/examples/pepper_container_app/ppb_core_thunk.cc
new file mode 100644
index 0000000000000000000000000000000000000000..a76a976478591f37408e661f4317c356ff679559
--- /dev/null
+++ b/mojo/examples/pepper_container_app/ppb_core_thunk.cc
@@ -0,0 +1,64 @@
+// Copyright 2014 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 "base/logging.h"
+#include "mojo/examples/pepper_container_app/thunk.h"
+#include "ppapi/c/ppb_core.h"
+#include "ppapi/shared_impl/ppapi_globals.h"
+#include "ppapi/shared_impl/proxy_lock.h"
+#include "ppapi/shared_impl/resource_tracker.h"
+
+namespace mojo {
+namespace examples {
+
+namespace {
+
+void AddRefResource(PP_Resource resource) {
+ ppapi::ProxyAutoLock lock;
+ ppapi::PpapiGlobals::Get()->GetResourceTracker()->AddRefResource(resource);
+}
+
+void ReleaseResource(PP_Resource resource) {
+ ppapi::ProxyAutoLock lock;
+ ppapi::PpapiGlobals::Get()->GetResourceTracker()->ReleaseResource(resource);
+}
+
+PP_Time GetTime() {
+ NOTIMPLEMENTED();
+ return 0;
+}
+
+PP_TimeTicks GetTimeTicks() {
+ NOTIMPLEMENTED();
+ return 0;
+}
+
+void CallOnMainThread(int32_t delay_in_milliseconds,
+ PP_CompletionCallback callback,
+ int32_t result) {
+ NOTIMPLEMENTED();
+}
+
+PP_Bool IsMainThread() {
+ NOTIMPLEMENTED();
+ return PP_TRUE;
+}
+
+} // namespace
+
+const PPB_Core_1_0 g_ppb_core_thunk_1_0 = {
+ &AddRefResource,
+ &ReleaseResource,
+ &GetTime,
+ &GetTimeTicks,
+ &CallOnMainThread,
+ &IsMainThread
+};
+
+const PPB_Core_1_0* GetPPB_Core_1_0_Thunk() {
+ return &g_ppb_core_thunk_1_0;
+}
+
+} // namespace examples
+} // namespace mojo
« no previous file with comments | « mojo/examples/pepper_container_app/plugin_module.cc ('k') | mojo/examples/pepper_container_app/ppb_opengles2_thunk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698