OLD | NEW |
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 358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
369 | 369 |
370 db_message_filter_ = new DBMessageFilter(); | 370 db_message_filter_ = new DBMessageFilter(); |
371 AddFilter(db_message_filter_.get()); | 371 AddFilter(db_message_filter_.get()); |
372 | 372 |
373 #if defined(ENABLE_WEBRTC) | 373 #if defined(ENABLE_WEBRTC) |
374 webrtc::SetupEventTracer(&GetCategoryGroupEnabled, &AddTraceEvent); | 374 webrtc::SetupEventTracer(&GetCategoryGroupEnabled, &AddTraceEvent); |
375 | 375 |
376 peer_connection_tracker_.reset(new PeerConnectionTracker()); | 376 peer_connection_tracker_.reset(new PeerConnectionTracker()); |
377 AddObserver(peer_connection_tracker_.get()); | 377 AddObserver(peer_connection_tracker_.get()); |
378 | 378 |
379 p2p_socket_dispatcher_ = new P2PSocketDispatcher(GetIOMessageLoopProxy()); | 379 p2p_socket_dispatcher_ = |
| 380 new P2PSocketDispatcher(GetIOMessageLoopProxy().get()); |
380 AddFilter(p2p_socket_dispatcher_.get()); | 381 AddFilter(p2p_socket_dispatcher_.get()); |
381 #endif // defined(ENABLE_WEBRTC) | 382 #endif // defined(ENABLE_WEBRTC) |
382 vc_manager_ = new VideoCaptureImplManager(); | 383 vc_manager_ = new VideoCaptureImplManager(); |
383 AddFilter(vc_manager_->video_capture_message_filter()); | 384 AddFilter(vc_manager_->video_capture_message_filter()); |
384 | 385 |
385 audio_input_message_filter_ = | 386 audio_input_message_filter_ = |
386 new AudioInputMessageFilter(GetIOMessageLoopProxy()); | 387 new AudioInputMessageFilter(GetIOMessageLoopProxy()); |
387 AddFilter(audio_input_message_filter_.get()); | 388 AddFilter(audio_input_message_filter_.get()); |
388 | 389 |
389 audio_message_filter_ = new AudioMessageFilter(GetIOMessageLoopProxy()); | 390 audio_message_filter_ = new AudioMessageFilter(GetIOMessageLoopProxy()); |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
451 if (file_thread_) | 452 if (file_thread_) |
452 file_thread_->Stop(); | 453 file_thread_->Stop(); |
453 | 454 |
454 if (compositor_output_surface_filter_.get()) { | 455 if (compositor_output_surface_filter_.get()) { |
455 RemoveFilter(compositor_output_surface_filter_.get()); | 456 RemoveFilter(compositor_output_surface_filter_.get()); |
456 compositor_output_surface_filter_ = NULL; | 457 compositor_output_surface_filter_ = NULL; |
457 } | 458 } |
458 | 459 |
459 compositor_thread_.reset(); | 460 compositor_thread_.reset(); |
460 input_handler_manager_.reset(); | 461 input_handler_manager_.reset(); |
461 if (input_event_filter_) { | 462 if (input_event_filter_.get()) { |
462 RemoveFilter(input_event_filter_.get()); | 463 RemoveFilter(input_event_filter_.get()); |
463 input_event_filter_ = NULL; | 464 input_event_filter_ = NULL; |
464 } | 465 } |
465 | 466 |
466 if (webkit_platform_support_) | 467 if (webkit_platform_support_) |
467 WebKit::shutdown(); | 468 WebKit::shutdown(); |
468 | 469 |
469 lazy_tls.Pointer()->Set(NULL); | 470 lazy_tls.Pointer()->Set(NULL); |
470 | 471 |
471 // TODO(port) | 472 // TODO(port) |
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
756 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); | 757 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
757 | 758 |
758 bool enable = command_line.HasSwitch(switches::kEnableThreadedCompositing); | 759 bool enable = command_line.HasSwitch(switches::kEnableThreadedCompositing); |
759 if (enable) { | 760 if (enable) { |
760 #if defined(OS_ANDROID) | 761 #if defined(OS_ANDROID) |
761 if (SynchronousCompositorFactory* factory = | 762 if (SynchronousCompositorFactory* factory = |
762 SynchronousCompositorFactory::GetInstance()) | 763 SynchronousCompositorFactory::GetInstance()) |
763 compositor_message_loop_proxy_ = | 764 compositor_message_loop_proxy_ = |
764 factory->GetCompositorMessageLoop(); | 765 factory->GetCompositorMessageLoop(); |
765 #endif | 766 #endif |
766 if (!compositor_message_loop_proxy_) { | 767 if (!compositor_message_loop_proxy_.get()) { |
767 compositor_thread_.reset(new base::Thread("Compositor")); | 768 compositor_thread_.reset(new base::Thread("Compositor")); |
768 compositor_thread_->Start(); | 769 compositor_thread_->Start(); |
769 #if defined(OS_ANDROID) | 770 #if defined(OS_ANDROID) |
770 compositor_thread_->SetPriority(base::kThreadPriority_Display); | 771 compositor_thread_->SetPriority(base::kThreadPriority_Display); |
771 #endif | 772 #endif |
772 compositor_message_loop_proxy_ = | 773 compositor_message_loop_proxy_ = |
773 compositor_thread_->message_loop_proxy(); | 774 compositor_thread_->message_loop_proxy(); |
774 compositor_message_loop_proxy_->PostTask( | 775 compositor_message_loop_proxy_->PostTask( |
775 FROM_HERE, | 776 FROM_HERE, |
776 base::Bind(base::IgnoreResult(&ThreadRestrictions::SetIOAllowed), | 777 base::Bind(base::IgnoreResult(&ThreadRestrictions::SetIOAllowed), |
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
982 void RenderThreadImpl::PostponeIdleNotification() { | 983 void RenderThreadImpl::PostponeIdleNotification() { |
983 idle_notifications_to_skip_ = 2; | 984 idle_notifications_to_skip_ = 2; |
984 } | 985 } |
985 | 986 |
986 /* static */ | 987 /* static */ |
987 void RenderThreadImpl::OnGpuVDAContextLoss() { | 988 void RenderThreadImpl::OnGpuVDAContextLoss() { |
988 RenderThreadImpl* self = RenderThreadImpl::current(); | 989 RenderThreadImpl* self = RenderThreadImpl::current(); |
989 DCHECK(self); | 990 DCHECK(self); |
990 if (!self->gpu_vda_context3d_) | 991 if (!self->gpu_vda_context3d_) |
991 return; | 992 return; |
992 if (self->compositor_message_loop_proxy()) { | 993 if (self->compositor_message_loop_proxy().get()) { |
993 self->compositor_message_loop_proxy()->DeleteSoon( | 994 self->compositor_message_loop_proxy() |
994 FROM_HERE, self->gpu_vda_context3d_.release()); | 995 ->DeleteSoon(FROM_HERE, self->gpu_vda_context3d_.release()); |
995 } else { | 996 } else { |
996 self->gpu_vda_context3d_.reset(); | 997 self->gpu_vda_context3d_.reset(); |
997 } | 998 } |
998 } | 999 } |
999 | 1000 |
1000 WebGraphicsContext3DCommandBufferImpl* | 1001 WebGraphicsContext3DCommandBufferImpl* |
1001 RenderThreadImpl::GetGpuVDAContext3D() { | 1002 RenderThreadImpl::GetGpuVDAContext3D() { |
1002 if (!gpu_vda_context3d_) { | 1003 if (!gpu_vda_context3d_) { |
1003 gpu_vda_context3d_.reset( | 1004 gpu_vda_context3d_.reset( |
1004 WebGraphicsContext3DCommandBufferImpl::CreateOffscreenContext( | 1005 WebGraphicsContext3DCommandBufferImpl::CreateOffscreenContext( |
(...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1378 | 1379 |
1379 void RenderThreadImpl::SetFlingCurveParameters( | 1380 void RenderThreadImpl::SetFlingCurveParameters( |
1380 const std::vector<float>& new_touchpad, | 1381 const std::vector<float>& new_touchpad, |
1381 const std::vector<float>& new_touchscreen) { | 1382 const std::vector<float>& new_touchscreen) { |
1382 webkit_platform_support_->SetFlingCurveParameters(new_touchpad, | 1383 webkit_platform_support_->SetFlingCurveParameters(new_touchpad, |
1383 new_touchscreen); | 1384 new_touchscreen); |
1384 | 1385 |
1385 } | 1386 } |
1386 | 1387 |
1387 } // namespace content | 1388 } // namespace content |
OLD | NEW |