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

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

Issue 6594138: Block event processing on host/client until the client has authenticated. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add missing source files Created 9 years, 9 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) 2010 The Chromium Authors. All rights reserved. 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 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 #ifndef REMOTING_PROTOCOL_CONNECTION_TO_CLIENT_H_ 5 #ifndef REMOTING_PROTOCOL_CONNECTION_TO_CLIENT_H_
6 #define REMOTING_PROTOCOL_CONNECTION_TO_CLIENT_H_ 6 #define REMOTING_PROTOCOL_CONNECTION_TO_CLIENT_H_
7 7
8 #include <deque> 8 #include <deque>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 // 65 //
66 // After this method is called all the send method calls will be ignored. 66 // After this method is called all the send method calls will be ignored.
67 virtual void Disconnect(); 67 virtual void Disconnect();
68 68
69 // Send encoded update stream data to the viewer. 69 // Send encoded update stream data to the viewer.
70 virtual VideoStub* video_stub(); 70 virtual VideoStub* video_stub();
71 71
72 // Return pointer to ClientStub. 72 // Return pointer to ClientStub.
73 virtual ClientStub* client_stub(); 73 virtual ClientStub* client_stub();
74 74
75 protected: 75 // Record whether the client has been properly authenticated with the host.
76 // Protected constructor used by unit test. 76 void SetClientAuthenticated(bool auth);
77 ConnectionToClient();
78 77
79 private: 78 private:
80 // Callback for protocol Session. 79 // Callback for protocol Session.
81 void OnSessionStateChange(Session::State state); 80 void OnSessionStateChange(Session::State state);
82 81
83 // Process a libjingle state change event on the |loop_|. 82 // Process a libjingle state change event on the |loop_|.
84 void StateChangeTask(Session::State state); 83 void StateChangeTask(Session::State state);
85 84
86 void OnClosed(); 85 void OnClosed();
87 86
87 // Initially false, this is set to true once the client has authenticated
88 // properly. When this is false, many client messages (like input events)
89 // will be ignored.
90 bool client_authenticated_;
91
88 // The libjingle channel used to send and receive data from the remote client. 92 // The libjingle channel used to send and receive data from the remote client.
89 scoped_refptr<Session> session_; 93 scoped_refptr<Session> session_;
90 94
91 scoped_ptr<VideoWriter> video_writer_; 95 scoped_ptr<VideoWriter> video_writer_;
92 96
93 // ClientStub for sending messages to the client. 97 // ClientStub for sending messages to the client.
94 scoped_ptr<ClientStub> client_stub_; 98 scoped_ptr<ClientStub> client_stub_;
95 99
96 // The message loop that this object runs on. 100 // The message loop that this object runs on.
97 MessageLoop* loop_; 101 MessageLoop* loop_;
(...skipping 10 matching lines...) Expand all
108 // Dispatcher for submitting messages to stubs. 112 // Dispatcher for submitting messages to stubs.
109 scoped_ptr<HostMessageDispatcher> dispatcher_; 113 scoped_ptr<HostMessageDispatcher> dispatcher_;
110 114
111 DISALLOW_COPY_AND_ASSIGN(ConnectionToClient); 115 DISALLOW_COPY_AND_ASSIGN(ConnectionToClient);
112 }; 116 };
113 117
114 } // namespace protocol 118 } // namespace protocol
115 } // namespace remoting 119 } // namespace remoting
116 120
117 #endif // REMOTING_PROTOCOL_CONNECTION_TO_CLIENT_H_ 121 #endif // REMOTING_PROTOCOL_CONNECTION_TO_CLIENT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698