OLD | NEW |
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/location.h" | 9 #include "base/location.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 10 matching lines...) Expand all Loading... |
21 | 21 |
22 IPC::ChannelHandle* g_nacl_browser_ipc_handle = nullptr; | 22 IPC::ChannelHandle* g_nacl_browser_ipc_handle = nullptr; |
23 IPC::ChannelHandle* g_nacl_renderer_ipc_handle = nullptr; | 23 IPC::ChannelHandle* g_nacl_renderer_ipc_handle = nullptr; |
24 IPC::ChannelHandle* g_manifest_service_handle = nullptr; | 24 IPC::ChannelHandle* g_manifest_service_handle = nullptr; |
25 | 25 |
26 base::WaitableEvent* g_shutdown_event = NULL; | 26 base::WaitableEvent* g_shutdown_event = NULL; |
27 base::Thread* g_io_thread = NULL; | 27 base::Thread* g_io_thread = NULL; |
28 ManifestService* g_manifest_service = NULL; | 28 ManifestService* g_manifest_service = NULL; |
29 | 29 |
30 bool IsValidChannelHandle(IPC::ChannelHandle* handle) { | 30 bool IsValidChannelHandle(IPC::ChannelHandle* handle) { |
31 // ChannelMojo not yet supported. | 31 return handle && |
32 return handle && handle->socket.fd != -1 && !handle->mojo_handle.is_valid(); | 32 (handle->socket.fd != -1 || handle->mojo_handle.is_valid()); |
33 } | 33 } |
34 | 34 |
35 // Creates the manifest service on IO thread so that its Listener's thread and | 35 // Creates the manifest service on IO thread so that its Listener's thread and |
36 // IO thread are shared. Upon completion of the manifest service creation, | 36 // IO thread are shared. Upon completion of the manifest service creation, |
37 // event is signaled. | 37 // event is signaled. |
38 void StartUpManifestServiceOnIOThread(base::WaitableEvent* event) { | 38 void StartUpManifestServiceOnIOThread(base::WaitableEvent* event) { |
39 // The start up must be called only once. | 39 // The start up must be called only once. |
40 DCHECK(!g_manifest_service); | 40 DCHECK(!g_manifest_service); |
41 // manifest_service_handle must be set. | 41 // manifest_service_handle must be set. |
42 DCHECK(IsValidChannelHandle(g_manifest_service_handle)); | 42 DCHECK(IsValidChannelHandle(g_manifest_service_handle)); |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 // The IOThread must be initialized in advance. | 123 // The IOThread must be initialized in advance. |
124 DCHECK(g_io_thread); | 124 DCHECK(g_io_thread); |
125 return g_io_thread; | 125 return g_io_thread; |
126 } | 126 } |
127 | 127 |
128 ManifestService* GetManifestService() { | 128 ManifestService* GetManifestService() { |
129 return g_manifest_service; | 129 return g_manifest_service; |
130 } | 130 } |
131 | 131 |
132 } // namespace ppapi | 132 } // namespace ppapi |
OLD | NEW |