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

Unified Diff: public/web/WebInputEvent.h

Issue 743883005: Store binary flags in bool instead of int in WebInputEvent (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Include remaining bools Created 6 years, 1 month 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 | « Source/web/WebInputEvent.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: public/web/WebInputEvent.h
diff --git a/public/web/WebInputEvent.h b/public/web/WebInputEvent.h
index c90ca057052aadb5f94a6a3221249a050fa5641b..d669fabc12a0ed5a1ee3c92e18881e7276c60f48 100644
--- a/public/web/WebInputEvent.h
+++ b/public/web/WebInputEvent.h
@@ -243,7 +243,6 @@ public:
// http://msdn.microsoft.com/en-us/library/ms646286(VS.85).aspx for
// details). Other platforms don't have this concept, but it's just
// easier to leave it always false than ifdef.
- // See comment at the top of the file for why an int is used here.
bool isSystemKey;
// |text| is the text generated by this keystroke. |unmodifiedText| is
@@ -353,15 +352,9 @@ public:
float accelerationRatioX;
float accelerationRatioY;
- // See comment at the top of the file for why an int is used here.
- int scrollByPage;
-
- // See comment at the top of the file for why an int is used here.
- int hasPreciseScrollingDeltas;
Phase phase;
Phase momentumPhase;
- // See comment at the top of the file for why an int is used here.
// Rubberbanding is an OSX visual effect. When a user scrolls the content
// area with a track pad, and the content area is already at its limit in
// the direction being scrolled, the entire content area is allowed to
@@ -376,8 +369,11 @@ public:
// but have no effect on an ongoing rubber banding. A rubber banding that
// started in the vertical direction is allowed to continue in the right
// direction, even if canRubberbandRight is 0.
- int canRubberbandLeft;
- int canRubberbandRight;
+ bool canRubberbandLeft;
+ bool canRubberbandRight;
+
+ bool scrollByPage;
+ bool hasPreciseScrollingDeltas;
WebMouseWheelEvent()
: WebMouseEvent(sizeof(WebMouseWheelEvent))
@@ -387,12 +383,12 @@ public:
, wheelTicksY(0.0f)
, accelerationRatioX(1.0f)
, accelerationRatioY(1.0f)
- , scrollByPage(false)
- , hasPreciseScrollingDeltas(false)
, phase(PhaseNone)
, momentumPhase(PhaseNone)
, canRubberbandLeft(true)
, canRubberbandRight(true)
+ , scrollByPage(false)
+ , hasPreciseScrollingDeltas(false)
{
}
};
@@ -448,19 +444,13 @@ public:
float deltaY;
float velocityX;
float velocityY;
-
- // TODO: Use a bitfield instead of two ints for these flags
-
// Whether any previous GestureScrollUpdate in the current scroll
// sequence was suppressed (e.g., the causal touchmove was
// preventDefault'ed). This bit is particularly useful for
// determining whether the observed scroll update sequence captures
// the entirety of the generative motion.
- // See comment at the top for why an int is used here instead of a bool.
- int previousUpdateInSequencePrevented;
- // See comment at the top of the file for why an int is used here
- // instead of a bool.
- int preventPropagation;
+ bool previousUpdateInSequencePrevented;
+ bool preventPropagation;
} scrollUpdate;
struct {
@@ -498,16 +488,14 @@ public:
// Whether the event can be canceled (with preventDefault). If true then the browser
// must wait for an ACK for this event. If false then no ACK IPC is expected.
- // See comment at the top for why an int is used here instead of a bool.
- int cancelable;
+ bool cancelable;
// Whether the event will produce scroll-inducing events if uncanceled. This
// will be true for touchmove events after the platform slop region has been
// exceeded and fling-generating touchend events. Note that this doesn't
// necessarily mean content will scroll, only that scroll events will be
// generated.
- // See comment at the top for why an int is used here instead of a bool.
- int causesScrollingIfUncanceled;
+ bool causesScrollingIfUncanceled;
WebTouchEvent()
: WebInputEvent(sizeof(WebTouchEvent))
« no previous file with comments | « Source/web/WebInputEvent.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698