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

Side by Side Diff: remoting/jingle_glue/xmpp_signal_strategy.h

Issue 10829040: Revert 148418 - Always use chromium threads for IO in remoting host (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 5 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 // The XmppSignalStrategy encapsulates all the logic to perform the signaling 5 // The XmppSignalStrategy encapsulates all the logic to perform the signaling
6 // STUN/ICE for jingle via a direct XMPP connection. 6 // STUN/ICE for jingle via a direct XMPP connection.
7 // 7 //
8 // This class is not threadsafe. 8 // This class is not threadsafe.
9 9
10 #ifndef REMOTING_JINGLE_GLUE_XMPP_SIGNAL_STRATEGY_H_ 10 #ifndef REMOTING_JINGLE_GLUE_XMPP_SIGNAL_STRATEGY_H_
11 #define REMOTING_JINGLE_GLUE_XMPP_SIGNAL_STRATEGY_H_ 11 #define REMOTING_JINGLE_GLUE_XMPP_SIGNAL_STRATEGY_H_
12 12
13 #include "remoting/jingle_glue/signal_strategy.h" 13 #include "remoting/jingle_glue/signal_strategy.h"
14 14
15 #include <vector> 15 #include <vector>
16 16
17 #include "base/compiler_specific.h" 17 #include "base/compiler_specific.h"
18 #include "base/observer_list.h" 18 #include "base/observer_list.h"
19 #include "base/timer.h" 19 #include "base/timer.h"
20 #include "base/threading/non_thread_safe.h" 20 #include "base/threading/non_thread_safe.h"
21 #include "third_party/libjingle/source/talk/base/sigslot.h" 21 #include "third_party/libjingle/source/talk/base/sigslot.h"
22 #include "third_party/libjingle/source/talk/xmpp/xmppclient.h" 22 #include "third_party/libjingle/source/talk/xmpp/xmppclient.h"
23 23
24 namespace net {
25 class URLRequestContextGetter;
26 } // namespace net
27
28 namespace talk_base {
29 class TaskRunner;
30 } // namespace talk_base
31
32 namespace remoting { 24 namespace remoting {
33 25
34 class JingleThread; 26 class JingleThread;
35 27
36 class XmppSignalStrategy : public base::NonThreadSafe, 28 class XmppSignalStrategy : public base::NonThreadSafe,
37 public SignalStrategy, 29 public SignalStrategy,
38 public buzz::XmppStanzaHandler, 30 public buzz::XmppStanzaHandler,
39 public sigslot::has_slots<> { 31 public sigslot::has_slots<> {
40 public: 32 public:
41 XmppSignalStrategy( 33 XmppSignalStrategy(JingleThread* thread,
42 scoped_refptr<net::URLRequestContextGetter> request_context_getter, 34 const std::string& username,
43 const std::string& username, 35 const std::string& auth_token,
44 const std::string& auth_token, 36 const std::string& auth_token_service);
45 const std::string& auth_token_service);
46 virtual ~XmppSignalStrategy(); 37 virtual ~XmppSignalStrategy();
47 38
48 // SignalStrategy interface. 39 // SignalStrategy interface.
49 virtual void Connect() OVERRIDE; 40 virtual void Connect() OVERRIDE;
50 virtual void Disconnect() OVERRIDE; 41 virtual void Disconnect() OVERRIDE;
51 virtual State GetState() const OVERRIDE; 42 virtual State GetState() const OVERRIDE;
52 virtual Error GetError() const OVERRIDE; 43 virtual Error GetError() const OVERRIDE;
53 virtual std::string GetLocalJid() const OVERRIDE; 44 virtual std::string GetLocalJid() const OVERRIDE;
54 virtual void AddListener(Listener* listener) OVERRIDE; 45 virtual void AddListener(Listener* listener) OVERRIDE;
55 virtual void RemoveListener(Listener* listener) OVERRIDE; 46 virtual void RemoveListener(Listener* listener) OVERRIDE;
(...skipping 16 matching lines...) Expand all
72 63
73 private: 64 private:
74 static buzz::PreXmppAuth* CreatePreXmppAuth( 65 static buzz::PreXmppAuth* CreatePreXmppAuth(
75 const buzz::XmppClientSettings& settings); 66 const buzz::XmppClientSettings& settings);
76 67
77 void OnConnectionStateChanged(buzz::XmppEngine::State state); 68 void OnConnectionStateChanged(buzz::XmppEngine::State state);
78 void SetState(State new_state); 69 void SetState(State new_state);
79 70
80 void SendKeepAlive(); 71 void SendKeepAlive();
81 72
82 scoped_refptr<net::URLRequestContextGetter> request_context_getter_; 73 JingleThread* thread_;
74
83 std::string username_; 75 std::string username_;
84 std::string auth_token_; 76 std::string auth_token_;
85 std::string auth_token_service_; 77 std::string auth_token_service_;
86 std::string resource_name_; 78 std::string resource_name_;
87 scoped_ptr<talk_base::TaskRunner> task_runner_;
88 buzz::XmppClient* xmpp_client_; 79 buzz::XmppClient* xmpp_client_;
89 80
90 State state_; 81 State state_;
91 Error error_; 82 Error error_;
92 83
93 ObserverList<Listener, true> listeners_; 84 ObserverList<Listener, true> listeners_;
94 85
95 base::RepeatingTimer<XmppSignalStrategy> keep_alive_timer_; 86 base::RepeatingTimer<XmppSignalStrategy> keep_alive_timer_;
96 87
97 DISALLOW_COPY_AND_ASSIGN(XmppSignalStrategy); 88 DISALLOW_COPY_AND_ASSIGN(XmppSignalStrategy);
98 }; 89 };
99 90
100 } // namespace remoting 91 } // namespace remoting
101 92
102 #endif // REMOTING_JINGLE_GLUE_XMPP_SIGNAL_STRATEGY_H_ 93 #endif // REMOTING_JINGLE_GLUE_XMPP_SIGNAL_STRATEGY_H_
OLDNEW
« no previous file with comments | « remoting/jingle_glue/ssl_socket_adapter.cc ('k') | remoting/jingle_glue/xmpp_signal_strategy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698