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

Side by Side Diff: remoting/protocol/client_control_dispatcher.cc

Issue 1864213002: Convert //remoting to use std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Mac IWYU Created 4 years, 8 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "remoting/protocol/client_control_dispatcher.h" 5 #include "remoting/protocol/client_control_dispatcher.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include "base/bind_helpers.h" 9 #include "base/bind_helpers.h"
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 } 105 }
106 106
107 void ClientControlDispatcher::DeliverClientMessage( 107 void ClientControlDispatcher::DeliverClientMessage(
108 const ExtensionMessage& message) { 108 const ExtensionMessage& message) {
109 ControlMessage control_message; 109 ControlMessage control_message;
110 control_message.mutable_extension_message()->CopyFrom(message); 110 control_message.mutable_extension_message()->CopyFrom(message);
111 message_pipe()->Send(&control_message, base::Closure()); 111 message_pipe()->Send(&control_message, base::Closure());
112 } 112 }
113 113
114 void ClientControlDispatcher::OnIncomingMessage( 114 void ClientControlDispatcher::OnIncomingMessage(
115 scoped_ptr<CompoundBuffer> buffer) { 115 std::unique_ptr<CompoundBuffer> buffer) {
116 DCHECK(client_stub_); 116 DCHECK(client_stub_);
117 DCHECK(clipboard_stub_); 117 DCHECK(clipboard_stub_);
118 118
119 scoped_ptr<ControlMessage> message = 119 std::unique_ptr<ControlMessage> message =
120 ParseMessage<ControlMessage>(buffer.get()); 120 ParseMessage<ControlMessage>(buffer.get());
121 if (!message) 121 if (!message)
122 return; 122 return;
123 123
124 if (message->has_clipboard_event()) { 124 if (message->has_clipboard_event()) {
125 clipboard_stub_->InjectClipboardEvent(message->clipboard_event()); 125 clipboard_stub_->InjectClipboardEvent(message->clipboard_event());
126 } else if (message->has_capabilities()) { 126 } else if (message->has_capabilities()) {
127 client_stub_->SetCapabilities(message->capabilities()); 127 client_stub_->SetCapabilities(message->capabilities());
128 } else if (message->has_cursor_shape()) { 128 } else if (message->has_cursor_shape()) {
129 if (CursorShapeIsValid(message->cursor_shape())) 129 if (CursorShapeIsValid(message->cursor_shape()))
130 client_stub_->SetCursorShape(message->cursor_shape()); 130 client_stub_->SetCursorShape(message->cursor_shape());
131 } else if (message->has_pairing_response()) { 131 } else if (message->has_pairing_response()) {
132 client_stub_->SetPairingResponse(message->pairing_response()); 132 client_stub_->SetPairingResponse(message->pairing_response());
133 } else if (message->has_extension_message()) { 133 } else if (message->has_extension_message()) {
134 client_stub_->DeliverHostMessage(message->extension_message()); 134 client_stub_->DeliverHostMessage(message->extension_message());
135 } else if (message->has_video_layout()) { 135 } else if (message->has_video_layout()) {
136 client_stub_->SetVideoLayout(message->video_layout()); 136 client_stub_->SetVideoLayout(message->video_layout());
137 } else { 137 } else {
138 LOG(WARNING) << "Unknown control message received."; 138 LOG(WARNING) << "Unknown control message received.";
139 } 139 }
140 } 140 }
141 141
142 } // namespace protocol 142 } // namespace protocol
143 } // namespace remoting 143 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/protocol/client_control_dispatcher.h ('k') | remoting/protocol/client_event_dispatcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698