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

Side by Side Diff: content/renderer/render_thread_impl.cc

Issue 16119003: Move SynchronousCompositor into content/browser (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: comment, check Created 7 years, 6 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 "content/renderer/render_thread_impl.h" 5 #include "content/renderer/render_thread_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <limits> 8 #include <limits>
9 #include <map> 9 #include <map>
10 #include <vector> 10 #include <vector>
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 #endif 111 #endif
112 112
113 #if defined(OS_POSIX) 113 #if defined(OS_POSIX)
114 #include "ipc/ipc_channel_posix.h" 114 #include "ipc/ipc_channel_posix.h"
115 #endif 115 #endif
116 116
117 #if defined(ENABLE_WEBRTC) 117 #if defined(ENABLE_WEBRTC)
118 #include "third_party/webrtc/system_wrappers/interface/event_tracer.h" 118 #include "third_party/webrtc/system_wrappers/interface/event_tracer.h"
119 #endif 119 #endif
120 120
121 #if defined(OS_ANDROID)
122 #include "content/renderer/android/synchronous_compositor_factory.h"
123 #endif
124
121 using base::ThreadRestrictions; 125 using base::ThreadRestrictions;
122 using WebKit::WebDocument; 126 using WebKit::WebDocument;
123 using WebKit::WebFrame; 127 using WebKit::WebFrame;
124 using WebKit::WebNetworkStateNotifier; 128 using WebKit::WebNetworkStateNotifier;
125 using WebKit::WebRuntimeFeatures; 129 using WebKit::WebRuntimeFeatures;
126 using WebKit::WebScriptController; 130 using WebKit::WebScriptController;
127 using WebKit::WebSecurityPolicy; 131 using WebKit::WebSecurityPolicy;
128 using WebKit::WebString; 132 using WebKit::WebString;
129 using WebKit::WebView; 133 using WebKit::WebView;
130 134
(...skipping 607 matching lines...) Expand 10 before | Expand all | Expand 10 after
738 WebKit::initialize(webkit_platform_support_.get()); 742 WebKit::initialize(webkit_platform_support_.get());
739 WebKit::setSharedWorkerRepository( 743 WebKit::setSharedWorkerRepository(
740 webkit_platform_support_.get()->sharedWorkerRepository()); 744 webkit_platform_support_.get()->sharedWorkerRepository());
741 WebKit::setIDBFactory( 745 WebKit::setIDBFactory(
742 webkit_platform_support_.get()->idbFactory()); 746 webkit_platform_support_.get()->idbFactory());
743 747
744 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); 748 const CommandLine& command_line = *CommandLine::ForCurrentProcess();
745 749
746 bool enable = command_line.HasSwitch(switches::kEnableThreadedCompositing); 750 bool enable = command_line.HasSwitch(switches::kEnableThreadedCompositing);
747 if (enable) { 751 if (enable) {
748 base::MessageLoop* override_loop = 752 #if defined(OS_ANDROID)
749 GetContentClient()->renderer()->OverrideCompositorMessageLoop(); 753 if (SynchronousCompositorFactory::HasInstance())
750 if (override_loop) { 754 compositor_message_loop_proxy_ =
751 compositor_message_loop_proxy_ = override_loop->message_loop_proxy(); 755 SynchronousCompositorFactory::GetInstance()->
752 } else { 756 GetCompositorMessageLoop();
757 #endif
758 if (!compositor_message_loop_proxy_) {
753 compositor_thread_.reset(new base::Thread("Compositor")); 759 compositor_thread_.reset(new base::Thread("Compositor"));
754 compositor_thread_->Start(); 760 compositor_thread_->Start();
755 #if defined(OS_ANDROID) 761 #if defined(OS_ANDROID)
756 compositor_thread_->SetPriority(base::kThreadPriority_Display); 762 compositor_thread_->SetPriority(base::kThreadPriority_Display);
757 #endif 763 #endif
758 compositor_message_loop_proxy_ = 764 compositor_message_loop_proxy_ =
759 compositor_thread_->message_loop_proxy(); 765 compositor_thread_->message_loop_proxy();
760 compositor_message_loop_proxy_->PostTask( 766 compositor_message_loop_proxy_->PostTask(
761 FROM_HERE, 767 FROM_HERE,
762 base::Bind(base::IgnoreResult(&ThreadRestrictions::SetIOAllowed), 768 base::Bind(base::IgnoreResult(&ThreadRestrictions::SetIOAllowed),
(...skipping 565 matching lines...) Expand 10 before | Expand all | Expand 10 after
1328 1334
1329 void RenderThreadImpl::SetFlingCurveParameters( 1335 void RenderThreadImpl::SetFlingCurveParameters(
1330 const std::vector<float>& new_touchpad, 1336 const std::vector<float>& new_touchpad,
1331 const std::vector<float>& new_touchscreen) { 1337 const std::vector<float>& new_touchscreen) {
1332 webkit_platform_support_->SetFlingCurveParameters(new_touchpad, 1338 webkit_platform_support_->SetFlingCurveParameters(new_touchpad,
1333 new_touchscreen); 1339 new_touchscreen);
1334 1340
1335 } 1341 }
1336 1342
1337 } // namespace content 1343 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/android/synchronous_compositor_output_surface.cc ('k') | content/renderer/render_widget.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698