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

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

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/proxy_lock.h ('k') | ppapi/shared_impl/test_globals.h » ('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 #include "ppapi/shared_impl/proxy_lock.h" 5 #include "ppapi/shared_impl/proxy_lock.h"
6 6
7 #include "base/synchronization/lock.h" 7 #include "base/synchronization/lock.h"
8 #include "ppapi/shared_impl/ppapi_globals.h"
9 8
10 namespace ppapi { 9 namespace ppapi {
11 10
11 base::Lock* ProxyLock::lock_ = NULL;
12
12 // static 13 // static
13 void ProxyLock::Acquire() { 14 void ProxyLock::Acquire() {
14 base::Lock* lock(PpapiGlobals::Get()->GetProxyLock()); 15 if (lock_)
15 if (lock) 16 lock_->Acquire();
16 lock->Acquire();
17 } 17 }
18 18
19 // static 19 // static
20 void ProxyLock::Release() { 20 void ProxyLock::Release() {
21 base::Lock* lock(PpapiGlobals::Get()->GetProxyLock()); 21 if (lock_)
22 if (lock) 22 lock_->Release();
23 lock->Release(); 23 }
24
25 // static
26 void ProxyLock::Set(base::Lock* lock) {
27 lock_ = lock;
28 }
29
30 // static
31 void ProxyLock::Reset() {
32 Set(NULL);
24 } 33 }
25 34
26 } // namespace ppapi 35 } // namespace ppapi
OLDNEW
« no previous file with comments | « ppapi/shared_impl/proxy_lock.h ('k') | ppapi/shared_impl/test_globals.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698