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

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

Issue 2232273003: Update DataPipeConsumerDispatcher state when deserialized (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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 | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_consumer_dispatcher.h" 5 #include "mojo/edk/system/data_pipe_consumer_dispatcher.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 403 matching lines...) Expand 10 before | Expand all | Expand 10 after
414 new DataPipeConsumerDispatcher(node_controller, port, ring_buffer, 414 new DataPipeConsumerDispatcher(node_controller, port, ring_buffer,
415 state->options, false /* initialized */, 415 state->options, false /* initialized */,
416 state->pipe_id); 416 state->pipe_id);
417 417
418 { 418 {
419 base::AutoLock lock(dispatcher->lock_); 419 base::AutoLock lock(dispatcher->lock_);
420 dispatcher->read_offset_ = state->read_offset; 420 dispatcher->read_offset_ = state->read_offset;
421 dispatcher->bytes_available_ = state->bytes_available; 421 dispatcher->bytes_available_ = state->bytes_available;
422 dispatcher->peer_closed_ = state->flags & kFlagPeerClosed; 422 dispatcher->peer_closed_ = state->flags & kFlagPeerClosed;
423 dispatcher->InitializeNoLock(); 423 dispatcher->InitializeNoLock();
424 dispatcher->UpdateSignalsStateNoLock();
424 } 425 }
425 426
426 return dispatcher; 427 return dispatcher;
427 } 428 }
428 429
429 DataPipeConsumerDispatcher::~DataPipeConsumerDispatcher() { 430 DataPipeConsumerDispatcher::~DataPipeConsumerDispatcher() {
430 DCHECK(is_closed_ && !shared_ring_buffer_ && !ring_buffer_mapping_ && 431 DCHECK(is_closed_ && !shared_ring_buffer_ && !ring_buffer_mapping_ &&
431 !in_transit_); 432 !in_transit_);
432 } 433 }
433 434
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
563 } 564 }
564 565
565 if (peer_closed_ != was_peer_closed || 566 if (peer_closed_ != was_peer_closed ||
566 bytes_available_ != previous_bytes_available) { 567 bytes_available_ != previous_bytes_available) {
567 awakable_list_.AwakeForStateChange(GetHandleSignalsStateNoLock()); 568 awakable_list_.AwakeForStateChange(GetHandleSignalsStateNoLock());
568 } 569 }
569 } 570 }
570 571
571 } // namespace edk 572 } // namespace edk
572 } // namespace mojo 573 } // namespace mojo
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698