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

Unified Diff: content/renderer/render_view_impl.cc

Issue 2813683002: Allow MainThreadEventQueue to call the RenderWidget directly. (Closed)
Patch Set: Fix style nits Created 3 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/renderer/render_view_impl.h ('k') | content/renderer/render_widget.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/render_view_impl.cc
diff --git a/content/renderer/render_view_impl.cc b/content/renderer/render_view_impl.cc
index 8f8eae2322e939fa50b51b65de12912c07ebf1dd..f526f7ecbd7dcf78b081974a879ef5aab921677c 100644
--- a/content/renderer/render_view_impl.cc
+++ b/content/renderer/render_view_impl.cc
@@ -726,7 +726,7 @@ void RenderViewImpl::Initialize(
OnEnableAutoResize(params.min_size, params.max_size);
}
- new IdleUserDetector(this);
+ idle_user_detector_.reset(new IdleUserDetector(this));
GetContentClient()->renderer()->RenderViewCreated(this);
@@ -766,6 +766,7 @@ RenderViewImpl::~RenderViewImpl() {
DCHECK_NE(this, it->second) << "Failed to call Close?";
#endif
+ idle_user_detector_.reset();
for (auto& observer : observers_)
observer.RenderViewGone();
for (auto& observer : observers_)
@@ -2660,21 +2661,29 @@ void RenderViewImpl::OnDiscardInputEvent(
const std::vector<const blink::WebInputEvent*>& coalesced_events,
const ui::LatencyInfo& latency_info,
InputEventDispatchType dispatch_type) {
- if (!input_event || (dispatch_type != DISPATCH_TYPE_BLOCKING &&
- dispatch_type != DISPATCH_TYPE_BLOCKING_NOTIFY_MAIN)) {
+ if (!input_event || dispatch_type == DISPATCH_TYPE_NON_BLOCKING) {
return;
}
- if (dispatch_type == DISPATCH_TYPE_BLOCKING_NOTIFY_MAIN) {
- NotifyInputEventHandled(input_event->GetType(),
- blink::WebInputEventResult::kNotHandled,
- INPUT_EVENT_ACK_STATE_NOT_CONSUMED);
- }
-
std::unique_ptr<InputEventAck> ack(new InputEventAck(
InputEventAckSource::MAIN_THREAD, input_event->GetType(),
INPUT_EVENT_ACK_STATE_NOT_CONSUMED));
OnInputEventAck(std::move(ack));
}
+InputEventAckState RenderViewImpl::HandleInputEvent(
+ const blink::WebCoalescedInputEvent& input_event,
+ const ui::LatencyInfo& latency_info,
+ InputEventDispatchType dispatch_type) {
+ if (is_swapped_out_) {
+ OnDiscardInputEvent(&input_event.Event(),
+ input_event.GetCoalescedEventsPointers(), latency_info,
+ dispatch_type);
+ return INPUT_EVENT_ACK_STATE_NOT_CONSUMED;
+ }
+ idle_user_detector_->ActivityDetected();
+ return RenderWidget::HandleInputEvent(input_event, latency_info,
+ dispatch_type);
+}
+
} // namespace content
« no previous file with comments | « content/renderer/render_view_impl.h ('k') | content/renderer/render_widget.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698