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

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

Issue 10977073: Delete some unused code found by -Wunused-function (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: tweak, rebase Created 8 years, 2 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 #include "remoting/jingle_glue/xmpp_signal_strategy.h" 5 #include "remoting/jingle_glue/xmpp_signal_strategy.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/location.h" 8 #include "base/location.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/single_thread_task_runner.h" 10 #include "base/single_thread_task_runner.h"
11 #include "base/string_util.h" 11 #include "base/string_util.h"
12 #include "base/thread_task_runner_handle.h" 12 #include "base/thread_task_runner_handle.h"
13 #include "jingle/glue/chrome_async_socket.h" 13 #include "jingle/glue/chrome_async_socket.h"
14 #include "jingle/glue/task_pump.h" 14 #include "jingle/glue/task_pump.h"
15 #include "jingle/glue/xmpp_client_socket_factory.h" 15 #include "jingle/glue/xmpp_client_socket_factory.h"
16 #include "jingle/notifier/base/gaia_constants.h" 16 #include "jingle/notifier/base/gaia_constants.h"
17 #include "jingle/notifier/base/gaia_token_pre_xmpp_auth.h" 17 #include "jingle/notifier/base/gaia_token_pre_xmpp_auth.h"
18 #include "net/socket/client_socket_factory.h" 18 #include "net/socket/client_socket_factory.h"
19 #include "net/url_request/url_request_context_getter.h" 19 #include "net/url_request/url_request_context_getter.h"
20 #include "third_party/libjingle/source/talk/base/thread.h" 20 #include "third_party/libjingle/source/talk/base/thread.h"
21 #include "third_party/libjingle/source/talk/xmpp/prexmppauth.h" 21 #include "third_party/libjingle/source/talk/xmpp/prexmppauth.h"
22 #include "third_party/libjingle/source/talk/xmpp/saslcookiemechanism.h" 22 #include "third_party/libjingle/source/talk/xmpp/saslcookiemechanism.h"
23 23
24 namespace {
25
26 const char kDefaultResourceName[] = "chromoting"; 24 const char kDefaultResourceName[] = "chromoting";
27 25
28 // Use 58 seconds keep-alive interval, in case routers terminate 26 // Use 58 seconds keep-alive interval, in case routers terminate
29 // connections that are idle for more than a minute. 27 // connections that are idle for more than a minute.
30 const int kKeepAliveIntervalSeconds = 50; 28 const int kKeepAliveIntervalSeconds = 50;
31 29
32 // Read buffer size used by ChromeAsyncSocket for read and write buffers. Most 30 // Read buffer size used by ChromeAsyncSocket for read and write buffers. Most
33 // of XMPP messages are smaller than 4kB. 31 // of XMPP messages are smaller than 4kB.
34 const size_t kReadBufferSize = 4096; 32 const size_t kReadBufferSize = 4096;
35 const size_t kWriteBufferSize = 4096; 33 const size_t kWriteBufferSize = 4096;
36 34
37 void DisconnectXmppClient(buzz::XmppClient* client) {
38 client->Disconnect();
39 }
40
41 } // namespace
Wez 2012/09/28 17:56:50 We want these constants to be static, so we don't
Nico 2012/09/28 17:59:37 const has implicit static linkage. the namespace i
42
43 namespace remoting { 35 namespace remoting {
44 36
45 XmppSignalStrategy::XmppSignalStrategy( 37 XmppSignalStrategy::XmppSignalStrategy(
46 scoped_refptr<net::URLRequestContextGetter> request_context_getter, 38 scoped_refptr<net::URLRequestContextGetter> request_context_getter,
47 const std::string& username, 39 const std::string& username,
48 const std::string& auth_token, 40 const std::string& auth_token,
49 const std::string& auth_token_service) 41 const std::string& auth_token_service)
50 : request_context_getter_(request_context_getter), 42 : request_context_getter_(request_context_getter),
51 username_(username), 43 username_(username),
52 auth_token_(auth_token), 44 auth_token_(auth_token),
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
243 std::string mechanism = notifier::kDefaultGaiaAuthMechanism; 235 std::string mechanism = notifier::kDefaultGaiaAuthMechanism;
244 if (settings.token_service() == "oauth2") { 236 if (settings.token_service() == "oauth2") {
245 mechanism = "X-OAUTH2"; 237 mechanism = "X-OAUTH2";
246 } 238 }
247 239
248 return new notifier::GaiaTokenPreXmppAuth( 240 return new notifier::GaiaTokenPreXmppAuth(
249 jid.Str(), settings.auth_token(), settings.token_service(), mechanism); 241 jid.Str(), settings.auth_token(), settings.token_service(), mechanism);
250 } 242 }
251 243
252 } // namespace remoting 244 } // namespace remoting
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698