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

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

Issue 10556020: Cleaned up the reader and writer create methods to return scoped_ptr. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 6 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 | Annotate | Revision Log
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/connection_to_client.h" 5 #include "remoting/protocol/connection_to_client.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/location.h" 8 #include "base/location.h"
9 #include "base/message_loop_proxy.h" 9 #include "base/message_loop_proxy.h"
10 #include "google/protobuf/message.h" 10 #include "google/protobuf/message.h"
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 control_dispatcher_->set_clipboard_stub(clipboard_stub_); 109 control_dispatcher_->set_clipboard_stub(clipboard_stub_);
110 control_dispatcher_->set_host_stub(host_stub_); 110 control_dispatcher_->set_host_stub(host_stub_);
111 111
112 event_dispatcher_.reset(new HostEventDispatcher()); 112 event_dispatcher_.reset(new HostEventDispatcher());
113 event_dispatcher_->Init(session_.get(), base::Bind( 113 event_dispatcher_->Init(session_.get(), base::Bind(
114 &ConnectionToClient::OnChannelInitialized, base::Unretained(this))); 114 &ConnectionToClient::OnChannelInitialized, base::Unretained(this)));
115 event_dispatcher_->set_input_stub(input_stub_); 115 event_dispatcher_->set_input_stub(input_stub_);
116 event_dispatcher_->set_sequence_number_callback(base::Bind( 116 event_dispatcher_->set_sequence_number_callback(base::Bind(
117 &ConnectionToClient::UpdateSequenceNumber, base::Unretained(this))); 117 &ConnectionToClient::UpdateSequenceNumber, base::Unretained(this)));
118 118
119 video_writer_.reset(VideoWriter::Create(session_->config())); 119 video_writer_.reset();
Sergey Ulanov 2012/06/15 20:41:43 You don't need to reset it here. The assignment sh
kxing 2012/06/15 20:48:17 Done.
120 video_writer_ = VideoWriter::Create(session_->config());
120 video_writer_->Init(session_.get(), base::Bind( 121 video_writer_->Init(session_.get(), base::Bind(
121 &ConnectionToClient::OnChannelInitialized, base::Unretained(this))); 122 &ConnectionToClient::OnChannelInitialized, base::Unretained(this)));
122 123
123 // Notify the handler after initializing the channels, so that 124 // Notify the handler after initializing the channels, so that
124 // ClientSession can get a client clipboard stub. 125 // ClientSession can get a client clipboard stub.
125 handler_->OnConnectionAuthenticated(this); 126 handler_->OnConnectionAuthenticated(this);
126 break; 127 break;
127 128
128 case Session::CLOSED: 129 case Session::CLOSED:
129 Close(OK); 130 Close(OK);
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 } 170 }
170 171
171 void ConnectionToClient::CloseChannels() { 172 void ConnectionToClient::CloseChannels() {
172 control_dispatcher_.reset(); 173 control_dispatcher_.reset();
173 event_dispatcher_.reset(); 174 event_dispatcher_.reset();
174 video_writer_.reset(); 175 video_writer_.reset();
175 } 176 }
176 177
177 } // namespace protocol 178 } // namespace protocol
178 } // namespace remoting 179 } // namespace remoting
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698