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

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

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 #ifndef PPAPI_SHARED_IMPL_TEST_GLOBALS_H_ 5 #ifndef PPAPI_SHARED_IMPL_TEST_GLOBALS_H_
6 #define PPAPI_SHARED_IMPL_TEST_GLOBALS_H_ 6 #define PPAPI_SHARED_IMPL_TEST_GLOBALS_H_
7 7
8 #include "base/compiler_specific.h" 8 #include "base/compiler_specific.h"
9 #include "base/memory/shared_memory.h" 9 #include "base/memory/shared_memory.h"
10 #include "ppapi/shared_impl/callback_tracker.h" 10 #include "ppapi/shared_impl/callback_tracker.h"
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 }; 42 };
43 43
44 // Implementation of PpapiGlobals for tests that don't need either the host- or 44 // Implementation of PpapiGlobals for tests that don't need either the host- or
45 // plugin-specific implementations. 45 // plugin-specific implementations.
46 class TestGlobals : public PpapiGlobals { 46 class TestGlobals : public PpapiGlobals {
47 public: 47 public:
48 TestGlobals(); 48 TestGlobals();
49 explicit TestGlobals(PpapiGlobals::PerThreadForTest); 49 explicit TestGlobals(PpapiGlobals::PerThreadForTest);
50 virtual ~TestGlobals(); 50 virtual ~TestGlobals();
51 51
52 void set_proxy_lock(base::Lock* lock) { lock_ = lock; }
53
52 // PpapiGlobals implementation. 54 // PpapiGlobals implementation.
53 virtual ResourceTracker* GetResourceTracker() OVERRIDE; 55 virtual ResourceTracker* GetResourceTracker() OVERRIDE;
54 virtual VarTracker* GetVarTracker() OVERRIDE; 56 virtual VarTracker* GetVarTracker() OVERRIDE;
55 virtual CallbackTracker* GetCallbackTrackerForInstance( 57 virtual CallbackTracker* GetCallbackTrackerForInstance(
56 PP_Instance instance) OVERRIDE; 58 PP_Instance instance) OVERRIDE;
57 virtual thunk::PPB_Instance_API* GetInstanceAPI( 59 virtual thunk::PPB_Instance_API* GetInstanceAPI(
58 PP_Instance instance) OVERRIDE; 60 PP_Instance instance) OVERRIDE;
59 virtual thunk::ResourceCreationAPI* GetResourceCreationAPI( 61 virtual thunk::ResourceCreationAPI* GetResourceCreationAPI(
60 PP_Instance instance) OVERRIDE; 62 PP_Instance instance) OVERRIDE;
61 virtual PP_Module GetModuleForInstance(PP_Instance instance) OVERRIDE; 63 virtual PP_Module GetModuleForInstance(PP_Instance instance) OVERRIDE;
(...skipping 11 matching lines...) Expand all
73 virtual MessageLoopShared* GetCurrentMessageLoop() OVERRIDE; 75 virtual MessageLoopShared* GetCurrentMessageLoop() OVERRIDE;
74 virtual base::TaskRunner* GetFileTaskRunner(PP_Instance instance) OVERRIDE; 76 virtual base::TaskRunner* GetFileTaskRunner(PP_Instance instance) OVERRIDE;
75 77
76 // PpapiGlobals overrides: 78 // PpapiGlobals overrides:
77 virtual bool IsHostGlobals() const OVERRIDE; 79 virtual bool IsHostGlobals() const OVERRIDE;
78 80
79 private: 81 private:
80 ResourceTracker resource_tracker_; 82 ResourceTracker resource_tracker_;
81 TestVarTracker var_tracker_; 83 TestVarTracker var_tracker_;
82 scoped_refptr<CallbackTracker> callback_tracker_; 84 scoped_refptr<CallbackTracker> callback_tracker_;
85 base::Lock* lock_;
83 86
84 DISALLOW_COPY_AND_ASSIGN(TestGlobals); 87 DISALLOW_COPY_AND_ASSIGN(TestGlobals);
85 }; 88 };
86 89
87 } // namespace ppapi 90 } // namespace ppapi
88 91
89 #endif // PPAPI_SHARED_IMPL_TEST_GLOBALS_H_ 92 #endif // PPAPI_SHARED_IMPL_TEST_GLOBALS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698