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

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

Issue 1785843002: [mojo] Implement pipe fusion API (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 9 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/node_controller.h ('k') | mojo/edk/system/ports/node.h » ('j') | 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/node_controller.h" 5 #include "mojo/edk/system/node_controller.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <limits> 8 #include <limits>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 base::AutoLock lock(pending_port_merges_lock_); 202 base::AutoLock lock(pending_port_merges_lock_);
203 parent = GetParentChannel(); 203 parent = GetParentChannel();
204 if (!parent) { 204 if (!parent) {
205 pending_port_merges_.push_back(std::make_pair(token, port)); 205 pending_port_merges_.push_back(std::make_pair(token, port));
206 return; 206 return;
207 } 207 }
208 } 208 }
209 parent->RequestPortMerge(port.name(), token); 209 parent->RequestPortMerge(port.name(), token);
210 } 210 }
211 211
212 int NodeController::MergeLocalPorts(const ports::PortRef& port0,
213 const ports::PortRef& port1) {
214 int rv = node_->MergeLocalPorts(port0, port1);
215 AcceptIncomingMessages();
216 return rv;
217 }
218
212 scoped_refptr<PlatformSharedBuffer> NodeController::CreateSharedBuffer( 219 scoped_refptr<PlatformSharedBuffer> NodeController::CreateSharedBuffer(
213 size_t num_bytes) { 220 size_t num_bytes) {
214 // TODO(amistry): Fix sync broker and re-enable on OSX. 221 // TODO(amistry): Fix sync broker and re-enable on OSX.
215 #if defined(OS_POSIX) && !defined(OS_MACOSX) 222 #if defined(OS_POSIX) && !defined(OS_MACOSX)
216 // Shared buffer creation failure is fatal, so always use the broker when we 223 // Shared buffer creation failure is fatal, so always use the broker when we
217 // have one. This does mean that a non-root process that has children will use 224 // have one. This does mean that a non-root process that has children will use
218 // the broker for shared buffer creation even though that process is 225 // the broker for shared buffer creation even though that process is
219 // privileged. 226 // privileged.
220 if (broker_) { 227 if (broker_) {
221 return broker_->GetSharedBuffer(num_bytes); 228 return broker_->GetSharedBuffer(num_bytes);
(...skipping 677 matching lines...) Expand 10 before | Expand all | Expand 10 after
899 shutdown_callback_.Reset(); 906 shutdown_callback_.Reset();
900 } 907 }
901 908
902 DCHECK(!callback.is_null()); 909 DCHECK(!callback.is_null());
903 910
904 callback.Run(); 911 callback.Run();
905 } 912 }
906 913
907 } // namespace edk 914 } // namespace edk
908 } // namespace mojo 915 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/edk/system/node_controller.h ('k') | mojo/edk/system/ports/node.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698