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

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

Issue 6030007: Chromoting protocol layers to receive and send login messages (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix comments Created 9 years, 12 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
« no previous file with comments | « remoting/protocol/client_stub.h ('k') | remoting/protocol/host_control_sender.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 // This stub is thread safe because of the use of BufferedSocketWriter.
6 // BufferedSocketWriter buffers messages and send them on them right thread.
7
8 #include "remoting/protocol/client_stub_impl.h"
9
10 #include "base/task.h"
11 #include "remoting/protocol/buffered_socket_writer.h"
12 #include "remoting/proto/control.pb.h"
13 #include "remoting/protocol/util.h"
14
15 namespace remoting {
16 namespace protocol {
17
18 ClientStubImpl::ClientStubImpl(net::Socket* socket)
19 : buffered_writer_(new BufferedSocketWriter()) {
20 buffered_writer_->Init(socket, NULL);
21 }
22
23 ClientStubImpl::~ClientStubImpl() {
24 }
25
26 void ClientStubImpl::NotifyResolution(
27 const NotifyResolutionRequest& msg, Task* done) {
28 ControlMessage message;
29 message.mutable_notify_resolution()->CopyFrom(msg);
30 buffered_writer_->Write(SerializeAndFrameMessage(message));
31 if (done) {
32 done->Run();
33 delete done;
34 }
35 }
36
37 } // namespace protocol
38 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/protocol/client_stub.h ('k') | remoting/protocol/host_control_sender.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698