| 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/data_pipe_producer_dispatcher.h" | 5 #include "mojo/system/data_pipe_producer_dispatcher.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "mojo/system/data_pipe.h" | 8 #include "mojo/system/data_pipe.h" |
| 9 #include "mojo/system/memory.h" | 9 #include "mojo/system/memory.h" |
| 10 | 10 |
| 11 namespace mojo { | 11 namespace mojo { |
| 12 namespace system { | 12 namespace system { |
| 13 | 13 |
| 14 DataPipeProducerDispatcher::DataPipeProducerDispatcher() { | 14 DataPipeProducerDispatcher::DataPipeProducerDispatcher() { |
| 15 } | 15 } |
| 16 | 16 |
| 17 void DataPipeProducerDispatcher::Init(scoped_refptr<DataPipe> data_pipe) { | 17 void DataPipeProducerDispatcher::Init(scoped_refptr<DataPipe> data_pipe) { |
| 18 DCHECK(data_pipe.get()); | 18 DCHECK(data_pipe.get()); |
| 19 data_pipe_ = data_pipe; | 19 data_pipe_ = data_pipe; |
| 20 } | 20 } |
| 21 | 21 |
| 22 Dispatcher::Type DataPipeProducerDispatcher::GetType() { |
| 23 return kTypeDataPipeProducer; |
| 24 } |
| 25 |
| 22 DataPipeProducerDispatcher::~DataPipeProducerDispatcher() { | 26 DataPipeProducerDispatcher::~DataPipeProducerDispatcher() { |
| 23 // |Close()|/|CloseImplNoLock()| should have taken care of the pipe. | 27 // |Close()|/|CloseImplNoLock()| should have taken care of the pipe. |
| 24 DCHECK(!data_pipe_.get()); | 28 DCHECK(!data_pipe_.get()); |
| 25 } | 29 } |
| 26 | 30 |
| 27 void DataPipeProducerDispatcher::CancelAllWaitersNoLock() { | 31 void DataPipeProducerDispatcher::CancelAllWaitersNoLock() { |
| 28 lock().AssertAcquired(); | 32 lock().AssertAcquired(); |
| 29 data_pipe_->ProducerCancelAllWaiters(); | 33 data_pipe_->ProducerCancelAllWaiters(); |
| 30 } | 34 } |
| 31 | 35 |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 | 101 |
| 98 scoped_refptr<DataPipeProducerDispatcher> rv = | 102 scoped_refptr<DataPipeProducerDispatcher> rv = |
| 99 new DataPipeProducerDispatcher(); | 103 new DataPipeProducerDispatcher(); |
| 100 rv->Init(data_pipe_); | 104 rv->Init(data_pipe_); |
| 101 data_pipe_ = NULL; | 105 data_pipe_ = NULL; |
| 102 return scoped_refptr<Dispatcher>(rv.get()); | 106 return scoped_refptr<Dispatcher>(rv.get()); |
| 103 } | 107 } |
| 104 | 108 |
| 105 } // namespace system | 109 } // namespace system |
| 106 } // namespace mojo | 110 } // namespace mojo |
| OLD | NEW |