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

Unified 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 side-by-side diff with in-line comments
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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/client/jni/chromoting_jni_instance.cc
diff --git a/remoting/client/jni/chromoting_jni_instance.cc b/remoting/client/jni/chromoting_jni_instance.cc
index fd19deaaffea633450de5fa3468facf96cf809fb..a30c2f464eab6fac907fe7db0f032a49483f6182 100644
--- a/remoting/client/jni/chromoting_jni_instance.cc
+++ b/remoting/client/jni/chromoting_jni_instance.cc
@@ -387,28 +387,28 @@ void ChromotingJniInstance::ConnectToHostOnDisplayThread() {
view_.reset(new JniFrameConsumer(jni_runtime_, this));
view_weak_factory_.reset(new base::WeakPtrFactory<JniFrameConsumer>(
view_.get()));
- frame_consumer_ = new FrameConsumerProxy(jni_runtime_->display_task_runner(),
- view_weak_factory_->GetWeakPtr());
+ scoped_ptr<FrameConsumerProxy> frame_consumer =
+ make_scoped_ptr(new FrameConsumerProxy(view_weak_factory_->GetWeakPtr()));
jni_runtime_->network_task_runner()->PostTask(
FROM_HERE,
- base::Bind(&ChromotingJniInstance::ConnectToHostOnNetworkThread,
- this));
+ base::Bind(&ChromotingJniInstance::ConnectToHostOnNetworkThread, this,
+ base::Passed(&frame_consumer)));
}
-void ChromotingJniInstance::ConnectToHostOnNetworkThread() {
+void ChromotingJniInstance::ConnectToHostOnNetworkThread(
+ scoped_ptr<FrameConsumerProxy> frame_consumer) {
DCHECK(jni_runtime_->network_task_runner()->BelongsToCurrentThread());
+ DCHECK(frame_consumer);
jingle_glue::JingleThreadWrapper::EnsureForCurrentMessageLoop();
- client_context_.reset(new ClientContext(
- jni_runtime_->network_task_runner().get()));
+ client_context_.reset(new ClientContext(jni_runtime_->network_task_runner()));
client_context_->Start();
- SoftwareVideoRenderer* renderer =
- new SoftwareVideoRenderer(client_context_->main_task_runner(),
- client_context_->decode_task_runner(),
- frame_consumer_);
+ SoftwareVideoRenderer* renderer = new SoftwareVideoRenderer(
+ client_context_->main_task_runner(),
+ client_context_->decode_task_runner(), frame_consumer.Pass());
view_->set_frame_producer(renderer);
video_renderer_.reset(renderer);
« 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