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.
5 #include "ppapi/shared_impl/test_globals.h"
9 TestGlobals::TestGlobals()
10 : ppapi::PpapiGlobals(),
11 resource_tracker_(ResourceTracker::THREAD_SAFE
),
12 callback_tracker_(new CallbackTracker
) {
15 TestGlobals::TestGlobals(PpapiGlobals::PerThreadForTest per_thread_for_test
)
16 : ppapi::PpapiGlobals(per_thread_for_test
),
17 resource_tracker_(ResourceTracker::THREAD_SAFE
),
18 callback_tracker_(new CallbackTracker
) {
21 TestGlobals::~TestGlobals() {
24 ResourceTracker
* TestGlobals::GetResourceTracker() {
25 return &resource_tracker_
;
28 VarTracker
* TestGlobals::GetVarTracker() {
32 CallbackTracker
* TestGlobals::GetCallbackTrackerForInstance(
33 PP_Instance instance
) {
34 return callback_tracker_
.get();
37 thunk::PPB_Instance_API
* TestGlobals::GetInstanceAPI(
38 PP_Instance instance
) {
42 thunk::ResourceCreationAPI
* TestGlobals::GetResourceCreationAPI(
43 PP_Instance instance
) {
47 PP_Module
TestGlobals::GetModuleForInstance(PP_Instance instance
) {
51 std::string
TestGlobals::GetCmdLine() {
55 void TestGlobals::PreCacheFontForFlash(const void* /* logfontw */) {
58 base::Lock
* TestGlobals::GetProxyLock() {
62 void TestGlobals::LogWithSource(PP_Instance instance
,
64 const std::string
& source
,
65 const std::string
& value
) {
68 void TestGlobals::BroadcastLogWithSource(PP_Module module
,
70 const std::string
& source
,
71 const std::string
& value
) {
74 MessageLoopShared
* TestGlobals::GetCurrentMessageLoop() {
78 bool TestGlobals::IsHostGlobals() const {
79 // Pretend to be the host-side, for code that expects one or the other.
80 // TODO(dmichael): just make it settable which one we're pretending to be?