Upstream version 11.39.266.0
[platform/framework/web/crosswalk.git] / src / mojo / examples / pepper_container_app / ppb_core_thunk.cc
1 // Copyright 2014 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 "base/logging.h"
6 #include "mojo/examples/pepper_container_app/thunk.h"
7 #include "ppapi/c/ppb_core.h"
8 #include "ppapi/shared_impl/ppapi_globals.h"
9 #include "ppapi/shared_impl/proxy_lock.h"
10 #include "ppapi/shared_impl/resource_tracker.h"
11
12 namespace mojo {
13 namespace examples {
14
15 namespace {
16
17 void AddRefResource(PP_Resource resource) {
18   ppapi::ProxyAutoLock lock;
19   ppapi::PpapiGlobals::Get()->GetResourceTracker()->AddRefResource(resource);
20 }
21
22 void ReleaseResource(PP_Resource resource) {
23   ppapi::ProxyAutoLock lock;
24   ppapi::PpapiGlobals::Get()->GetResourceTracker()->ReleaseResource(resource);
25 }
26
27 PP_Time GetTime() {
28   NOTIMPLEMENTED();
29   return 0;
30 }
31
32 PP_TimeTicks GetTimeTicks() {
33   NOTIMPLEMENTED();
34   return 0;
35 }
36
37 void CallOnMainThread(int32_t delay_in_milliseconds,
38                       PP_CompletionCallback callback,
39                       int32_t result) {
40   NOTIMPLEMENTED();
41 }
42
43 PP_Bool IsMainThread() {
44   NOTIMPLEMENTED();
45   return PP_TRUE;
46 }
47
48 }  // namespace
49
50 const PPB_Core_1_0 g_ppb_core_thunk_1_0 = {
51   &AddRefResource,
52   &ReleaseResource,
53   &GetTime,
54   &GetTimeTicks,
55   &CallOnMainThread,
56   &IsMainThread
57 };
58
59 const PPB_Core_1_0* GetPPB_Core_1_0_Thunk() {
60   return &g_ppb_core_thunk_1_0;
61 }
62
63 }  // namespace examples
64 }  // namespace mojo