- // For each WebContents that is swapped in, we store a
- // PrerenderedWebContentsData so that we can track the origin of the
- // prerender.
- struct PrerenderedWebContentsData {
- explicit PrerenderedWebContentsData(Origin origin);
-
- Origin origin;
- };
-
- // In the control group experimental group for each WebContents "not swapped
- // in" we create a WouldBePrerenderedWebContentsData to the origin of the
- // "prerender" we did not launch. We also track a state machine to ensure
- // the histogram reporting tracks what histograms would have done.
- struct WouldBePrerenderedWebContentsData {
- // When the WebContents gets a provisional load, we'd like to remove the
- // WebContents from the map since the new navigation would not have swapped
- // in a prerender. But the first provisional load after the control
- // prerender is not "swapped in" is actually to the prerendered location! So
- // we don't remove the item from the map on the first provisional load, but
- // we do for subsequent loads.
- enum State {
- WAITING_FOR_PROVISIONAL_LOAD,
- SEEN_PROVISIONAL_LOAD,
- };
-
- explicit WouldBePrerenderedWebContentsData(Origin origin);
-
- Origin origin;
- State state;
- };
-