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

Side by Side Diff: remoting/client/jni/chromoting_jni_instance.cc

Issue 282063005: Pull out common code from client and host versions of ServerLogEntry. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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 | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/client/jni/chromoting_jni_instance.h" 5 #include "remoting/client/jni/chromoting_jni_instance.h"
6 6
7 #include <android/log.h> 7 #include <android/log.h>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
11 #include "net/socket/client_socket_factory.h" 11 #include "net/socket/client_socket_factory.h"
12 #include "remoting/client/audio_player.h" 12 #include "remoting/client/audio_player.h"
13 #include "remoting/client/jni/android_keymap.h" 13 #include "remoting/client/jni/android_keymap.h"
14 #include "remoting/client/jni/chromoting_jni_runtime.h" 14 #include "remoting/client/jni/chromoting_jni_runtime.h"
15 #include "remoting/client/log_to_server.h" 15 #include "remoting/client/log_to_server.h"
16 #include "remoting/client/server_log_entry.h"
17 #include "remoting/client/software_video_renderer.h" 16 #include "remoting/client/software_video_renderer.h"
18 #include "remoting/jingle_glue/chromium_port_allocator.h" 17 #include "remoting/jingle_glue/chromium_port_allocator.h"
19 #include "remoting/jingle_glue/chromium_socket_factory.h" 18 #include "remoting/jingle_glue/chromium_socket_factory.h"
20 #include "remoting/jingle_glue/network_settings.h" 19 #include "remoting/jingle_glue/network_settings.h"
21 #include "remoting/protocol/host_stub.h" 20 #include "remoting/protocol/host_stub.h"
22 #include "remoting/protocol/libjingle_transport_factory.h" 21 #include "remoting/protocol/libjingle_transport_factory.h"
22 #include "remoting/protocol/server_log_entry.h"
rmsousa 2014/05/20 00:54:41 Nit: Not sure if protocol is the right long-term h
Lambros 2014/05/20 01:13:35 It would be slightly cleaner without the protocol:
Sergey Ulanov 2014/05/21 04:02:36 Hm. Good question. I suggest putting this stuff in
23 23
24 namespace remoting { 24 namespace remoting {
25 25
26 namespace { 26 namespace {
27 27
28 // TODO(solb) Move into location shared with client plugin. 28 // TODO(solb) Move into location shared with client plugin.
29 const char* const kXmppServer = "talk.google.com"; 29 const char* const kXmppServer = "talk.google.com";
30 const int kXmppPort = 5222; 30 const int kXmppPort = 5222;
31 const bool kXmppUseTls = true; 31 const bool kXmppUseTls = true;
32 32
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after
329 329
330 client_.reset(new ChromotingClient( 330 client_.reset(new ChromotingClient(
331 client_config_, client_context_.get(), connection_.get(), 331 client_config_, client_context_.get(), connection_.get(),
332 this, video_renderer_.get(), scoped_ptr<AudioPlayer>())); 332 this, video_renderer_.get(), scoped_ptr<AudioPlayer>()));
333 333
334 334
335 signaling_.reset(new XmppSignalStrategy( 335 signaling_.reset(new XmppSignalStrategy(
336 net::ClientSocketFactory::GetDefaultFactory(), 336 net::ClientSocketFactory::GetDefaultFactory(),
337 jni_runtime_->url_requester(), xmpp_config_)); 337 jni_runtime_->url_requester(), xmpp_config_));
338 338
339 log_to_server_.reset(new client::LogToServer(client::ServerLogEntry::ME2ME, 339 log_to_server_.reset(new client::LogToServer(protocol::ServerLogEntry::ME2ME,
340 signaling_.get(), 340 signaling_.get(),
341 "remoting@bot.talk.google.com")); 341 "remoting@bot.talk.google.com"));
342 342
343 NetworkSettings network_settings(NetworkSettings::NAT_TRAVERSAL_FULL); 343 NetworkSettings network_settings(NetworkSettings::NAT_TRAVERSAL_FULL);
344 344
345 // Use Chrome's network stack to allocate ports for peer-to-peer channels. 345 // Use Chrome's network stack to allocate ports for peer-to-peer channels.
346 scoped_ptr<ChromiumPortAllocator> port_allocator( 346 scoped_ptr<ChromiumPortAllocator> port_allocator(
347 ChromiumPortAllocator::Create(jni_runtime_->url_requester(), 347 ChromiumPortAllocator::Create(jni_runtime_->url_requester(),
348 network_settings)); 348 network_settings));
349 349
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
430 stats->round_trip_ms()->Average()); 430 stats->round_trip_ms()->Average());
431 431
432 log_to_server_->LogStatistics(stats); 432 log_to_server_->LogStatistics(stats);
433 433
434 jni_runtime_->network_task_runner()->PostDelayedTask( 434 jni_runtime_->network_task_runner()->PostDelayedTask(
435 FROM_HERE, base::Bind(&ChromotingJniInstance::LogPerfStats, this), 435 FROM_HERE, base::Bind(&ChromotingJniInstance::LogPerfStats, this),
436 base::TimeDelta::FromMilliseconds(kPerfStatsIntervalMs)); 436 base::TimeDelta::FromMilliseconds(kPerfStatsIntervalMs));
437 } 437 }
438 438
439 } // namespace remoting 439 } // namespace remoting
OLDNEW
« no previous file with comments | « no previous file | remoting/client/log_to_server.h » ('j') | remoting/client/server_log_entry_client.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698