| OLD | NEW |
| 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 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 185 parent->RequestPortMerge(port.name(), token); | 185 parent->RequestPortMerge(port.name(), token); |
| 186 return; | 186 return; |
| 187 } | 187 } |
| 188 | 188 |
| 189 base::AutoLock lock(pending_port_merges_lock_); | 189 base::AutoLock lock(pending_port_merges_lock_); |
| 190 pending_port_merges_.push_back(std::make_pair(token, port)); | 190 pending_port_merges_.push_back(std::make_pair(token, port)); |
| 191 } | 191 } |
| 192 | 192 |
| 193 scoped_refptr<PlatformSharedBuffer> NodeController::CreateSharedBuffer( | 193 scoped_refptr<PlatformSharedBuffer> NodeController::CreateSharedBuffer( |
| 194 size_t num_bytes) { | 194 size_t num_bytes) { |
| 195 #if defined(OS_POSIX) | 195 // TODO(amistry): Fix sync broker and re-enable on OSX. |
| 196 #if defined(OS_POSIX) && !defined(OS_MACOSX) |
| 196 // Shared buffer creation failure is fatal, so always use the broker when we | 197 // Shared buffer creation failure is fatal, so always use the broker when we |
| 197 // have one. This does mean that a non-root process that has children will use | 198 // have one. This does mean that a non-root process that has children will use |
| 198 // the broker for shared buffer creation even though that process is | 199 // the broker for shared buffer creation even though that process is |
| 199 // privileged. | 200 // privileged. |
| 200 if (broker_) { | 201 if (broker_) { |
| 201 return broker_->GetSharedBuffer(num_bytes); | 202 return broker_->GetSharedBuffer(num_bytes); |
| 202 } | 203 } |
| 203 #endif | 204 #endif |
| 204 return PlatformSharedBuffer::Create(num_bytes); | 205 return PlatformSharedBuffer::Create(num_bytes); |
| 205 } | 206 } |
| (...skipping 671 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 877 shutdown_callback_.Reset(); | 878 shutdown_callback_.Reset(); |
| 878 } | 879 } |
| 879 | 880 |
| 880 DCHECK(!callback.is_null()); | 881 DCHECK(!callback.is_null()); |
| 881 | 882 |
| 882 callback.Run(); | 883 callback.Run(); |
| 883 } | 884 } |
| 884 | 885 |
| 885 } // namespace edk | 886 } // namespace edk |
| 886 } // namespace mojo | 887 } // namespace mojo |
| OLD | NEW |