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

Side by Side Diff: ppapi/shared_impl/test_globals.cc

Issue 19492014: PPAPI: Purposely leak ProxyLock, fix shutdown race (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Make the destructor lock [sometimes] Created 7 years, 5 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ppapi/shared_impl/test_globals.h" 5 #include "ppapi/shared_impl/test_globals.h"
6 6
7 namespace ppapi { 7 namespace ppapi {
8 8
9 TestGlobals::TestGlobals() 9 TestGlobals::TestGlobals()
10 : ppapi::PpapiGlobals(), 10 : ppapi::PpapiGlobals(),
11 resource_tracker_(ResourceTracker::THREAD_SAFE), 11 resource_tracker_(ResourceTracker::THREAD_SAFE),
12 callback_tracker_(new CallbackTracker) { 12 callback_tracker_(new CallbackTracker),
13 lock_(NULL) {
13 } 14 }
14 15
15 TestGlobals::TestGlobals(PpapiGlobals::PerThreadForTest per_thread_for_test) 16 TestGlobals::TestGlobals(PpapiGlobals::PerThreadForTest per_thread_for_test)
16 : ppapi::PpapiGlobals(per_thread_for_test), 17 : ppapi::PpapiGlobals(per_thread_for_test),
17 resource_tracker_(ResourceTracker::THREAD_SAFE), 18 resource_tracker_(ResourceTracker::THREAD_SAFE),
18 callback_tracker_(new CallbackTracker) { 19 callback_tracker_(new CallbackTracker),
20 lock_(NULL) {
19 } 21 }
20 22
21 TestGlobals::~TestGlobals() { 23 TestGlobals::~TestGlobals() {
22 } 24 }
23 25
24 ResourceTracker* TestGlobals::GetResourceTracker() { 26 ResourceTracker* TestGlobals::GetResourceTracker() {
25 return &resource_tracker_; 27 return &resource_tracker_;
26 } 28 }
27 29
28 VarTracker* TestGlobals::GetVarTracker() { 30 VarTracker* TestGlobals::GetVarTracker() {
(...skipping 20 matching lines...) Expand all
49 } 51 }
50 52
51 std::string TestGlobals::GetCmdLine() { 53 std::string TestGlobals::GetCmdLine() {
52 return std::string(); 54 return std::string();
53 } 55 }
54 56
55 void TestGlobals::PreCacheFontForFlash(const void* /* logfontw */) { 57 void TestGlobals::PreCacheFontForFlash(const void* /* logfontw */) {
56 } 58 }
57 59
58 base::Lock* TestGlobals::GetProxyLock() { 60 base::Lock* TestGlobals::GetProxyLock() {
59 return NULL; 61 return lock_;
60 } 62 }
61 63
62 void TestGlobals::LogWithSource(PP_Instance instance, 64 void TestGlobals::LogWithSource(PP_Instance instance,
63 PP_LogLevel level, 65 PP_LogLevel level,
64 const std::string& source, 66 const std::string& source,
65 const std::string& value) { 67 const std::string& value) {
66 } 68 }
67 69
68 void TestGlobals::BroadcastLogWithSource(PP_Module module, 70 void TestGlobals::BroadcastLogWithSource(PP_Module module,
69 PP_LogLevel level, 71 PP_LogLevel level,
70 const std::string& source, 72 const std::string& source,
71 const std::string& value) { 73 const std::string& value) {
72 } 74 }
73 75
74 MessageLoopShared* TestGlobals::GetCurrentMessageLoop() { 76 MessageLoopShared* TestGlobals::GetCurrentMessageLoop() {
75 return NULL; 77 return NULL;
76 } 78 }
77 79
78 base::TaskRunner* TestGlobals::GetFileTaskRunner(PP_Instance instance) { 80 base::TaskRunner* TestGlobals::GetFileTaskRunner(PP_Instance instance) {
79 return NULL; 81 return NULL;
80 } 82 }
81 83
82 bool TestGlobals::IsHostGlobals() const { 84 bool TestGlobals::IsHostGlobals() const {
83 // Pretend to be the host-side, for code that expects one or the other. 85 // Pretend to be the host-side, for code that expects one or the other.
84 // TODO(dmichael): just make it settable which one we're pretending to be? 86 // TODO(dmichael): just make it settable which one we're pretending to be?
85 return true; 87 return true;
86 } 88 }
87 89
88 } // namespace ppapi 90 } // namespace ppapi
OLDNEW
« ppapi/shared_impl/proxy_lock.h ('K') | « ppapi/shared_impl/test_globals.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698