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

Side by Side Diff: webkit/plugins/ppapi/ppb_proxy_impl.cc

Issue 8222021: Prevent reentrant destructors in the PluginModule. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 2 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 | « webkit/plugins/ppapi/plugin_module.cc ('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) 2011 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 "webkit/plugins/ppapi/ppb_proxy_impl.h" 5 #include "webkit/plugins/ppapi/ppb_proxy_impl.h"
6 6
7 #include "ppapi/c/private/ppb_proxy_private.h" 7 #include "ppapi/c/private/ppb_proxy_private.h"
8 #include "ppapi/thunk/enter.h" 8 #include "ppapi/thunk/enter.h"
9 #include "ppapi/thunk/ppb_image_data_api.h" 9 #include "ppapi/thunk/ppb_image_data_api.h"
10 #include "webkit/plugins/ppapi/plugin_module.h" 10 #include "webkit/plugins/ppapi/plugin_module.h"
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 if (plugin_module) 52 if (plugin_module)
53 plugin_module->AddRef(); 53 plugin_module->AddRef();
54 } 54 }
55 55
56 void ReleaseModule(PP_Module module) { 56 void ReleaseModule(PP_Module module) {
57 PluginModule* plugin_module = ResourceTracker::Get()->GetModule(module); 57 PluginModule* plugin_module = ResourceTracker::Get()->GetModule(module);
58 if (plugin_module) 58 if (plugin_module)
59 plugin_module->Release(); 59 plugin_module->Release();
60 } 60 }
61 61
62 PP_Bool IsInModuleDestructor(PP_Module module) {
63 PluginModule* plugin_module = ResourceTracker::Get()->GetModule(module);
64 if (plugin_module)
65 return PP_FromBool(plugin_module->is_in_destructor());
66 return PP_FALSE;
67 }
68
62 const PPB_Proxy_Private ppb_proxy = { 69 const PPB_Proxy_Private ppb_proxy = {
63 &PluginCrashed, 70 &PluginCrashed,
64 &GetInstanceForResource, 71 &GetInstanceForResource,
65 &SetReserveInstanceIDCallback, 72 &SetReserveInstanceIDCallback,
66 &GetURLLoaderBufferedBytes, 73 &GetURLLoaderBufferedBytes,
67 &AddRefModule, 74 &AddRefModule,
68 &ReleaseModule 75 &ReleaseModule,
76 &IsInModuleDestructor
69 }; 77 };
70 78
71 } // namespace 79 } // namespace
72 80
73 // static 81 // static
74 const PPB_Proxy_Private* PPB_Proxy_Impl::GetInterface() { 82 const PPB_Proxy_Private* PPB_Proxy_Impl::GetInterface() {
75 return &ppb_proxy; 83 return &ppb_proxy;
76 } 84 }
77 85
78 } // namespace ppapi 86 } // namespace ppapi
79 } // namespace webkit 87 } // namespace webkit
OLDNEW
« no previous file with comments | « webkit/plugins/ppapi/plugin_module.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698