OLD | NEW |
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/thunk/enter.h" | 5 #include "ppapi/thunk/enter.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
10 #include "base/strings/stringprintf.h" | 10 #include "base/strings/stringprintf.h" |
(...skipping 11 matching lines...) Expand all Loading... |
22 return | 22 return |
23 PpapiGlobals::Get()->GetMainThreadMessageLoop()->BelongsToCurrentThread(); | 23 PpapiGlobals::Get()->GetMainThreadMessageLoop()->BelongsToCurrentThread(); |
24 } | 24 } |
25 | 25 |
26 } // namespace | 26 } // namespace |
27 | 27 |
28 namespace thunk { | 28 namespace thunk { |
29 | 29 |
30 namespace subtle { | 30 namespace subtle { |
31 | 31 |
32 void AssertLockHeld() { | |
33 base::Lock* proxy_lock = PpapiGlobals::Get()->GetProxyLock(); | |
34 // The lock is only valid in the plugin side of the proxy, so it only makes | |
35 // sense to assert there. Otherwise, silently succeed. | |
36 if (proxy_lock) | |
37 proxy_lock->AssertAcquired(); | |
38 } | |
39 | |
40 EnterBase::EnterBase() | 32 EnterBase::EnterBase() |
41 : resource_(NULL), | 33 : resource_(NULL), |
42 retval_(PP_OK) { | 34 retval_(PP_OK) { |
43 } | 35 } |
44 | 36 |
45 EnterBase::EnterBase(PP_Resource resource) | 37 EnterBase::EnterBase(PP_Resource resource) |
46 : resource_(GetResource(resource)), | 38 : resource_(GetResource(resource)), |
47 retval_(PP_OK) { | 39 retval_(PP_OK) { |
48 } | 40 } |
49 | 41 |
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
313 : EnterBase(), | 305 : EnterBase(), |
314 functions_(PpapiGlobals::Get()->GetResourceCreationAPI(instance)) { | 306 functions_(PpapiGlobals::Get()->GetResourceCreationAPI(instance)) { |
315 SetStateForFunctionError(instance, functions_, true); | 307 SetStateForFunctionError(instance, functions_, true); |
316 } | 308 } |
317 | 309 |
318 EnterResourceCreationNoLock::~EnterResourceCreationNoLock() { | 310 EnterResourceCreationNoLock::~EnterResourceCreationNoLock() { |
319 } | 311 } |
320 | 312 |
321 } // namespace thunk | 313 } // namespace thunk |
322 } // namespace ppapi | 314 } // namespace ppapi |
OLD | NEW |