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

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

Issue 1236663002: Allow shaped-desktop hosts to send shape only when it changes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix Pepper 2D renderer build Created 5 years, 5 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
« no previous file with comments | « remoting/client/jni/chromoting_jni_instance.h ('k') | remoting/client/jni/jni_frame_consumer.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 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"
(...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after
380 380
381 jni_runtime_->UpdateCursorShape(shape); 381 jni_runtime_->UpdateCursorShape(shape);
382 } 382 }
383 383
384 void ChromotingJniInstance::ConnectToHostOnDisplayThread() { 384 void ChromotingJniInstance::ConnectToHostOnDisplayThread() {
385 DCHECK(jni_runtime_->display_task_runner()->BelongsToCurrentThread()); 385 DCHECK(jni_runtime_->display_task_runner()->BelongsToCurrentThread());
386 386
387 view_.reset(new JniFrameConsumer(jni_runtime_, this)); 387 view_.reset(new JniFrameConsumer(jni_runtime_, this));
388 view_weak_factory_.reset(new base::WeakPtrFactory<JniFrameConsumer>( 388 view_weak_factory_.reset(new base::WeakPtrFactory<JniFrameConsumer>(
389 view_.get())); 389 view_.get()));
390 frame_consumer_ = new FrameConsumerProxy(jni_runtime_->display_task_runner(), 390 scoped_ptr<FrameConsumerProxy> frame_consumer =
391 view_weak_factory_->GetWeakPtr()); 391 make_scoped_ptr(new FrameConsumerProxy(view_weak_factory_->GetWeakPtr()));
392 392
393 jni_runtime_->network_task_runner()->PostTask( 393 jni_runtime_->network_task_runner()->PostTask(
394 FROM_HERE, 394 FROM_HERE,
395 base::Bind(&ChromotingJniInstance::ConnectToHostOnNetworkThread, 395 base::Bind(&ChromotingJniInstance::ConnectToHostOnNetworkThread, this,
396 this)); 396 base::Passed(&frame_consumer)));
397 } 397 }
398 398
399 void ChromotingJniInstance::ConnectToHostOnNetworkThread() { 399 void ChromotingJniInstance::ConnectToHostOnNetworkThread(
400 scoped_ptr<FrameConsumerProxy> frame_consumer) {
400 DCHECK(jni_runtime_->network_task_runner()->BelongsToCurrentThread()); 401 DCHECK(jni_runtime_->network_task_runner()->BelongsToCurrentThread());
402 DCHECK(frame_consumer);
401 403
402 jingle_glue::JingleThreadWrapper::EnsureForCurrentMessageLoop(); 404 jingle_glue::JingleThreadWrapper::EnsureForCurrentMessageLoop();
403 405
404 client_context_.reset(new ClientContext( 406 client_context_.reset(new ClientContext(jni_runtime_->network_task_runner()));
405 jni_runtime_->network_task_runner().get()));
406 client_context_->Start(); 407 client_context_->Start();
407 408
408 SoftwareVideoRenderer* renderer = 409 SoftwareVideoRenderer* renderer = new SoftwareVideoRenderer(
409 new SoftwareVideoRenderer(client_context_->main_task_runner(), 410 client_context_->main_task_runner(),
410 client_context_->decode_task_runner(), 411 client_context_->decode_task_runner(), frame_consumer.Pass());
411 frame_consumer_);
412 view_->set_frame_producer(renderer); 412 view_->set_frame_producer(renderer);
413 video_renderer_.reset(renderer); 413 video_renderer_.reset(renderer);
414 414
415 client_.reset(new ChromotingClient( 415 client_.reset(new ChromotingClient(
416 client_context_.get(), this, video_renderer_.get(), nullptr)); 416 client_context_.get(), this, video_renderer_.get(), nullptr));
417 417
418 signaling_.reset(new XmppSignalStrategy( 418 signaling_.reset(new XmppSignalStrategy(
419 net::ClientSocketFactory::GetDefaultFactory(), 419 net::ClientSocketFactory::GetDefaultFactory(),
420 jni_runtime_->url_requester(), xmpp_config_)); 420 jni_runtime_->url_requester(), xmpp_config_));
421 421
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
531 stats->round_trip_ms()->Average()); 531 stats->round_trip_ms()->Average());
532 532
533 client_status_logger_->LogStatistics(stats); 533 client_status_logger_->LogStatistics(stats);
534 534
535 jni_runtime_->network_task_runner()->PostDelayedTask( 535 jni_runtime_->network_task_runner()->PostDelayedTask(
536 FROM_HERE, base::Bind(&ChromotingJniInstance::LogPerfStats, this), 536 FROM_HERE, base::Bind(&ChromotingJniInstance::LogPerfStats, this),
537 base::TimeDelta::FromMilliseconds(kPerfStatsIntervalMs)); 537 base::TimeDelta::FromMilliseconds(kPerfStatsIntervalMs));
538 } 538 }
539 539
540 } // namespace remoting 540 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/client/jni/chromoting_jni_instance.h ('k') | remoting/client/jni/jni_frame_consumer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698