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

Side by Side Diff: mojo/edk/system/remote_message_pipe_bootstrap.cc

Issue 1712773002: Mojo: Don't allow closed pipe handles to be sent (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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 | « mojo/edk/system/ports/node.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "mojo/edk/system/remote_message_pipe_bootstrap.h" 5 #include "mojo/edk/system/remote_message_pipe_bootstrap.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/thread_task_runner_handle.h" 10 #include "base/thread_task_runner_handle.h"
(...skipping 14 matching lines...) Expand all
25 ports::PortName port_name; 25 ports::PortName port_name;
26 }; 26 };
27 27
28 } // namespace 28 } // namespace
29 29
30 // static 30 // static
31 void RemoteMessagePipeBootstrap::Create( 31 void RemoteMessagePipeBootstrap::Create(
32 NodeController* node_controller, 32 NodeController* node_controller,
33 ScopedPlatformHandle platform_handle, 33 ScopedPlatformHandle platform_handle,
34 const ports::PortRef& port) { 34 const ports::PortRef& port) {
35 CHECK(node_controller);
36 CHECK(node_controller->io_task_runner());
35 if (node_controller->io_task_runner()->RunsTasksOnCurrentThread()) { 37 if (node_controller->io_task_runner()->RunsTasksOnCurrentThread()) {
36 // Owns itself. 38 // Owns itself.
37 new RemoteMessagePipeBootstrap( 39 new RemoteMessagePipeBootstrap(
38 node_controller, std::move(platform_handle), port); 40 node_controller, std::move(platform_handle), port);
39 } else { 41 } else {
40 node_controller->io_task_runner()->PostTask( 42 node_controller->io_task_runner()->PostTask(
41 FROM_HERE, 43 FROM_HERE,
42 base::Bind(&RemoteMessagePipeBootstrap::Create, 44 base::Bind(&RemoteMessagePipeBootstrap::Create,
43 base::Unretained(node_controller), 45 base::Unretained(node_controller),
44 base::Passed(&platform_handle), port)); 46 base::Passed(&platform_handle), port));
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 DCHECK(io_task_runner_->RunsTasksOnCurrentThread()); 140 DCHECK(io_task_runner_->RunsTasksOnCurrentThread());
139 ShutDown(); 141 ShutDown();
140 } 142 }
141 143
142 void RemoteMessagePipeBootstrap::ShutDownNow() { 144 void RemoteMessagePipeBootstrap::ShutDownNow() {
143 delete this; 145 delete this;
144 } 146 }
145 147
146 } // namespace edk 148 } // namespace edk
147 } // namespace mojo 149 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/edk/system/ports/node.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698