Refactor InvalidationTracker to track a map of invalidations
Refactor InvalidationTracker to track a map of invalidations

This patch refactors the InvalidationTracker to track invalidations by
type instead of a heterogeneous array.

Consider a simple example stream of trace events:
1) StyleRecalcInvalidationTracking
2) LayoutInvalidationTracking
3) StyleRecalcInvalidationTracking
4) RecalculateStyles
5) Layout
6) Paint

Our goal is to have:
RecalculateStyles.invalidationTrackingEvents = [1st event, 3rd event]
Layout.invalidationTrackingEvents = [2nd event]

StyleRecalcInvalidationTracking events occur before RecalculateStyles
events*. As invalidation tracking events come in, they are added to the
new "_invalidations" map which maps from type
(e.g., StyleRecalcInvalidationTracking) to an array of invalidations.
When a RecalculateStyles event occurs, InvalidationTracker::didRecalcStyle is
called which looks up all of the previous StyleRecalcInvalidationTracking
events and adds matching ones to the event's invalidationTrackingEvents array.
By tracking invalidation events by type, didRecalcStyle only needs
to look at previous StyleRecalcInvalidationTracking events instead of
all invalidation tracking events.

A followup will move the InvalidationTracker into a separate file.

* Not always, see https://codereview.chromium.org/732983003 which depends
on this patch.

NOTRY=true
BUG=410701

Review URL: https://codereview.chromium.org/723923003

git-svn-id: bf5cd6ccde378db821296732a091cfbcf5285fbd@185564 bbb929c8-8fbe-4397-9dbb-9b2b20218538

primiano/blink-gitcs,primiano/blink-gitcs,primiano/blink-gitcs,primiano/blink-gitcs,primiano/blink-gitcs,primiano/blink-gitcs,primiano/blink-gitcs,primiano/blink-gitcs,primiano/blink-gitcs