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

Side by Side Diff: jingle/notifier/communicator/login_settings.cc

Issue 6649006: Added support for other authentication mechanisms in jingle. This will allow ... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Review comments addressed Created 9 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 #include <string> 5 #include <string>
6 6
7 #include "jingle/notifier/communicator/login_settings.h" 7 #include "jingle/notifier/communicator/login_settings.h"
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "jingle/notifier/communicator/connection_options.h" 10 #include "jingle/notifier/communicator/connection_options.h"
11 #include "jingle/notifier/communicator/xmpp_connection_generator.h" 11 #include "jingle/notifier/communicator/xmpp_connection_generator.h"
12 #include "net/base/cert_verifier.h" 12 #include "net/base/cert_verifier.h"
13 #include "talk/base/common.h" 13 #include "talk/base/common.h"
14 #include "talk/base/socketaddress.h" 14 #include "talk/base/socketaddress.h"
15 #include "talk/xmpp/xmppclientsettings.h" 15 #include "talk/xmpp/xmppclientsettings.h"
16 16
17 namespace notifier { 17 namespace notifier {
18 18
19 LoginSettings::LoginSettings(const buzz::XmppClientSettings& user_settings, 19 LoginSettings::LoginSettings(const buzz::XmppClientSettings& user_settings,
20 const ConnectionOptions& options, 20 const ConnectionOptions& options,
21 net::HostResolver* host_resolver, 21 net::HostResolver* host_resolver,
22 net::CertVerifier* cert_verifier, 22 net::CertVerifier* cert_verifier,
23 ServerInformation* server_list, 23 ServerInformation* server_list,
24 int server_count, 24 int server_count,
25 bool try_ssltcp_first) 25 bool try_ssltcp_first,
26 const std::string& auth_mechanism)
26 : try_ssltcp_first_(try_ssltcp_first), 27 : try_ssltcp_first_(try_ssltcp_first),
27 host_resolver_(host_resolver), 28 host_resolver_(host_resolver),
28 cert_verifier_(cert_verifier), 29 cert_verifier_(cert_verifier),
29 server_list_(new ServerInformation[server_count]), 30 server_list_(new ServerInformation[server_count]),
30 server_count_(server_count), 31 server_count_(server_count),
31 user_settings_(new buzz::XmppClientSettings(user_settings)), 32 user_settings_(new buzz::XmppClientSettings(user_settings)),
32 connection_options_(new ConnectionOptions(options)) { 33 connection_options_(new ConnectionOptions(options)),
34 auth_mechanism_(auth_mechanism) {
33 // Note: firewall may be NULL. 35 // Note: firewall may be NULL.
34 DCHECK(server_list); 36 DCHECK(server_list);
35 DCHECK(host_resolver); 37 DCHECK(host_resolver);
36 DCHECK(cert_verifier); 38 DCHECK(cert_verifier);
37 DCHECK_GT(server_count, 0); 39 DCHECK_GT(server_count, 0);
38 for (int i = 0; i < server_count_; ++i) { 40 for (int i = 0; i < server_count_; ++i) {
39 server_list_[i] = server_list[i]; 41 server_list_[i] = server_list[i];
40 } 42 }
41 } 43 }
42 44
43 // Defined so that the destructors are executed here (and the corresponding 45 // Defined so that the destructors are executed here (and the corresponding
44 // classes don't need to be included in the header file). 46 // classes don't need to be included in the header file).
45 LoginSettings::~LoginSettings() { 47 LoginSettings::~LoginSettings() {
46 } 48 }
47 49
48 void LoginSettings::set_server_override( 50 void LoginSettings::set_server_override(
49 const net::HostPortPair& server) { 51 const net::HostPortPair& server) {
50 server_override_.reset(new ServerInformation()); 52 server_override_.reset(new ServerInformation());
51 server_override_->server = server; 53 server_override_->server = server;
52 server_override_->special_port_magic = server_list_[0].special_port_magic; 54 server_override_->special_port_magic = server_list_[0].special_port_magic;
53 } 55 }
54 56
55 void LoginSettings::clear_server_override() { 57 void LoginSettings::clear_server_override() {
56 server_override_.reset(); 58 server_override_.reset();
57 } 59 }
58 60
59 } // namespace notifier 61 } // namespace notifier
OLDNEW
« no previous file with comments | « jingle/notifier/communicator/login_settings.h ('k') | jingle/notifier/communicator/single_login_attempt.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698