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/manifest_service.h" | 5 #include "ppapi/nacl_irt/manifest_service.h" |
6 | 6 |
7 #include "base/message_loop/message_loop_proxy.h" | 7 #include "base/single_thread_task_runner.h" |
8 #include "ipc/ipc_channel_handle.h" | 8 #include "ipc/ipc_channel_handle.h" |
9 #include "ipc/ipc_channel_proxy.h" | 9 #include "ipc/ipc_channel_proxy.h" |
10 #include "ipc/ipc_sync_message_filter.h" | 10 #include "ipc/ipc_sync_message_filter.h" |
11 #include "native_client/src/trusted/service_runtime/include/sys/errno.h" | 11 #include "native_client/src/trusted/service_runtime/include/sys/errno.h" |
12 #include "ppapi/nacl_irt/irt_manifest.h" | 12 #include "ppapi/nacl_irt/irt_manifest.h" |
13 #include "ppapi/nacl_irt/plugin_startup.h" | 13 #include "ppapi/nacl_irt/plugin_startup.h" |
14 #include "ppapi/proxy/ppapi_messages.h" | 14 #include "ppapi/proxy/ppapi_messages.h" |
15 | 15 |
16 #if !defined(OS_NACL_SFI) | 16 #if !defined(OS_NACL_SFI) |
17 #include <pthread.h> | 17 #include <pthread.h> |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 } | 59 } |
60 | 60 |
61 private: | 61 private: |
62 base::WaitableEvent connected_event_; | 62 base::WaitableEvent connected_event_; |
63 | 63 |
64 DISALLOW_COPY_AND_ASSIGN(ManifestMessageFilter); | 64 DISALLOW_COPY_AND_ASSIGN(ManifestMessageFilter); |
65 }; | 65 }; |
66 | 66 |
67 ManifestService::ManifestService( | 67 ManifestService::ManifestService( |
68 const IPC::ChannelHandle& handle, | 68 const IPC::ChannelHandle& handle, |
69 scoped_refptr<base::MessageLoopProxy> io_message_loop, | 69 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner, |
70 base::WaitableEvent* shutdown_event) { | 70 base::WaitableEvent* shutdown_event) { |
71 filter_ = new ManifestMessageFilter(shutdown_event); | 71 filter_ = new ManifestMessageFilter(shutdown_event); |
72 channel_ = IPC::ChannelProxy::Create(handle, | 72 channel_ = IPC::ChannelProxy::Create(handle, IPC::Channel::MODE_SERVER, |
73 IPC::Channel::MODE_SERVER, | |
74 NULL, // Listener | 73 NULL, // Listener |
75 io_message_loop.get()); | 74 io_task_runner.get()); |
76 channel_->AddFilter(filter_.get()); | 75 channel_->AddFilter(filter_.get()); |
77 } | 76 } |
78 | 77 |
79 ManifestService::~ManifestService() { | 78 ManifestService::~ManifestService() { |
80 } | 79 } |
81 | 80 |
82 void ManifestService::StartupInitializationComplete() { | 81 void ManifestService::StartupInitializationComplete() { |
83 filter_->Send(new PpapiHostMsg_StartupInitializationComplete); | 82 filter_->Send(new PpapiHostMsg_StartupInitializationComplete); |
84 } | 83 } |
85 | 84 |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 | 162 |
164 ManifestService* manifest_service = GetManifestService(); | 163 ManifestService* manifest_service = GetManifestService(); |
165 if (manifest_service == NULL || | 164 if (manifest_service == NULL || |
166 !manifest_service->OpenResource(file, fd)) { | 165 !manifest_service->OpenResource(file, fd)) { |
167 return NACL_ABI_EIO; | 166 return NACL_ABI_EIO; |
168 } | 167 } |
169 return (*fd == -1) ? NACL_ABI_ENOENT : 0; | 168 return (*fd == -1) ? NACL_ABI_ENOENT : 0; |
170 } | 169 } |
171 | 170 |
172 } // namespace ppapi | 171 } // namespace ppapi |
OLD | NEW |