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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 #include "content/public/renderer/content_renderer_client.h" | 50 #include "content/public/renderer/content_renderer_client.h" |
51 #include "content/public/renderer/render_process_observer.h" | 51 #include "content/public/renderer/render_process_observer.h" |
52 #include "content/public/renderer/render_view_visitor.h" | 52 #include "content/public/renderer/render_view_visitor.h" |
53 #include "content/renderer/devtools/devtools_agent_filter.h" | 53 #include "content/renderer/devtools/devtools_agent_filter.h" |
54 #include "content/renderer/dom_storage/dom_storage_dispatcher.h" | 54 #include "content/renderer/dom_storage/dom_storage_dispatcher.h" |
55 #include "content/renderer/dom_storage/webstoragearea_impl.h" | 55 #include "content/renderer/dom_storage/webstoragearea_impl.h" |
56 #include "content/renderer/dom_storage/webstoragenamespace_impl.h" | 56 #include "content/renderer/dom_storage/webstoragenamespace_impl.h" |
57 #include "content/renderer/gpu/compositor_output_surface.h" | 57 #include "content/renderer/gpu/compositor_output_surface.h" |
58 #include "content/renderer/gpu/gpu_benchmarking_extension.h" | 58 #include "content/renderer/gpu/gpu_benchmarking_extension.h" |
59 #include "content/renderer/gpu/input_handler_manager.h" | 59 #include "content/renderer/gpu/input_handler_manager.h" |
| 60 #include "content/renderer/gpu/input_event_filter.h" |
60 #include "content/renderer/media/audio_input_message_filter.h" | 61 #include "content/renderer/media/audio_input_message_filter.h" |
61 #include "content/renderer/media/audio_message_filter.h" | 62 #include "content/renderer/media/audio_message_filter.h" |
62 #include "content/renderer/media/audio_renderer_mixer_manager.h" | 63 #include "content/renderer/media/audio_renderer_mixer_manager.h" |
63 #include "content/renderer/media/media_stream_center.h" | 64 #include "content/renderer/media/media_stream_center.h" |
64 #include "content/renderer/media/media_stream_dependency_factory.h" | 65 #include "content/renderer/media/media_stream_dependency_factory.h" |
65 #include "content/renderer/media/peer_connection_tracker.h" | 66 #include "content/renderer/media/peer_connection_tracker.h" |
66 #include "content/renderer/media/video_capture_impl_manager.h" | 67 #include "content/renderer/media/video_capture_impl_manager.h" |
67 #include "content/renderer/media/video_capture_message_filter.h" | 68 #include "content/renderer/media/video_capture_message_filter.h" |
68 #include "content/renderer/media/webrtc_logging_message_filter.h" | 69 #include "content/renderer/media/webrtc_logging_message_filter.h" |
69 #include "content/renderer/memory_benchmarking_extension.h" | 70 #include "content/renderer/memory_benchmarking_extension.h" |
(...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
454 // Shutdown the file thread if it's running. | 455 // Shutdown the file thread if it's running. |
455 if (file_thread_) | 456 if (file_thread_) |
456 file_thread_->Stop(); | 457 file_thread_->Stop(); |
457 | 458 |
458 if (compositor_output_surface_filter_) { | 459 if (compositor_output_surface_filter_) { |
459 RemoveFilter(compositor_output_surface_filter_.get()); | 460 RemoveFilter(compositor_output_surface_filter_.get()); |
460 compositor_output_surface_filter_ = NULL; | 461 compositor_output_surface_filter_ = NULL; |
461 } | 462 } |
462 | 463 |
463 compositor_thread_.reset(); | 464 compositor_thread_.reset(); |
464 if (input_handler_manager_) { | 465 input_handler_manager_.reset(); |
465 RemoveFilter(input_handler_manager_->GetMessageFilter()); | 466 if (input_event_filter_) { |
466 input_handler_manager_.reset(); | 467 RemoveFilter(input_event_filter_.get()); |
| 468 input_event_filter_ = NULL; |
467 } | 469 } |
468 | 470 |
469 if (webkit_platform_support_) | 471 if (webkit_platform_support_) |
470 WebKit::shutdown(); | 472 WebKit::shutdown(); |
471 | 473 |
472 lazy_tls.Pointer()->Set(NULL); | 474 lazy_tls.Pointer()->Set(NULL); |
473 | 475 |
474 // TODO(port) | 476 // TODO(port) |
475 #if defined(OS_WIN) | 477 #if defined(OS_WIN) |
476 // Clean up plugin channels before this thread goes away. | 478 // Clean up plugin channels before this thread goes away. |
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
761 compositor_thread_->SetPriority(base::kThreadPriority_Display); | 763 compositor_thread_->SetPriority(base::kThreadPriority_Display); |
762 #endif | 764 #endif |
763 compositor_message_loop_proxy_ = | 765 compositor_message_loop_proxy_ = |
764 compositor_thread_->message_loop_proxy(); | 766 compositor_thread_->message_loop_proxy(); |
765 compositor_message_loop_proxy_->PostTask( | 767 compositor_message_loop_proxy_->PostTask( |
766 FROM_HERE, | 768 FROM_HERE, |
767 base::Bind(base::IgnoreResult(&ThreadRestrictions::SetIOAllowed), | 769 base::Bind(base::IgnoreResult(&ThreadRestrictions::SetIOAllowed), |
768 false)); | 770 false)); |
769 } | 771 } |
770 | 772 |
| 773 InputHandlerManagerClient* input_handler_manager_client = NULL; |
| 774 #if defined(OS_ANDROID) |
| 775 if (SynchronousCompositorFactory* factory = |
| 776 SynchronousCompositorFactory::GetInstance()) { |
| 777 input_handler_manager_client = factory->GetInputHandlerManagerClient(); |
| 778 } |
| 779 #endif |
| 780 if (!input_handler_manager_client) { |
| 781 input_event_filter_ = |
| 782 new InputEventFilter(this, compositor_message_loop_proxy_); |
| 783 AddFilter(input_event_filter_.get()); |
| 784 input_handler_manager_client = input_event_filter_.get(); |
| 785 } |
771 input_handler_manager_.reset( | 786 input_handler_manager_.reset( |
772 new InputHandlerManager(this, compositor_message_loop_proxy_)); | 787 new InputHandlerManager(compositor_message_loop_proxy_)); |
773 AddFilter(input_handler_manager_->GetMessageFilter()); | 788 input_handler_manager_->BindToClient(input_handler_manager_client); |
774 } | 789 } |
775 | 790 |
776 scoped_refptr<base::MessageLoopProxy> output_surface_loop; | 791 scoped_refptr<base::MessageLoopProxy> output_surface_loop; |
777 if (enable) | 792 if (enable) |
778 output_surface_loop = compositor_message_loop_proxy_; | 793 output_surface_loop = compositor_message_loop_proxy_; |
779 else | 794 else |
780 output_surface_loop = base::MessageLoopProxy::current(); | 795 output_surface_loop = base::MessageLoopProxy::current(); |
781 | 796 |
782 compositor_output_surface_filter_ = | 797 compositor_output_surface_filter_ = |
783 CompositorOutputSurface::CreateFilter(output_surface_loop); | 798 CompositorOutputSurface::CreateFilter(output_surface_loop); |
(...skipping 547 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1331 | 1346 |
1332 void RenderThreadImpl::SetFlingCurveParameters( | 1347 void RenderThreadImpl::SetFlingCurveParameters( |
1333 const std::vector<float>& new_touchpad, | 1348 const std::vector<float>& new_touchpad, |
1334 const std::vector<float>& new_touchscreen) { | 1349 const std::vector<float>& new_touchscreen) { |
1335 webkit_platform_support_->SetFlingCurveParameters(new_touchpad, | 1350 webkit_platform_support_->SetFlingCurveParameters(new_touchpad, |
1336 new_touchscreen); | 1351 new_touchscreen); |
1337 | 1352 |
1338 } | 1353 } |
1339 | 1354 |
1340 } // namespace content | 1355 } // namespace content |
OLD | NEW |