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

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

Issue 12356002: [NOT FOR COMMIT] Hacks to merge render compositor thread with UI thread (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 9 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 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 #endif 110 #endif
111 111
112 #if defined(OS_POSIX) 112 #if defined(OS_POSIX)
113 #include "ipc/ipc_channel_posix.h" 113 #include "ipc/ipc_channel_posix.h"
114 #endif 114 #endif
115 115
116 #if defined(ENABLE_WEBRTC) 116 #if defined(ENABLE_WEBRTC)
117 #include "third_party/webrtc/system_wrappers/interface/event_tracer.h" 117 #include "third_party/webrtc/system_wrappers/interface/event_tracer.h"
118 #endif 118 #endif
119 119
120 #include "content/public/browser/browser_thread.h"
121 #include "chrome/browser/metrics/thread_watcher.h"
122
123
124
120 using WebKit::WebDocument; 125 using WebKit::WebDocument;
121 using WebKit::WebFrame; 126 using WebKit::WebFrame;
122 using WebKit::WebNetworkStateNotifier; 127 using WebKit::WebNetworkStateNotifier;
123 using WebKit::WebRuntimeFeatures; 128 using WebKit::WebRuntimeFeatures;
124 using WebKit::WebScriptController; 129 using WebKit::WebScriptController;
125 using WebKit::WebSecurityPolicy; 130 using WebKit::WebSecurityPolicy;
126 using WebKit::WebString; 131 using WebKit::WebString;
127 using WebKit::WebView; 132 using WebKit::WebView;
128 133
129 namespace content { 134 namespace content {
(...skipping 467 matching lines...) Expand 10 before | Expand all | Expand 10 after
597 webkit_platform_support_.get()->sharedWorkerRepository()); 602 webkit_platform_support_.get()->sharedWorkerRepository());
598 WebKit::setIDBFactory( 603 WebKit::setIDBFactory(
599 webkit_platform_support_.get()->idbFactory()); 604 webkit_platform_support_.get()->idbFactory());
600 605
601 WebKit::WebCompositorSupport* compositor_support = 606 WebKit::WebCompositorSupport* compositor_support =
602 WebKit::Platform::current()->compositorSupport(); 607 WebKit::Platform::current()->compositorSupport();
603 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); 608 const CommandLine& command_line = *CommandLine::ForCurrentProcess();
604 609
605 bool enable = command_line.HasSwitch(switches::kEnableThreadedCompositing); 610 bool enable = command_line.HasSwitch(switches::kEnableThreadedCompositing);
606 if (enable) { 611 if (enable) {
607 compositor_thread_.reset(new CompositorThread(this)); 612 compositor_thread_.reset(new CompositorThread(this, BrowserThread::UnsafeGet MessageLoopForThread(BrowserThread::UI)));
608 AddFilter(compositor_thread_->GetMessageFilter()); 613 AddFilter(compositor_thread_->GetMessageFilter());
609 compositor_support->initialize(compositor_thread_->GetWebThread()); 614 compositor_support->initialize(compositor_thread_->GetWebThread());
610 } else { 615 } else {
611 compositor_support->initialize(NULL); 616 compositor_support->initialize(NULL);
612 } 617 }
613 compositor_initialized_ = true; 618 compositor_initialized_ = true;
614 619
615 MessageLoop* output_surface_loop = enable ? 620 MessageLoop* output_surface_loop = enable ?
616 compositor_thread_->message_loop() : 621 compositor_thread_->message_loop() :
617 MessageLoop::current(); 622 MessageLoop::current();
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after
876 idle_notifications_to_skip_ = 2; 881 idle_notifications_to_skip_ = 2;
877 } 882 }
878 883
879 /* static */ 884 /* static */
880 void RenderThreadImpl::OnGpuVDAContextLoss() { 885 void RenderThreadImpl::OnGpuVDAContextLoss() {
881 RenderThreadImpl* self = RenderThreadImpl::current(); 886 RenderThreadImpl* self = RenderThreadImpl::current();
882 DCHECK(self); 887 DCHECK(self);
883 if (!self->gpu_vda_context3d_.get()) 888 if (!self->gpu_vda_context3d_.get())
884 return; 889 return;
885 if (self->compositor_thread()) { 890 if (self->compositor_thread()) {
886 self->compositor_thread()->GetWebThread()->message_loop()->DeleteSoon( 891 BrowserThread::UnsafeGetMessageLoopForThread(BrowserThread::UI)->DeleteSoon(
887 FROM_HERE, self->gpu_vda_context3d_.release()); 892 FROM_HERE, self->gpu_vda_context3d_.release());
888 } else { 893 } else {
889 self->gpu_vda_context3d_.reset(); 894 self->gpu_vda_context3d_.reset();
890 } 895 }
891 } 896 }
892 897
893 WebGraphicsContext3DCommandBufferImpl* 898 WebGraphicsContext3DCommandBufferImpl*
894 RenderThreadImpl::GetGpuVDAContext3D() { 899 RenderThreadImpl::GetGpuVDAContext3D() {
895 if (!gpu_vda_context3d_.get()) { 900 if (!gpu_vda_context3d_.get()) {
896 gpu_vda_context3d_.reset( 901 gpu_vda_context3d_.reset(
(...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after
1199 1204
1200 void RenderThreadImpl::SetFlingCurveParameters( 1205 void RenderThreadImpl::SetFlingCurveParameters(
1201 const std::vector<float>& new_touchpad, 1206 const std::vector<float>& new_touchpad,
1202 const std::vector<float>& new_touchscreen) { 1207 const std::vector<float>& new_touchscreen) {
1203 webkit_platform_support_->SetFlingCurveParameters(new_touchpad, 1208 webkit_platform_support_->SetFlingCurveParameters(new_touchpad,
1204 new_touchscreen); 1209 new_touchscreen);
1205 1210
1206 } 1211 }
1207 1212
1208 } // namespace content 1213 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698