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

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

Issue 1353683005: EDK: Convert remaining scoped_ptr -> std::unique_ptr in //mojo/edk/system. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 3 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
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/local_message_pipe_endpoint.h" 5 #include "mojo/edk/system/local_message_pipe_endpoint.h"
6 6
7 #include <string.h> 7 #include <string.h>
8 8
9 #include <utility>
10
9 #include "base/logging.h" 11 #include "base/logging.h"
10 #include "mojo/edk/system/dispatcher.h" 12 #include "mojo/edk/system/dispatcher.h"
11 #include "mojo/edk/system/message_in_transit.h" 13 #include "mojo/edk/system/message_in_transit.h"
12 14
13 namespace mojo { 15 namespace mojo {
14 namespace system { 16 namespace system {
15 17
16 LocalMessagePipeEndpoint::LocalMessagePipeEndpoint( 18 LocalMessagePipeEndpoint::LocalMessagePipeEndpoint(
17 MessageInTransitQueue* message_queue) 19 MessageInTransitQueue* message_queue)
18 : is_open_(true), is_peer_open_(true) { 20 : is_open_(true), is_peer_open_(true) {
(...skipping 18 matching lines...) Expand all
37 is_peer_open_ = false; 39 is_peer_open_ = false;
38 HandleSignalsState new_state = GetHandleSignalsState(); 40 HandleSignalsState new_state = GetHandleSignalsState();
39 41
40 if (!new_state.equals(old_state)) 42 if (!new_state.equals(old_state))
41 awakable_list_.AwakeForStateChange(new_state); 43 awakable_list_.AwakeForStateChange(new_state);
42 44
43 return true; 45 return true;
44 } 46 }
45 47
46 void LocalMessagePipeEndpoint::EnqueueMessage( 48 void LocalMessagePipeEndpoint::EnqueueMessage(
47 scoped_ptr<MessageInTransit> message) { 49 std::unique_ptr<MessageInTransit> message) {
48 DCHECK(is_open_); 50 DCHECK(is_open_);
49 DCHECK(is_peer_open_); 51 DCHECK(is_peer_open_);
50 52
51 bool was_empty = message_queue_.IsEmpty(); 53 bool was_empty = message_queue_.IsEmpty();
52 message_queue_.AddMessage(message.Pass()); 54 message_queue_.AddMessage(std::move(message));
53 if (was_empty) 55 if (was_empty)
54 awakable_list_.AwakeForStateChange(GetHandleSignalsState()); 56 awakable_list_.AwakeForStateChange(GetHandleSignalsState());
55 } 57 }
56 58
57 void LocalMessagePipeEndpoint::Close() { 59 void LocalMessagePipeEndpoint::Close() {
58 DCHECK(is_open_); 60 DCHECK(is_open_);
59 is_open_ = false; 61 is_open_ = false;
60 message_queue_.Clear(); 62 message_queue_.Clear();
61 } 63 }
62 64
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
174 Awakable* awakable, 176 Awakable* awakable,
175 HandleSignalsState* signals_state) { 177 HandleSignalsState* signals_state) {
176 DCHECK(is_open_); 178 DCHECK(is_open_);
177 awakable_list_.Remove(awakable); 179 awakable_list_.Remove(awakable);
178 if (signals_state) 180 if (signals_state)
179 *signals_state = GetHandleSignalsState(); 181 *signals_state = GetHandleSignalsState();
180 } 182 }
181 183
182 } // namespace system 184 } // namespace system
183 } // namespace mojo 185 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/edk/system/local_message_pipe_endpoint.h ('k') | mojo/edk/system/master_connection_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698