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

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

Issue 5958001: The MediatorThread worker thread needs to have a CertVerifier... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Fix typos in xmpp_connection_unittest.cc Created 10 years 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) 2009 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 "talk/base/common.h" 13 #include "talk/base/common.h"
13 #include "talk/base/socketaddress.h" 14 #include "talk/base/socketaddress.h"
14 #include "talk/xmpp/xmppclientsettings.h" 15 #include "talk/xmpp/xmppclientsettings.h"
15 16
16 namespace notifier { 17 namespace notifier {
17 18
18 LoginSettings::LoginSettings(const buzz::XmppClientSettings& user_settings, 19 LoginSettings::LoginSettings(const buzz::XmppClientSettings& user_settings,
19 const ConnectionOptions& options, 20 const ConnectionOptions& options,
20 net::HostResolver* host_resolver, 21 net::HostResolver* host_resolver,
22 net::CertVerifier* cert_verifier,
21 ServerInformation* server_list, 23 ServerInformation* server_list,
22 int server_count, 24 int server_count,
23 bool try_ssltcp_first) 25 bool try_ssltcp_first)
24 : try_ssltcp_first_(try_ssltcp_first), 26 : try_ssltcp_first_(try_ssltcp_first),
25 host_resolver_(host_resolver), 27 host_resolver_(host_resolver),
28 cert_verifier_(cert_verifier),
26 server_list_(new ServerInformation[server_count]), 29 server_list_(new ServerInformation[server_count]),
27 server_count_(server_count), 30 server_count_(server_count),
28 user_settings_(new buzz::XmppClientSettings(user_settings)), 31 user_settings_(new buzz::XmppClientSettings(user_settings)),
29 connection_options_(new ConnectionOptions(options)) { 32 connection_options_(new ConnectionOptions(options)) {
30 // Note: firewall may be NULL. 33 // Note: firewall may be NULL.
31 DCHECK(server_list); 34 DCHECK(server_list);
32 DCHECK(host_resolver); 35 DCHECK(host_resolver);
36 DCHECK(cert_verifier);
33 DCHECK_GT(server_count, 0); 37 DCHECK_GT(server_count, 0);
34 for (int i = 0; i < server_count_; ++i) { 38 for (int i = 0; i < server_count_; ++i) {
35 server_list_[i] = server_list[i]; 39 server_list_[i] = server_list[i];
36 } 40 }
37 } 41 }
38 42
39 // Defined so that the destructors are executed here (and the corresponding 43 // Defined so that the destructors are executed here (and the corresponding
40 // classes don't need to be included in the header file). 44 // classes don't need to be included in the header file).
41 LoginSettings::~LoginSettings() { 45 LoginSettings::~LoginSettings() {
42 } 46 }
43 47
44 void LoginSettings::set_server_override( 48 void LoginSettings::set_server_override(
45 const net::HostPortPair& server) { 49 const net::HostPortPair& server) {
46 server_override_.reset(new ServerInformation()); 50 server_override_.reset(new ServerInformation());
47 server_override_->server = server; 51 server_override_->server = server;
48 server_override_->special_port_magic = server_list_[0].special_port_magic; 52 server_override_->special_port_magic = server_list_[0].special_port_magic;
49 } 53 }
50 54
51 void LoginSettings::clear_server_override() { 55 void LoginSettings::clear_server_override() {
52 server_override_.reset(); 56 server_override_.reset();
53 } 57 }
54 58
55 } // namespace notifier 59 } // namespace notifier
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698