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

Side by Side Diff: remoting/protocol/connection_to_host.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_host.h" 5 #include "remoting/protocol/connection_to_host.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/location.h" 9 #include "base/location.h"
10 #include "remoting/base/constants.h" 10 #include "remoting/base/constants.h"
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 DCHECK(event_callback_); 151 DCHECK(event_callback_);
152 152
153 switch (state) { 153 switch (state) {
154 case Session::INITIALIZING: 154 case Session::INITIALIZING:
155 case Session::CONNECTING: 155 case Session::CONNECTING:
156 case Session::CONNECTED: 156 case Session::CONNECTED:
157 // Don't care about these events. 157 // Don't care about these events.
158 break; 158 break;
159 159
160 case Session::AUTHENTICATED: 160 case Session::AUTHENTICATED:
161 video_reader_.reset(VideoReader::Create(session_->config())); 161 video_reader_.reset();
Sergey Ulanov 2012/06/15 20:41:43 same here.
kxing 2012/06/15 20:48:17 Done.
162 video_reader_ = VideoReader::Create(session_->config());
162 video_reader_->Init(session_.get(), video_stub_, base::Bind( 163 video_reader_->Init(session_.get(), video_stub_, base::Bind(
163 &ConnectionToHost::OnChannelInitialized, base::Unretained(this))); 164 &ConnectionToHost::OnChannelInitialized, base::Unretained(this)));
164 165
165 control_dispatcher_.reset(new ClientControlDispatcher()); 166 control_dispatcher_.reset(new ClientControlDispatcher());
166 control_dispatcher_->Init(session_.get(), base::Bind( 167 control_dispatcher_->Init(session_.get(), base::Bind(
167 &ConnectionToHost::OnChannelInitialized, base::Unretained(this))); 168 &ConnectionToHost::OnChannelInitialized, base::Unretained(this)));
168 control_dispatcher_->set_client_stub(client_stub_); 169 control_dispatcher_->set_client_stub(client_stub_);
169 control_dispatcher_->set_clipboard_stub(clipboard_stub_); 170 control_dispatcher_->set_clipboard_stub(clipboard_stub_);
170 171
171 event_dispatcher_.reset(new ClientEventDispatcher()); 172 event_dispatcher_.reset(new ClientEventDispatcher());
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
239 240
240 if (state != state_) { 241 if (state != state_) {
241 state_ = state; 242 state_ = state;
242 error_ = error; 243 error_ = error;
243 event_callback_->OnConnectionState(state_, error_); 244 event_callback_->OnConnectionState(state_, error_);
244 } 245 }
245 } 246 }
246 247
247 } // namespace protocol 248 } // namespace protocol
248 } // namespace remoting 249 } // namespace remoting
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698