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

Side by Side Diff: ppapi/thunk/enter.cc

Issue 19492014: PPAPI: Purposely leak ProxyLock, fix shutdown race (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove static initializer Created 7 years, 3 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/thunk/enter.h ('k') | no next file » | 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) 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
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
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
OLDNEW
« no previous file with comments | « ppapi/thunk/enter.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698