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

Side by Side Diff: components/nacl/loader/nacl_listener.cc

Issue 2033243003: Use Mojo pipes to signal sync IPC events (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 6 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
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/loader/nacl_listener.h" 5 #include "components/nacl/loader/nacl_listener.h"
6 6
7 #include <errno.h> 7 #include <errno.h>
8 #include <fcntl.h> 8 #include <fcntl.h>
9 #include <stdlib.h> 9 #include <stdlib.h>
10 #include <string.h> 10 #include <string.h>
(...skipping 13 matching lines...) Expand all
24 #include "components/nacl/common/nacl_renderer_messages.h" 24 #include "components/nacl/common/nacl_renderer_messages.h"
25 #include "components/nacl/common/nacl_switches.h" 25 #include "components/nacl/common/nacl_switches.h"
26 #include "components/nacl/loader/nacl_ipc_adapter.h" 26 #include "components/nacl/loader/nacl_ipc_adapter.h"
27 #include "components/nacl/loader/nacl_validation_db.h" 27 #include "components/nacl/loader/nacl_validation_db.h"
28 #include "components/nacl/loader/nacl_validation_query.h" 28 #include "components/nacl/loader/nacl_validation_query.h"
29 #include "ipc/attachment_broker_unprivileged.h" 29 #include "ipc/attachment_broker_unprivileged.h"
30 #include "ipc/ipc_channel_handle.h" 30 #include "ipc/ipc_channel_handle.h"
31 #include "ipc/ipc_switches.h" 31 #include "ipc/ipc_switches.h"
32 #include "ipc/ipc_sync_channel.h" 32 #include "ipc/ipc_sync_channel.h"
33 #include "ipc/ipc_sync_message_filter.h" 33 #include "ipc/ipc_sync_message_filter.h"
34 #include "mojo/edk/embedder/embedder.h"
34 #include "native_client/src/public/chrome_main.h" 35 #include "native_client/src/public/chrome_main.h"
35 #include "native_client/src/public/nacl_app.h" 36 #include "native_client/src/public/nacl_app.h"
36 #include "native_client/src/public/nacl_desc.h" 37 #include "native_client/src/public/nacl_desc.h"
37 38
38 #if defined(OS_POSIX) 39 #if defined(OS_POSIX)
39 #include "base/file_descriptor_posix.h" 40 #include "base/file_descriptor_posix.h"
40 #endif 41 #endif
41 42
42 #if defined(OS_LINUX) 43 #if defined(OS_LINUX)
43 #include "content/public/common/child_process_sandbox_support_linux.h" 44 #include "content/public/common/child_process_sandbox_support_linux.h"
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 base::WaitableEvent::InitialState::NOT_SIGNALED), 160 base::WaitableEvent::InitialState::NOT_SIGNALED),
160 io_thread_("NaCl_IOThread"), 161 io_thread_("NaCl_IOThread"),
161 #if defined(OS_LINUX) 162 #if defined(OS_LINUX)
162 prereserved_sandbox_size_(0), 163 prereserved_sandbox_size_(0),
163 #endif 164 #endif
164 #if defined(OS_POSIX) 165 #if defined(OS_POSIX)
165 number_of_cores_(-1), // unknown/error 166 number_of_cores_(-1), // unknown/error
166 #endif 167 #endif
167 main_loop_(NULL), 168 main_loop_(NULL),
168 is_started_(false) { 169 is_started_(false) {
170 // The Mojo EDK must be initialized before using IPC.
171 mojo::edk::Init();
Mark Seaborn 2016/06/14 20:43:14 NaClMain() in components/nacl/loader/nacl_main.cc
Ken Rockot(use gerrit already) 2016/06/14 20:53:07 Done
Mark Seaborn 2016/06/15 00:35:49 Sorry, scratch that -- nacl_main.cc is not used fo
172
169 IPC::AttachmentBrokerUnprivileged::CreateBrokerIfNeeded(); 173 IPC::AttachmentBrokerUnprivileged::CreateBrokerIfNeeded();
170 io_thread_.StartWithOptions( 174 io_thread_.StartWithOptions(
171 base::Thread::Options(base::MessageLoop::TYPE_IO, 0)); 175 base::Thread::Options(base::MessageLoop::TYPE_IO, 0));
172 DCHECK(g_listener == NULL); 176 DCHECK(g_listener == NULL);
173 g_listener = this; 177 g_listener = this;
174 } 178 }
175 179
176 NaClListener::~NaClListener() { 180 NaClListener::~NaClListener() {
177 NOTREACHED(); 181 NOTREACHED();
178 shutdown_event_.Signal(); 182 shutdown_event_.Signal();
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after
448 } 452 }
449 453
450 void NaClListener::OnFileTokenResolved( 454 void NaClListener::OnFileTokenResolved(
451 uint64_t token_lo, 455 uint64_t token_lo,
452 uint64_t token_hi, 456 uint64_t token_hi,
453 IPC::PlatformFileForTransit ipc_fd, 457 IPC::PlatformFileForTransit ipc_fd,
454 base::FilePath file_path) { 458 base::FilePath file_path) {
455 resolved_cb_.Run(ipc_fd, file_path); 459 resolved_cb_.Run(ipc_fd, file_path);
456 resolved_cb_.Reset(); 460 resolved_cb_.Reset();
457 } 461 }
OLDNEW
« no previous file with comments | « components/nacl/loader/DEPS ('k') | components/nacl_nonsfi.gyp » ('j') | mojo/mojo_public.gyp » ('J')

Powered by Google App Engine
This is Rietveld 408576698