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

Unified Diff: remoting/protocol/fake_authenticator.h

Issue 205583011: [Draft] Fix canceling pin prompt causes host overload (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add unittest to chromoting_host and jingle_session Created 6 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 side-by-side diff with in-line comments
Download patch
Index: remoting/protocol/fake_authenticator.h
diff --git a/remoting/protocol/fake_authenticator.h b/remoting/protocol/fake_authenticator.h
index a5a2de833441e87897c44a1de06fc7c510d74635..470498f423d64fdbd9970799b6776b6c1dc93bcd 100644
--- a/remoting/protocol/fake_authenticator.h
+++ b/remoting/protocol/fake_authenticator.h
@@ -58,11 +58,15 @@ class FakeAuthenticator : public Authenticator {
REJECT_CHANNEL
};
+ FakeAuthenticator(Type type, int round_trips, int messages_till_started,
Sergey Ulanov 2014/04/02 19:49:26 It's better to avoid function overloading: http://
+ Action action, bool async);
FakeAuthenticator(Type type, int round_trips, Action action, bool async);
+
virtual ~FakeAuthenticator();
// Authenticator interface.
virtual State state() const OVERRIDE;
+ virtual bool started() const OVERRIDE;
virtual RejectionReason rejection_reason() const OVERRIDE;
virtual void ProcessMessage(const buzz::XmlElement* message,
const base::Closure& resume_callback) OVERRIDE;
@@ -78,6 +82,9 @@ class FakeAuthenticator : public Authenticator {
// Total number of messages that have been processed.
int messages_;
+ // Number of messages that the authenticator needs to process before started()
+ // returns true. Default to 0
Sergey Ulanov 2014/04/02 19:49:26 nit: add '.' at the end of the comment
kelvinp 2014/04/07 18:48:01 Done.
+ int messages_till_started_;
DISALLOW_COPY_AND_ASSIGN(FakeAuthenticator);
};
@@ -85,7 +92,8 @@ class FakeAuthenticator : public Authenticator {
class FakeHostAuthenticatorFactory : public AuthenticatorFactory {
public:
FakeHostAuthenticatorFactory(
- int round_trips, FakeAuthenticator::Action action, bool async);
+ int round_trips, int messages_till_start,
+ FakeAuthenticator::Action action, bool async);
virtual ~FakeHostAuthenticatorFactory();
// AuthenticatorFactory interface.
@@ -96,6 +104,7 @@ class FakeHostAuthenticatorFactory : public AuthenticatorFactory {
private:
int round_trips_;
+ int messages_till_started_;
FakeAuthenticator::Action action_;
bool async_;

Powered by Google App Engine
This is Rietveld 408576698