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

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

Issue 15920002: Fix WebView compositor input handling (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Code review and rebase 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
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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
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/memory_benchmarking_extension.h" 69 #include "content/renderer/memory_benchmarking_extension.h"
69 #include "content/renderer/p2p/socket_dispatcher.h" 70 #include "content/renderer/p2p/socket_dispatcher.h"
(...skipping 376 matching lines...) Expand 10 before | Expand all | Expand 10 after
446 // Shutdown the file thread if it's running. 447 // Shutdown the file thread if it's running.
447 if (file_thread_) 448 if (file_thread_)
448 file_thread_->Stop(); 449 file_thread_->Stop();
449 450
450 if (compositor_output_surface_filter_.get()) { 451 if (compositor_output_surface_filter_.get()) {
451 RemoveFilter(compositor_output_surface_filter_.get()); 452 RemoveFilter(compositor_output_surface_filter_.get());
452 compositor_output_surface_filter_ = NULL; 453 compositor_output_surface_filter_ = NULL;
453 } 454 }
454 455
455 compositor_thread_.reset(); 456 compositor_thread_.reset();
456 if (input_handler_manager_) { 457 input_handler_manager_.reset();
457 RemoveFilter(input_handler_manager_->GetMessageFilter()); 458 if (input_event_filter_) {
458 input_handler_manager_.reset(); 459 RemoveFilter(input_event_filter_.get());
460 input_event_filter_ = NULL;
459 } 461 }
460 462
461 if (webkit_platform_support_) 463 if (webkit_platform_support_)
462 WebKit::shutdown(); 464 WebKit::shutdown();
463 465
464 lazy_tls.Pointer()->Set(NULL); 466 lazy_tls.Pointer()->Set(NULL);
465 467
466 // TODO(port) 468 // TODO(port)
467 #if defined(OS_WIN) 469 #if defined(OS_WIN)
468 // Clean up plugin channels before this thread goes away. 470 // Clean up plugin channels before this thread goes away.
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after
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_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.get()); 798 CompositorOutputSurface::CreateFilter(output_surface_loop.get());
(...skipping 548 matching lines...) Expand 10 before | Expand all | Expand 10 after
1332 1347
1333 void RenderThreadImpl::SetFlingCurveParameters( 1348 void RenderThreadImpl::SetFlingCurveParameters(
1334 const std::vector<float>& new_touchpad, 1349 const std::vector<float>& new_touchpad,
1335 const std::vector<float>& new_touchscreen) { 1350 const std::vector<float>& new_touchscreen) {
1336 webkit_platform_support_->SetFlingCurveParameters(new_touchpad, 1351 webkit_platform_support_->SetFlingCurveParameters(new_touchpad,
1337 new_touchscreen); 1352 new_touchscreen);
1338 1353
1339 } 1354 }
1340 1355
1341 } // namespace content 1356 } // namespace content
OLDNEW
« content/renderer/gpu/input_handler_manager_client.h ('K') | « content/renderer/render_thread_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698