| OLD | NEW |
| 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 "mojo/system/dispatcher.h" | 5 #include "mojo/system/dispatcher.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "mojo/system/constants.h" | 8 #include "mojo/system/constants.h" |
| 9 #include "mojo/system/message_pipe_dispatcher.h" | 9 #include "mojo/system/message_pipe_dispatcher.h" |
| 10 | 10 |
| (...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 if (is_closed_) | 184 if (is_closed_) |
| 185 return MOJO_RESULT_INVALID_ARGUMENT; | 185 return MOJO_RESULT_INVALID_ARGUMENT; |
| 186 | 186 |
| 187 return DuplicateBufferHandleImplNoLock(options, new_dispatcher); | 187 return DuplicateBufferHandleImplNoLock(options, new_dispatcher); |
| 188 } | 188 } |
| 189 | 189 |
| 190 MojoResult Dispatcher::MapBuffer( | 190 MojoResult Dispatcher::MapBuffer( |
| 191 uint64_t offset, | 191 uint64_t offset, |
| 192 uint64_t num_bytes, | 192 uint64_t num_bytes, |
| 193 MojoMapBufferFlags flags, | 193 MojoMapBufferFlags flags, |
| 194 scoped_ptr<RawSharedBuffer::Mapping>* mapping) { | 194 scoped_ptr<RawSharedBufferMapping>* mapping) { |
| 195 base::AutoLock locker(lock_); | 195 base::AutoLock locker(lock_); |
| 196 if (is_closed_) | 196 if (is_closed_) |
| 197 return MOJO_RESULT_INVALID_ARGUMENT; | 197 return MOJO_RESULT_INVALID_ARGUMENT; |
| 198 | 198 |
| 199 return MapBufferImplNoLock(offset, num_bytes, flags, mapping); | 199 return MapBufferImplNoLock(offset, num_bytes, flags, mapping); |
| 200 } | 200 } |
| 201 | 201 |
| 202 MojoResult Dispatcher::AddWaiter(Waiter* waiter, | 202 MojoResult Dispatcher::AddWaiter(Waiter* waiter, |
| 203 MojoWaitFlags flags, | 203 MojoWaitFlags flags, |
| 204 MojoResult wake_result) { | 204 MojoResult wake_result) { |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 320 lock_.AssertAcquired(); | 320 lock_.AssertAcquired(); |
| 321 DCHECK(!is_closed_); | 321 DCHECK(!is_closed_); |
| 322 // By default, not supported. Only needed for buffer dispatchers. | 322 // By default, not supported. Only needed for buffer dispatchers. |
| 323 return MOJO_RESULT_INVALID_ARGUMENT; | 323 return MOJO_RESULT_INVALID_ARGUMENT; |
| 324 } | 324 } |
| 325 | 325 |
| 326 MojoResult Dispatcher::MapBufferImplNoLock( | 326 MojoResult Dispatcher::MapBufferImplNoLock( |
| 327 uint64_t /*offset*/, | 327 uint64_t /*offset*/, |
| 328 uint64_t /*num_bytes*/, | 328 uint64_t /*num_bytes*/, |
| 329 MojoMapBufferFlags /*flags*/, | 329 MojoMapBufferFlags /*flags*/, |
| 330 scoped_ptr<RawSharedBuffer::Mapping>* /*mapping*/) { | 330 scoped_ptr<RawSharedBufferMapping>* /*mapping*/) { |
| 331 lock_.AssertAcquired(); | 331 lock_.AssertAcquired(); |
| 332 DCHECK(!is_closed_); | 332 DCHECK(!is_closed_); |
| 333 // By default, not supported. Only needed for buffer dispatchers. | 333 // By default, not supported. Only needed for buffer dispatchers. |
| 334 return MOJO_RESULT_INVALID_ARGUMENT; | 334 return MOJO_RESULT_INVALID_ARGUMENT; |
| 335 } | 335 } |
| 336 | 336 |
| 337 MojoResult Dispatcher::AddWaiterImplNoLock(Waiter* /*waiter*/, | 337 MojoResult Dispatcher::AddWaiterImplNoLock(Waiter* /*waiter*/, |
| 338 MojoWaitFlags /*flags*/, | 338 MojoWaitFlags /*flags*/, |
| 339 MojoResult /*wake_result*/) { | 339 MojoResult /*wake_result*/) { |
| 340 lock_.AssertAcquired(); | 340 lock_.AssertAcquired(); |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 440 // DispatcherTransport --------------------------------------------------------- | 440 // DispatcherTransport --------------------------------------------------------- |
| 441 | 441 |
| 442 void DispatcherTransport::End() { | 442 void DispatcherTransport::End() { |
| 443 DCHECK(dispatcher_); | 443 DCHECK(dispatcher_); |
| 444 dispatcher_->lock_.Release(); | 444 dispatcher_->lock_.Release(); |
| 445 dispatcher_ = NULL; | 445 dispatcher_ = NULL; |
| 446 } | 446 } |
| 447 | 447 |
| 448 } // namespace system | 448 } // namespace system |
| 449 } // namespace mojo | 449 } // namespace mojo |
| OLD | NEW |