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

Unified Diff: content/common/input/event_with_latency_info.cc

Issue 2683043004: Remove ui/events/blink dependency on blink_minimal. (Closed)
Patch Set: fix win debug Created 3 years, 10 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
Index: content/common/input/event_with_latency_info.cc
diff --git a/content/common/input/event_with_latency_info.cc b/content/common/input/event_with_latency_info.cc
deleted file mode 100644
index d4ea6731bc9e04f671cf0dc6b32c1762ac0d4f5b..0000000000000000000000000000000000000000
--- a/content/common/input/event_with_latency_info.cc
+++ /dev/null
@@ -1,56 +0,0 @@
-// Copyright 2016 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "content/common/input/event_with_latency_info.h"
-
-using blink::WebInputEvent;
-
-namespace content {
-
-ScopedWebInputEventWithLatencyInfo::ScopedWebInputEventWithLatencyInfo(
- blink::WebScopedInputEvent event,
- const ui::LatencyInfo& latency_info)
- : event_(new blink::WebCoalescedInputEvent(std::move(event))),
- latency_(latency_info) {}
-
-ScopedWebInputEventWithLatencyInfo::~ScopedWebInputEventWithLatencyInfo() {}
-
-bool ScopedWebInputEventWithLatencyInfo::CanCoalesceWith(
- const ScopedWebInputEventWithLatencyInfo& other) const {
- return ui::CanCoalesce(other.event(), event());
-}
-
-void ScopedWebInputEventWithLatencyInfo::CoalesceWith(
- const ScopedWebInputEventWithLatencyInfo& other) {
- // |other| should be a newer event than |this|.
- if (other.latency_.trace_id() >= 0 && latency_.trace_id() >= 0)
- DCHECK_GT(other.latency_.trace_id(), latency_.trace_id());
-
- // New events get coalesced into older events, and the newer timestamp
- // should always be preserved.
- const double time_stamp_seconds = other.event().timeStampSeconds();
- ui::Coalesce(other.event(), event_->eventPointer());
- event_->eventPointer()->setTimeStampSeconds(time_stamp_seconds);
- event_->addCoalescedEvent(other.event());
-
- // When coalescing two input events, we keep the oldest LatencyInfo
- // since it will represent the longest latency.
- other.latency_ = latency_;
- other.latency_.set_coalesced();
-}
-
-const blink::WebInputEvent& ScopedWebInputEventWithLatencyInfo::event() const {
- return event_->event();
-}
-
-blink::WebInputEvent& ScopedWebInputEventWithLatencyInfo::event() {
- return *event_->eventPointer();
-}
-
-const blink::WebCoalescedInputEvent&
-ScopedWebInputEventWithLatencyInfo::coalesced_event() const {
- return *event_;
-}
-
-} // namespace content

Powered by Google App Engine
This is Rietveld 408576698