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/single_thread_task_runner.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" |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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::SingleThreadTaskRunner> io_task_runner, | 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 // TODO(erikchen): fixme |
72 channel_ = IPC::ChannelProxy::Create(handle, IPC::Channel::MODE_SERVER, | 73 channel_ = IPC::ChannelProxy::Create(handle, IPC::Channel::MODE_SERVER, |
73 NULL, // Listener | 74 NULL, // Listener |
74 io_task_runner.get()); | 75 io_task_runner.get(), nullptr); |
75 channel_->AddFilter(filter_.get()); | 76 channel_->AddFilter(filter_.get()); |
76 } | 77 } |
77 | 78 |
78 ManifestService::~ManifestService() { | 79 ManifestService::~ManifestService() { |
79 } | 80 } |
80 | 81 |
81 void ManifestService::StartupInitializationComplete() { | 82 void ManifestService::StartupInitializationComplete() { |
82 filter_->Send(new PpapiHostMsg_StartupInitializationComplete); | 83 filter_->Send(new PpapiHostMsg_StartupInitializationComplete); |
83 } | 84 } |
84 | 85 |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 | 163 |
163 ManifestService* manifest_service = GetManifestService(); | 164 ManifestService* manifest_service = GetManifestService(); |
164 if (manifest_service == NULL || | 165 if (manifest_service == NULL || |
165 !manifest_service->OpenResource(file, fd)) { | 166 !manifest_service->OpenResource(file, fd)) { |
166 return NACL_ABI_EIO; | 167 return NACL_ABI_EIO; |
167 } | 168 } |
168 return (*fd == -1) ? NACL_ABI_ENOENT : 0; | 169 return (*fd == -1) ? NACL_ABI_ENOENT : 0; |
169 } | 170 } |
170 | 171 |
171 } // namespace ppapi | 172 } // namespace ppapi |
OLD | NEW |