Commit 7ed8f603 authored by Maggie Cai's avatar Maggie Cai Committed by Commit Bot

Revert "[ozone/wayland] Introduced the histogram to track time on data transfer."

This reverts commit d1224786.

Reason for revert: Suspect this CL breaks the build android-archive-rel. First failure: https://ci.chromium.org/p/chromium/builders/ci/android-archive-rel/16867
Compile error message: expand_owners.Error: The histogram Event.WaylandDragDrop.IncomingDataTransferTime must have a valid primary owner, i.e. a Googler with an @google.com or @chromium.org email address.

Original change's description:
> [ozone/wayland] Introduced the histogram to track time on data transfer.
>
> When data is dragged from another application into Chromium, there is a
> delay between mouse pointer crossing the window border and the actual
> OnDragEnter() called on the window.  The delay happens because the
> drag drop controller has to get the data, which implies at least one
> request to the Wayland server (the actual number of requests equals
> number of MIME types available in the data offer).
>
> Here a histogram is introduced to know what the real delays will be
> there in the wild.
>
> Bug: 1147413
> Change-Id: I2f3acc067f718ccb29d98ea1bf98b9f03efc2f7d
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2552864
> Reviewed-by: Robert Kroeger <rjkroege@chromium.org>
> Reviewed-by: Alexei Svitkine <asvitkine@chromium.org>
> Commit-Queue: Alexander Dunaev <adunaev@igalia.com>
> Cr-Commit-Position: refs/heads/master@{#831251}

TBR=rjkroege@chromium.org,asvitkine@chromium.org,adunaev@igalia.com

Change-Id: I8a9f113d12f7c8ef7e71989cdb3949696a683901
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 1147413
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2561958Reviewed-by: default avatarMaggie Cai <mxcai@chromium.org>
Commit-Queue: Maggie Cai <mxcai@chromium.org>
Cr-Commit-Position: refs/heads/master@{#831254}
parent 721988b2
...@@ -1640,16 +1640,6 @@ reviews. Googlers can read more about this at go/gwsq-gerrit. ...@@ -1640,16 +1640,6 @@ reviews. Googlers can read more about this at go/gwsq-gerrit.
</summary> </summary>
</histogram> </histogram>
<histogram name="Event.WaylandDragDrop.IncomingDataTransferTime" units="ms"
expires_after="M90">
<owner>adunaev@igalia.com</owner>
<owner>rjkroege@chromium.org</owner>
<summary>
Delay between the drag coming into the window and the window is actually
notified.
</summary>
</histogram>
<histogram base="true" name="EventLatency" units="microseconds" <histogram base="true" name="EventLatency" units="microseconds"
expires_after="2021-05-09"> expires_after="2021-05-09">
<owner>mohsen@chromium.org</owner> <owner>mohsen@chromium.org</owner>
......
...@@ -7,7 +7,6 @@ ...@@ -7,7 +7,6 @@
#include <cstdint> #include <cstdint>
#include "base/check.h" #include "base/check.h"
#include "base/metrics/histogram_macros.h"
#include "base/notreached.h" #include "base/notreached.h"
#include "third_party/skia/include/core/SkBitmap.h" #include "third_party/skia/include/core/SkBitmap.h"
#include "ui/base/clipboard/clipboard_constants.h" #include "ui/base/clipboard/clipboard_constants.h"
...@@ -161,7 +160,7 @@ void WaylandDataDragController::OnDragEnter(WaylandWindow* window, ...@@ -161,7 +160,7 @@ void WaylandDataDragController::OnDragEnter(WaylandWindow* window,
received_data_ = std::make_unique<OSExchangeData>( received_data_ = std::make_unique<OSExchangeData>(
std::make_unique<OSExchangeDataProviderNonBacked>()); std::make_unique<OSExchangeDataProviderNonBacked>());
last_drag_location_ = location; last_drag_location_ = location;
HandleUnprocessedMimeTypes(base::TimeTicks::Now()); HandleUnprocessedMimeTypes();
} }
} }
...@@ -282,23 +281,21 @@ void WaylandDataDragController::CreateIconSurfaceIfNeeded( ...@@ -282,23 +281,21 @@ void WaylandDataDragController::CreateIconSurfaceIfNeeded(
// more unprocessed mime types on the |unprocessed_mime_types_| queue. Once this // more unprocessed mime types on the |unprocessed_mime_types_| queue. Once this
// process is finished, OnDataTransferFinished is called to deliver the // process is finished, OnDataTransferFinished is called to deliver the
// |received_data_| to the drop handler. // |received_data_| to the drop handler.
void WaylandDataDragController::HandleUnprocessedMimeTypes( void WaylandDataDragController::HandleUnprocessedMimeTypes() {
base::TimeTicks start_time) {
DCHECK_EQ(state_, State::kTransferring); DCHECK_EQ(state_, State::kTransferring);
std::string mime_type = GetNextUnprocessedMimeType(); std::string mime_type = GetNextUnprocessedMimeType();
if (mime_type.empty() || is_leave_pending_) { if (mime_type.empty() || is_leave_pending_) {
OnDataTransferFinished(start_time, std::move(received_data_)); OnDataTransferFinished(std::move(received_data_));
} else { } else {
DCHECK(data_offer_); DCHECK(data_offer_);
data_device_->RequestData( data_device_->RequestData(
data_offer_.get(), mime_type, data_offer_.get(), mime_type,
base::BindOnce(&WaylandDataDragController::OnMimeTypeDataTransferred, base::BindOnce(&WaylandDataDragController::OnMimeTypeDataTransferred,
weak_factory_.GetWeakPtr(), start_time)); weak_factory_.GetWeakPtr()));
} }
} }
void WaylandDataDragController::OnMimeTypeDataTransferred( void WaylandDataDragController::OnMimeTypeDataTransferred(
base::TimeTicks start_time,
PlatformClipboard::Data contents) { PlatformClipboard::Data contents) {
DCHECK_EQ(state_, State::kTransferring); DCHECK_EQ(state_, State::kTransferring);
DCHECK(contents); DCHECK(contents);
...@@ -309,11 +306,10 @@ void WaylandDataDragController::OnMimeTypeDataTransferred( ...@@ -309,11 +306,10 @@ void WaylandDataDragController::OnMimeTypeDataTransferred(
unprocessed_mime_types_.pop_front(); unprocessed_mime_types_.pop_front();
// Continue reading data for other negotiated mime types. // Continue reading data for other negotiated mime types.
HandleUnprocessedMimeTypes(start_time); HandleUnprocessedMimeTypes();
} }
void WaylandDataDragController::OnDataTransferFinished( void WaylandDataDragController::OnDataTransferFinished(
base::TimeTicks start_time,
std::unique_ptr<OSExchangeData> received_data) { std::unique_ptr<OSExchangeData> received_data) {
unprocessed_mime_types_.clear(); unprocessed_mime_types_.clear();
state_ = State::kIdle; state_ = State::kIdle;
...@@ -333,9 +329,6 @@ void WaylandDataDragController::OnDataTransferFinished( ...@@ -333,9 +329,6 @@ void WaylandDataDragController::OnDataTransferFinished(
return; return;
} }
UMA_HISTOGRAM_TIMES("Event.WaylandDragDrop.IncomingDataTransferTime",
base::TimeTicks::Now() - start_time);
PropagateOnDragEnter(last_drag_location_, std::move(received_data)); PropagateOnDragEnter(last_drag_location_, std::move(received_data));
} }
......
...@@ -105,11 +105,9 @@ class WaylandDataDragController : public WaylandDataDevice::DragDelegate, ...@@ -105,11 +105,9 @@ class WaylandDataDragController : public WaylandDataDevice::DragDelegate,
void Offer(const OSExchangeData& data, int operation); void Offer(const OSExchangeData& data, int operation);
void CreateIconSurfaceIfNeeded(const OSExchangeData& data); void CreateIconSurfaceIfNeeded(const OSExchangeData& data);
void HandleUnprocessedMimeTypes(base::TimeTicks start_time); void HandleUnprocessedMimeTypes();
void OnMimeTypeDataTransferred(base::TimeTicks start_time, void OnMimeTypeDataTransferred(PlatformClipboard::Data contents);
PlatformClipboard::Data contents);
void OnDataTransferFinished( void OnDataTransferFinished(
base::TimeTicks start_time,
std::unique_ptr<ui::OSExchangeData> received_data); std::unique_ptr<ui::OSExchangeData> received_data);
std::string GetNextUnprocessedMimeType(); std::string GetNextUnprocessedMimeType();
// Calls the window's OnDragEnter with the given location and data, // Calls the window's OnDragEnter with the given location and data,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment