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

Unified Diff: remoting/jingle_glue/signal_strategy.h

Issue 10378110: Verify that xmpp_login specified in the config matches auth token. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 7 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
« no previous file with comments | « remoting/jingle_glue/mock_objects.h ('k') | remoting/jingle_glue/xmpp_signal_strategy.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/jingle_glue/signal_strategy.h
diff --git a/remoting/jingle_glue/signal_strategy.h b/remoting/jingle_glue/signal_strategy.h
index 89712670ae73b4733f2718bf04f686ca44e89a07..065127224180dd823fb61aa58d5b81e66ff0dc6a 100644
--- a/remoting/jingle_glue/signal_strategy.h
+++ b/remoting/jingle_glue/signal_strategy.h
@@ -30,6 +30,12 @@ class SignalStrategy {
DISCONNECTED,
};
+ enum Error {
+ OK,
+ AUTHENTICATION_FAILED,
+ NETWORK_ERROR,
+ };
+
// Callback interface for signaling event. Event handlers are not
// allowed to destroy SignalStrategy, but may add or remove other
// listeners.
@@ -37,7 +43,9 @@ class SignalStrategy {
public:
virtual ~Listener() {}
- // Called after state of the connection has changed.
+ // Called after state of the connection has changed. If the state
+ // is DISCONNECTED, then GetError() can be used to get the reason
+ // for the disconnection.
virtual void OnSignalStrategyStateChange(State state) {}
// Must return true if the stanza was handled, false
@@ -63,6 +71,9 @@ class SignalStrategy {
// Returns current state.
virtual State GetState() const = 0;
+ // Returns the last error. Set when state changes to DISCONNECT.
+ virtual Error GetError() const = 0;
+
// Returns local JID or an empty string when not connected.
virtual std::string GetLocalJid() const = 0;
« no previous file with comments | « remoting/jingle_glue/mock_objects.h ('k') | remoting/jingle_glue/xmpp_signal_strategy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698