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

Side by Side Diff: components/nacl/renderer/ppb_nacl_private_impl.cc

Issue 186973002: Add RenderThread::GetShutdownEvent(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Build fix Created 6 years, 9 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 | « no previous file | content/public/renderer/render_thread.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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "components/nacl/renderer/ppb_nacl_private_impl.h" 5 #include "components/nacl/renderer/ppb_nacl_private_impl.h"
6 6
7 #ifndef DISABLE_NACL 7 #ifndef DISABLE_NACL
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/lazy_instance.h" 10 #include "base/lazy_instance.h"
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 70
71 base::LazyInstance<InstanceInfoMap> g_instance_info = 71 base::LazyInstance<InstanceInfoMap> g_instance_info =
72 LAZY_INSTANCE_INITIALIZER; 72 LAZY_INSTANCE_INITIALIZER;
73 73
74 typedef std::map<PP_Instance, nacl::TrustedPluginChannel*> 74 typedef std::map<PP_Instance, nacl::TrustedPluginChannel*>
75 InstanceTrustedChannelMap; 75 InstanceTrustedChannelMap;
76 76
77 base::LazyInstance<InstanceTrustedChannelMap> g_channel_map = 77 base::LazyInstance<InstanceTrustedChannelMap> g_channel_map =
78 LAZY_INSTANCE_INITIALIZER; 78 LAZY_INSTANCE_INITIALIZER;
79 79
80 base::WaitableEvent* g_shutdown_event;
81
82 void HistogramEnumerate(const std::string& name, 80 void HistogramEnumerate(const std::string& name,
83 int32_t sample, 81 int32_t sample,
84 int32_t boundary_value) { 82 int32_t boundary_value) {
85 base::HistogramBase* counter = 83 base::HistogramBase* counter =
86 base::LinearHistogram::FactoryGet( 84 base::LinearHistogram::FactoryGet(
87 name, 85 name,
88 1, 86 1,
89 boundary_value, 87 boundary_value,
90 boundary_value + 1, 88 boundary_value + 1,
91 base::HistogramBase::kUmaTargetedHistogramFlag); 89 base::HistogramBase::kUmaTargetedHistogramFlag);
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 if (!invalid_handle) 186 if (!invalid_handle)
189 g_instance_info.Get()[instance] = instance_info; 187 g_instance_info.Get()[instance] = instance_info;
190 188
191 // Stash the trusted handle as well. 189 // Stash the trusted handle as well.
192 invalid_handle = launch_result.trusted_ipc_channel_handle.name.empty(); 190 invalid_handle = launch_result.trusted_ipc_channel_handle.name.empty();
193 #if defined(OS_POSIX) 191 #if defined(OS_POSIX)
194 if (!invalid_handle) 192 if (!invalid_handle)
195 invalid_handle = (launch_result.trusted_ipc_channel_handle.socket.fd == -1); 193 invalid_handle = (launch_result.trusted_ipc_channel_handle.socket.fd == -1);
196 #endif 194 #endif
197 if (!invalid_handle) { 195 if (!invalid_handle) {
198 if (g_shutdown_event == NULL)
199 g_shutdown_event = new base::WaitableEvent(true, false);
200 g_channel_map.Get()[instance] = new nacl::TrustedPluginChannel( 196 g_channel_map.Get()[instance] = new nacl::TrustedPluginChannel(
201 launch_result.trusted_ipc_channel_handle, callback, g_shutdown_event); 197 launch_result.trusted_ipc_channel_handle, callback,
198 content::RenderThread::Get()->GetShutdownEvent());
202 } 199 }
203 200
204 *(static_cast<NaClHandle*>(imc_handle)) = 201 *(static_cast<NaClHandle*>(imc_handle)) =
205 nacl::ToNativeHandle(result_socket); 202 nacl::ToNativeHandle(result_socket);
206 } 203 }
207 204
208 PP_ExternalPluginResult StartPpapiProxy(PP_Instance instance) { 205 PP_ExternalPluginResult StartPpapiProxy(PP_Instance instance) {
209 InstanceInfoMap& map = g_instance_info.Get(); 206 InstanceInfoMap& map = g_instance_info.Get();
210 InstanceInfoMap::iterator it = map.find(instance); 207 InstanceInfoMap::iterator it = map.find(instance);
211 if (it == map.end()) { 208 if (it == map.end()) {
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after
562 559
563 namespace nacl { 560 namespace nacl {
564 561
565 const PPB_NaCl_Private* GetNaClPrivateInterface() { 562 const PPB_NaCl_Private* GetNaClPrivateInterface() {
566 return &nacl_interface; 563 return &nacl_interface;
567 } 564 }
568 565
569 } // namespace nacl 566 } // namespace nacl
570 567
571 #endif // DISABLE_NACL 568 #endif // DISABLE_NACL
OLDNEW
« no previous file with comments | « no previous file | content/public/renderer/render_thread.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698