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

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

Issue 9433027: Delete Session and SessionManager object synchronously. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add tests Created 8 years, 10 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 #ifndef REMOTING_PROTOCOL_FAKE_AUTHENTICATOR_H_ 5 #ifndef REMOTING_PROTOCOL_FAKE_AUTHENTICATOR_H_
6 #define REMOTING_PROTOCOL_FAKE_AUTHENTICATOR_H_ 6 #define REMOTING_PROTOCOL_FAKE_AUTHENTICATOR_H_
7 7
8 #include "base/callback.h"
8 #include "base/memory/weak_ptr.h" 9 #include "base/memory/weak_ptr.h"
9 #include "remoting/protocol/authenticator.h" 10 #include "remoting/protocol/authenticator.h"
10 #include "remoting/protocol/channel_authenticator.h" 11 #include "remoting/protocol/channel_authenticator.h"
11 12
12 namespace remoting { 13 namespace remoting {
13 namespace protocol { 14 namespace protocol {
14 15
15 class FakeChannelAuthenticator : public ChannelAuthenticator { 16 class FakeChannelAuthenticator : public ChannelAuthenticator {
16 public: 17 public:
17 FakeChannelAuthenticator(bool accept, bool async); 18 FakeChannelAuthenticator(bool accept, bool async);
18 virtual ~FakeChannelAuthenticator(); 19 virtual ~FakeChannelAuthenticator();
19 20
20 // ChannelAuthenticator interface. 21 // ChannelAuthenticator interface.
21 virtual void SecureAndAuthenticate( 22 virtual void SecureAndAuthenticate(
22 scoped_ptr<net::StreamSocket> socket, 23 scoped_ptr<net::StreamSocket> socket,
23 const DoneCallback& done_callback) OVERRIDE; 24 const DoneCallback& done_callback) OVERRIDE;
24 25
25 private: 26 private:
26 void CallCallback( 27 void CallCallback(
27 const DoneCallback& done_callback,
28 net::Error error, 28 net::Error error,
29 scoped_ptr<net::StreamSocket> socket); 29 scoped_ptr<net::StreamSocket> socket);
30 30
31 void OnAuthBytesWritten(int result);
32 void OnAuthBytesRead(int result);
33
31 bool accept_; 34 bool accept_;
32 bool async_; 35 bool async_;
33 36
37 scoped_ptr<net::StreamSocket> socket_;
38 DoneCallback done_callback_;
39 net::Error error_;
40
41 bool read_;
42 bool written_;
Wez 2012/02/22 22:51:38 nit: did_read_bytes_, did_write_bytes_?
Sergey Ulanov 2012/02/22 23:36:32 Done.
43
34 base::WeakPtrFactory<FakeChannelAuthenticator> weak_factory_; 44 base::WeakPtrFactory<FakeChannelAuthenticator> weak_factory_;
35 45
36 DISALLOW_COPY_AND_ASSIGN(FakeChannelAuthenticator); 46 DISALLOW_COPY_AND_ASSIGN(FakeChannelAuthenticator);
37 }; 47 };
38 48
39 class FakeAuthenticator : public Authenticator { 49 class FakeAuthenticator : public Authenticator {
40 public: 50 public:
41 enum Type { 51 enum Type {
42 HOST, 52 HOST,
43 CLIENT, 53 CLIENT,
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 FakeAuthenticator::Action action_; 98 FakeAuthenticator::Action action_;
89 bool async_; 99 bool async_;
90 100
91 DISALLOW_COPY_AND_ASSIGN(FakeHostAuthenticatorFactory); 101 DISALLOW_COPY_AND_ASSIGN(FakeHostAuthenticatorFactory);
92 }; 102 };
93 103
94 } // namespace protocol 104 } // namespace protocol
95 } // namespace remoting 105 } // namespace remoting
96 106
97 #endif // REMOTING_PROTOCOL_FAKE_AUTHENTICATOR_H_ 107 #endif // REMOTING_PROTOCOL_FAKE_AUTHENTICATOR_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698