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

Side by Side Diff: webrtc/p2p/client/autoportallocator.h

Issue 2011503002: Remove unused libjingle_xmpphelp target. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Also remove autoportallocator.h, which seems to be orphaned, yet references the task type Created 4 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 unified diff | Download patch
« no previous file with comments | « webrtc/libjingle/xmpp/jingleinfotask.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 /*
2 * Copyright 2010 The WebRTC Project Authors. All rights reserved.
3 *
4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
9 */
10
11 #ifndef WEBRTC_P2P_CLIENT_AUTOPORTALLOCATOR_H_
12 #define WEBRTC_P2P_CLIENT_AUTOPORTALLOCATOR_H_
13
14 #include <string>
15 #include <vector>
16
17 #include "webrtc/p2p/client/httpportallocator.h"
18 #include "webrtc/base/sigslot.h"
19
20 // This class sets the relay and stun servers using XmppClient.
21 // It enables the client to traverse Proxy and NAT.
22 class AutoPortAllocator : public cricket::HttpPortAllocator {
23 public:
24 AutoPortAllocator(rtc::NetworkManager* network_manager,
25 const std::string& user_agent)
26 : cricket::HttpPortAllocator(network_manager, user_agent) {
27 }
28
29 // Creates and initiates a task to get relay token from XmppClient and set
30 // it appropriately.
31 void SetXmppClient(buzz::XmppClient* client) {
32 // The JingleInfoTask is freed by the task-runner.
33 buzz::JingleInfoTask* jit = new buzz::JingleInfoTask(client);
34 jit->SignalJingleInfo.connect(this, &AutoPortAllocator::OnJingleInfo);
35 jit->Start();
36 jit->RefreshJingleInfoNow();
37 }
38
39 private:
40 void OnJingleInfo(
41 const std::string& token,
42 const std::vector<std::string>& relay_hosts,
43 const std::vector<rtc::SocketAddress>& stun_hosts) {
44 SetRelayToken(token);
45 SetStunHosts(stun_hosts);
46 SetRelayHosts(relay_hosts);
47 }
48 };
49
50 #endif // WEBRTC_P2P_CLIENT_AUTOPORTALLOCATOR_H_
OLDNEW
« no previous file with comments | « webrtc/libjingle/xmpp/jingleinfotask.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698