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

Side by Side Diff: ppapi/nacl_irt/plugin_startup.cc

Issue 200283002: Fix the crash for the AudioShared. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@open_resource3
Patch Set: Created 6 years, 8 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
« no previous file with comments | « ppapi/nacl_irt/plugin_main.cc ('k') | ppapi/shared_impl/ppb_audio_shared.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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/nacl_irt/plugin_startup.h" 5 #include "ppapi/nacl_irt/plugin_startup.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/file_descriptor_posix.h" 8 #include "base/file_descriptor_posix.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/synchronization/waitable_event.h" 10 #include "base/synchronization/waitable_event.h"
11 #include "base/threading/thread.h" 11 #include "base/threading/thread.h"
12 #include "ipc/ipc_channel_handle.h" 12 #include "ipc/ipc_channel_handle.h"
13 #include "ppapi/nacl_irt/manifest_service.h" 13 #include "ppapi/nacl_irt/manifest_service.h"
14 #include "ppapi/shared_impl/ppb_audio_shared.h"
14 15
15 namespace ppapi { 16 namespace ppapi {
16 namespace { 17 namespace {
17 18
18 int g_nacl_browser_ipc_fd = -1; 19 int g_nacl_browser_ipc_fd = -1;
19 int g_nacl_renderer_ipc_fd = -1; 20 int g_nacl_renderer_ipc_fd = -1;
20 int g_manifest_service_fd = -1; 21 int g_manifest_service_fd = -1;
21 22
22 base::WaitableEvent* g_shutdown_event = NULL; 23 base::WaitableEvent* g_shutdown_event = NULL;
23 base::Thread* g_io_thread = NULL; 24 base::Thread* g_io_thread = NULL;
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 // even before irt_ppapi_start invocation. 73 // even before irt_ppapi_start invocation.
73 // TODO(hidehiko,dmichael): This works, but is probably not well designed 74 // TODO(hidehiko,dmichael): This works, but is probably not well designed
74 // usage. Once a better approach is made, replace this by that way. 75 // usage. Once a better approach is made, replace this by that way.
75 // (crbug.com/364241). 76 // (crbug.com/364241).
76 base::WaitableEvent event(true, false); 77 base::WaitableEvent event(true, false);
77 g_io_thread->message_loop_proxy()->PostTask( 78 g_io_thread->message_loop_proxy()->PostTask(
78 FROM_HERE, 79 FROM_HERE,
79 base::Bind(StartUpManifestServiceOnIOThread, &event)); 80 base::Bind(StartUpManifestServiceOnIOThread, &event));
80 event.Wait(); 81 event.Wait();
81 } 82 }
83
84 PPB_Audio_Shared::SetNaClMode();
82 } 85 }
83 86
84 int GetBrowserIPCFileDescriptor() { 87 int GetBrowserIPCFileDescriptor() {
85 // The descriptor must be initialized in advance. 88 // The descriptor must be initialized in advance.
86 DCHECK_NE(g_nacl_browser_ipc_fd, -1); 89 DCHECK_NE(g_nacl_browser_ipc_fd, -1);
87 return g_nacl_browser_ipc_fd; 90 return g_nacl_browser_ipc_fd;
88 } 91 }
89 92
90 int GetRendererIPCFileDescriptor() { 93 int GetRendererIPCFileDescriptor() {
91 // The descriptor must be initialized in advance. 94 // The descriptor must be initialized in advance.
(...skipping 11 matching lines...) Expand all
103 // The IOThread must be initialized in advance. 106 // The IOThread must be initialized in advance.
104 DCHECK(g_io_thread); 107 DCHECK(g_io_thread);
105 return g_io_thread; 108 return g_io_thread;
106 } 109 }
107 110
108 ManifestService* GetManifestService() { 111 ManifestService* GetManifestService() {
109 return g_manifest_service; 112 return g_manifest_service;
110 } 113 }
111 114
112 } // namespace ppapi 115 } // namespace ppapi
OLDNEW
« no previous file with comments | « ppapi/nacl_irt/plugin_main.cc ('k') | ppapi/shared_impl/ppb_audio_shared.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698