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

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

Issue 9139054: Revert 117399 - Make it possible to have 1 PpapiGlobals per thread. Update unit tests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 11 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
« no previous file with comments | « ppapi/shared_impl/ppapi_globals.cc ('k') | ppapi/shared_impl/proxy_lock.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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_PROXY_LOCK_H_ 5 #ifndef PPAPI_SHARED_IMPL_PROXY_LOCK_H_
6 #define PPAPI_SHARED_IMPL_PROXY_LOCK_H_ 6 #define PPAPI_SHARED_IMPL_PROXY_LOCK_H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 9
10 #include "ppapi/shared_impl/ppapi_shared_export.h" 10 #include "ppapi/shared_impl/ppapi_shared_export.h"
11 11
(...skipping 15 matching lines...) Expand all
27 public: 27 public:
28 // Acquire the proxy lock. If it is currently held by another thread, block 28 // Acquire the proxy lock. If it is currently held by another thread, block
29 // until it is available. If the lock has not been set using the 'Set' method, 29 // until it is available. If the lock has not been set using the 'Set' method,
30 // this operation does nothing. That is the normal case for the host side; 30 // this operation does nothing. That is the normal case for the host side;
31 // see PluginResourceTracker for where the lock gets set for the out-of- 31 // see PluginResourceTracker for where the lock gets set for the out-of-
32 // process plugin case. 32 // process plugin case.
33 static void Acquire(); 33 static void Acquire();
34 // Relinquish the proxy lock. If the lock has not been set, this does nothing. 34 // Relinquish the proxy lock. If the lock has not been set, this does nothing.
35 static void Release(); 35 static void Release();
36 36
37 // Set the lock that ProxyLock will use. The caller is responsible for
38 // ensuring that the lock stays valid so long as the ProxyLock may be in use.
39 static void Set(base::Lock* lock);
40 // Set the lock to NULL.
41 static void Reset();
42 private:
43 static base::Lock* lock_;
44
37 DISALLOW_IMPLICIT_CONSTRUCTORS(ProxyLock); 45 DISALLOW_IMPLICIT_CONSTRUCTORS(ProxyLock);
38 }; 46 };
39 47
40 // A simple RAII class for locking the PPAPI proxy lock on entry and releasing 48 // A simple RAII class for locking the PPAPI proxy lock on entry and releasing
41 // on exit. This is for simple interfaces that don't use the 'thunk' system, 49 // on exit. This is for simple interfaces that don't use the 'thunk' system,
42 // such as PPB_Var and PPB_Core. 50 // such as PPB_Var and PPB_Core.
43 class ProxyAutoLock { 51 class ProxyAutoLock {
44 public: 52 public:
45 ProxyAutoLock() { 53 ProxyAutoLock() {
46 ProxyLock::Acquire(); 54 ProxyLock::Acquire();
(...skipping 18 matching lines...) Expand all
65 ProxyLock::Acquire(); 73 ProxyLock::Acquire();
66 } 74 }
67 private: 75 private:
68 DISALLOW_COPY_AND_ASSIGN(ProxyAutoUnlock); 76 DISALLOW_COPY_AND_ASSIGN(ProxyAutoUnlock);
69 }; 77 };
70 78
71 79
72 } // namespace ppapi 80 } // namespace ppapi
73 81
74 #endif // PPAPI_SHARED_IMPL_PROXY_LOCK_H_ 82 #endif // PPAPI_SHARED_IMPL_PROXY_LOCK_H_
OLDNEW
« no previous file with comments | « ppapi/shared_impl/ppapi_globals.cc ('k') | ppapi/shared_impl/proxy_lock.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698