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

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

Issue 1485853003: Revert of Remove kuint16max. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@kint2
Patch Set: Created 5 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
« no previous file with comments | « extensions/common/permissions/usb_device_permission_data.cc ('k') | net/dns/dns_session.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #include <string>
6
5 #include "jingle/notifier/communicator/single_login_attempt.h" 7 #include "jingle/notifier/communicator/single_login_attempt.h"
6 8
7 #include <stdint.h> 9 #include "base/basictypes.h"
8
9 #include <limits>
10 #include <string>
11
12 #include "base/logging.h" 10 #include "base/logging.h"
13 #include "base/strings/string_number_conversions.h" 11 #include "base/strings/string_number_conversions.h"
14 #include "base/strings/string_split.h" 12 #include "base/strings/string_split.h"
15 #include "jingle/notifier/base/const_communicator.h" 13 #include "jingle/notifier/base/const_communicator.h"
16 #include "jingle/notifier/base/gaia_token_pre_xmpp_auth.h" 14 #include "jingle/notifier/base/gaia_token_pre_xmpp_auth.h"
17 #include "jingle/notifier/listener/xml_element_util.h" 15 #include "jingle/notifier/listener/xml_element_util.h"
18 #include "net/base/host_port_pair.h" 16 #include "net/base/host_port_pair.h"
19 #include "third_party/webrtc/libjingle/xmllite/xmlelement.h" 17 #include "third_party/webrtc/libjingle/xmllite/xmlelement.h"
20 #include "webrtc/libjingle/xmpp/constants.h" 18 #include "webrtc/libjingle/xmpp/constants.h"
21 #include "webrtc/libjingle/xmpp/xmppclientsettings.h" 19 #include "webrtc/libjingle/xmpp/xmppclientsettings.h"
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 } 66 }
69 redirect_server.set_host(parts[0]); 67 redirect_server.set_host(parts[0]);
70 if (parts.size() <= 1) { 68 if (parts.size() <= 1) {
71 return redirect_server; 69 return redirect_server;
72 } 70 }
73 // Try to parse the port, falling back to kDefaultXmppPort. 71 // Try to parse the port, falling back to kDefaultXmppPort.
74 int port = kDefaultXmppPort; 72 int port = kDefaultXmppPort;
75 if (!base::StringToInt(parts[1], &port)) { 73 if (!base::StringToInt(parts[1], &port)) {
76 port = kDefaultXmppPort; 74 port = kDefaultXmppPort;
77 } 75 }
78 if (port <= 0 || port > std::numeric_limits<uint16_t>::max()) { 76 if (port <= 0 || port > kuint16max) {
79 port = kDefaultXmppPort; 77 port = kDefaultXmppPort;
80 } 78 }
81 redirect_server.set_port(port); 79 redirect_server.set_port(port);
82 return redirect_server; 80 return redirect_server;
83 } 81 }
84 82
85 } // namespace 83 } // namespace
86 84
87 void SingleLoginAttempt::OnError(buzz::XmppEngine::Error error, int subcode, 85 void SingleLoginAttempt::OnError(buzz::XmppEngine::Error error, int subcode,
88 const buzz::XmlElement* stream_error) { 86 const buzz::XmlElement* stream_error) {
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 client_settings.token_service(), 173 client_settings.token_service(),
176 login_settings_.auth_mechanism()); 174 login_settings_.auth_mechanism());
177 xmpp_connection_.reset( 175 xmpp_connection_.reset(
178 new XmppConnection(client_settings, 176 new XmppConnection(client_settings,
179 login_settings_.request_context_getter(), 177 login_settings_.request_context_getter(),
180 this, 178 this,
181 pre_xmpp_auth)); 179 pre_xmpp_auth));
182 } 180 }
183 181
184 } // namespace notifier 182 } // namespace notifier
OLDNEW
« no previous file with comments | « extensions/common/permissions/usb_device_permission_data.cc ('k') | net/dns/dns_session.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698