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

Unified Diff: third_party/WebKit/Source/platform/UserGestureIndicator.cpp

Issue 2850983002: Remove UserGestureUtilizedCallback, it's unused outside of tests (Closed)
Patch Set: 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
Index: third_party/WebKit/Source/platform/UserGestureIndicator.cpp
diff --git a/third_party/WebKit/Source/platform/UserGestureIndicator.cpp b/third_party/WebKit/Source/platform/UserGestureIndicator.cpp
index e183dd6da2eef7f7ab244c4ed50494178190fdfa..e5c1aff0c8dcdd66de90a1b93ac02ab9d89c3a2c 100644
--- a/third_party/WebKit/Source/platform/UserGestureIndicator.cpp
+++ b/third_party/WebKit/Source/platform/UserGestureIndicator.cpp
@@ -41,8 +41,7 @@ const double kUserGestureOutOfProcessTimeout = 10.0;
UserGestureToken::UserGestureToken(Status status)
: consumable_gestures_(0),
timestamp_(WTF::CurrentTime()),
- timeout_policy_(kDefault),
- usage_callback_(nullptr) {
+ timeout_policy_(kDefault) {
if (status == kNewGesture || !UserGestureIndicator::CurrentTokenThreadSafe())
consumable_gestures_++;
}
@@ -83,19 +82,6 @@ bool UserGestureToken::HasTimedOut() const {
return WTF::CurrentTime() - timestamp_ > timeout;
}
-void UserGestureToken::SetUserGestureUtilizedCallback(
- UserGestureUtilizedCallback* callback) {
- CHECK(this == UserGestureIndicator::CurrentToken());
- usage_callback_ = callback;
-}
-
-void UserGestureToken::UserGestureUtilized() {
- if (usage_callback_) {
- usage_callback_->UserGestureUtilized();
- usage_callback_ = nullptr;
- }
-}
-
// This enum is used in a histogram, so its values shouldn't change.
enum GestureMergeState {
kOldTokenHasGesture = 1 << 0,
@@ -136,19 +122,8 @@ UserGestureIndicator::UserGestureIndicator(PassRefPtr<UserGestureToken> token) {
}
UserGestureIndicator::~UserGestureIndicator() {
- if (IsMainThread() && token_ && token_ == root_token_) {
- root_token_->SetUserGestureUtilizedCallback(nullptr);
+ if (IsMainThread() && token_ && token_ == root_token_)
root_token_ = nullptr;
- }
-}
-
-// static
-bool UserGestureIndicator::UtilizeUserGesture() {
- if (UserGestureIndicator::ProcessingUserGesture()) {
- root_token_->UserGestureUtilized();
- return true;
- }
- return false;
}
bool UserGestureIndicator::ProcessingUserGesture() {
@@ -164,10 +139,8 @@ bool UserGestureIndicator::ProcessingUserGestureThreadSafe() {
// static
bool UserGestureIndicator::ConsumeUserGesture() {
if (auto* token = CurrentToken()) {
- if (token->ConsumeGesture()) {
- token->UserGestureUtilized();
+ if (token->ConsumeGesture())
return true;
- }
}
return false;
}

Powered by Google App Engine
This is Rietveld 408576698