| 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/edk/system/data_pipe_producer_dispatcher.h" | 5 #include "mojo/edk/system/data_pipe_producer_dispatcher.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 396 new DataPipeProducerDispatcher(node_controller, port, ring_buffer, | 396 new DataPipeProducerDispatcher(node_controller, port, ring_buffer, |
| 397 state->options, false /* initialized */, | 397 state->options, false /* initialized */, |
| 398 state->pipe_id); | 398 state->pipe_id); |
| 399 | 399 |
| 400 { | 400 { |
| 401 base::AutoLock lock(dispatcher->lock_); | 401 base::AutoLock lock(dispatcher->lock_); |
| 402 dispatcher->write_offset_ = state->write_offset; | 402 dispatcher->write_offset_ = state->write_offset; |
| 403 dispatcher->available_capacity_ = state->available_capacity; | 403 dispatcher->available_capacity_ = state->available_capacity; |
| 404 dispatcher->peer_closed_ = state->flags & kFlagPeerClosed; | 404 dispatcher->peer_closed_ = state->flags & kFlagPeerClosed; |
| 405 dispatcher->InitializeNoLock(); | 405 dispatcher->InitializeNoLock(); |
| 406 dispatcher->UpdateSignalsStateNoLock(); |
| 406 } | 407 } |
| 407 | 408 |
| 408 return dispatcher; | 409 return dispatcher; |
| 409 } | 410 } |
| 410 | 411 |
| 411 DataPipeProducerDispatcher::~DataPipeProducerDispatcher() { | 412 DataPipeProducerDispatcher::~DataPipeProducerDispatcher() { |
| 412 DCHECK(is_closed_ && !in_transit_ && !shared_ring_buffer_ && | 413 DCHECK(is_closed_ && !in_transit_ && !shared_ring_buffer_ && |
| 413 !ring_buffer_mapping_); | 414 !ring_buffer_mapping_); |
| 414 } | 415 } |
| 415 | 416 |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 540 } | 541 } |
| 541 | 542 |
| 542 if (peer_closed_ != was_peer_closed || | 543 if (peer_closed_ != was_peer_closed || |
| 543 available_capacity_ != previous_capacity) { | 544 available_capacity_ != previous_capacity) { |
| 544 awakable_list_.AwakeForStateChange(GetHandleSignalsStateNoLock()); | 545 awakable_list_.AwakeForStateChange(GetHandleSignalsStateNoLock()); |
| 545 } | 546 } |
| 546 } | 547 } |
| 547 | 548 |
| 548 } // namespace edk | 549 } // namespace edk |
| 549 } // namespace mojo | 550 } // namespace mojo |
| OLD | NEW |