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/gpu/compositor_thread.h" | 5 #include "content/renderer/gpu/compositor_thread.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/debug/trace_event.h" | 8 #include "base/debug/trace_event.h" |
9 #include "content/renderer/gpu/input_event_filter.h" | 9 #include "content/renderer/gpu/input_event_filter.h" |
10 #include "third_party/WebKit/Source/WebKit/chromium/public/WebActiveWheelFlingPa
rameters.h" | 10 #include "third_party/WebKit/Source/WebKit/chromium/public/WebActiveWheelFlingPa
rameters.h" |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 | 80 |
81 DISALLOW_COPY_AND_ASSIGN(InputHandlerWrapper); | 81 DISALLOW_COPY_AND_ASSIGN(InputHandlerWrapper); |
82 }; | 82 }; |
83 | 83 |
84 //------------------------------------------------------------------------------ | 84 //------------------------------------------------------------------------------ |
85 | 85 |
86 CompositorThread::CompositorThread(IPC::Listener* main_listener) | 86 CompositorThread::CompositorThread(IPC::Listener* main_listener) |
87 : thread_("Compositor") { | 87 : thread_("Compositor") { |
88 filter_ = | 88 filter_ = |
89 new InputEventFilter(main_listener, | 89 new InputEventFilter(main_listener, |
90 thread_.message_loop()->message_loop_proxy(), | 90 thread_.message_loop()->message_loop_proxy().get(), |
91 base::Bind(&CompositorThread::HandleInputEvent, | 91 base::Bind(&CompositorThread::HandleInputEvent, |
92 base::Unretained(this))); | 92 base::Unretained(this))); |
93 } | 93 } |
94 | 94 |
95 CompositorThread::~CompositorThread() { | 95 CompositorThread::~CompositorThread() { |
96 } | 96 } |
97 | 97 |
98 IPC::ChannelProxy::MessageFilter* CompositorThread::GetMessageFilter() const { | 98 IPC::ChannelProxy::MessageFilter* CompositorThread::GetMessageFilter() const { |
99 return filter_; | 99 return filter_.get(); |
100 } | 100 } |
101 | 101 |
102 void CompositorThread::AddInputHandler( | 102 void CompositorThread::AddInputHandler( |
103 int routing_id, int input_handler_id, | 103 int routing_id, int input_handler_id, |
104 const base::WeakPtr<RenderViewImpl>& render_view_impl) { | 104 const base::WeakPtr<RenderViewImpl>& render_view_impl) { |
105 DCHECK_NE(thread_.message_loop(), MessageLoop::current()); | 105 DCHECK_NE(thread_.message_loop(), MessageLoop::current()); |
106 | 106 |
107 thread_.message_loop()->PostTask( | 107 thread_.message_loop()->PostTask( |
108 FROM_HERE, | 108 FROM_HERE, |
109 base::Bind(&CompositorThread::AddInputHandlerOnCompositorThread, | 109 base::Bind(&CompositorThread::AddInputHandlerOnCompositorThread, |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
160 TRACE_EVENT0("CompositorThread::HandleInputEvent", "NoInputHandlerFound"); | 160 TRACE_EVENT0("CompositorThread::HandleInputEvent", "NoInputHandlerFound"); |
161 // Oops, we no longer have an interested input handler.. | 161 // Oops, we no longer have an interested input handler.. |
162 filter_->DidNotHandleInputEvent(true); | 162 filter_->DidNotHandleInputEvent(true); |
163 return; | 163 return; |
164 } | 164 } |
165 | 165 |
166 it->second->input_handler()->handleInputEvent(*input_event); | 166 it->second->input_handler()->handleInputEvent(*input_event); |
167 } | 167 } |
168 | 168 |
169 } // namespace content | 169 } // namespace content |
OLD | NEW |