Attention is currently required from: Kouhei Ueno, Takashi Toyoshima.
1 comment:
Patchset:
Could you have a look?
To view, visit change 3804328. To unsubscribe, or for help writing mail filters, visit settings.
Attention is currently required from: Ken Okada, Kouhei Ueno.
7 comments:
Patchset:
Thanks, this is really a great idea!
File components/page_load_metrics/browser/page_load_metrics_update_dispatcher.cc:
// If the page is non prerendered, `parse_start <= first_paint`.
// If the page is prerendered, `parse_start <= activation_start <=
// first_paint`.
The first part explains the check from line 164, and the second part does the check below. It's a little confusing to me. Maybe one root of the confusion is the comment says "if ... prerendered...", but we didn't check `is_prerendered` in the following checks.
How about omitting the first part, and just explains the prerendering case here?
Also, should this be `if (is_prerendered && !EventsInOrder(...))` or move this inside the `if (is_prerendered)` below?
Patch Set #5, Line 161: INVALID_ORDER_PARSE_START_FIRST_PAINT
Probably, better to define a new enum.
Patch Set #5, Line 176: INVALID_ORDER_PARSE_START_FIRST_PAINT
ditto
const bool, or directly passing the expression into the second argument below.
ditto
To view, visit change 3804328. To unsubscribe, or for help writing mail filters, visit settings.
Attention is currently required from: Ken Okada.
Patch set 5:Code-Review +1
1 comment:
Patchset:
lgtm % toyoshim review comments
To view, visit change 3804328. To unsubscribe, or for help writing mail filters, visit settings.
Attention is currently required from: Kouhei Ueno, Takashi Toyoshima.
6 comments:
File components/page_load_metrics/browser/page_load_metrics_update_dispatcher.cc:
// If the page is non prerendered, `parse_start <= first_paint`.
// If the page is prerendered, `parse_start <= activation_start <=
// first_paint`.
The first part explains the check from line 164, and the second part does the check below. […]
Thanks! Refactored.
Also, should this be `if (is_prerendered && !EventsInOrder(... […]
Done
Patch Set #5, Line 161: INVALID_ORDER_PARSE_START_FIRST_PAINT
Probably, better to define a new enum.
Done
Patch Set #5, Line 176: INVALID_ORDER_PARSE_START_FIRST_PAINT
ditto
Done
const bool, or directly passing the expression into the second argument below.
Done
ditto
Done
To view, visit change 3804328. To unsubscribe, or for help writing mail filters, visit settings.
Attention is currently required from: Ken Okada, Kouhei Ueno.
3 comments:
File components/page_load_metrics/browser/observers/assert_page_load_metrics_observer.h:
Patch Set #7, Line 17: // have no (non trivial) assumption on callback timings.
optional:
It may be good to inherit PLMOInterface rather than PLMO.
It enforce you to define all methods below, and you will need some extra works as I can guess from the comment above.
But, it encourages other people to keep this AssertPLMO up-to-date. People will notice this class and may add some fancy checks when they add a new interface.
File components/page_load_metrics/browser/observers/assert_page_load_metrics_observer.cc:
// For ease of reading.
#define IF_PRERENDERED(body) \
if (GetDelegate().GetPrerenderingState() != \
PrerenderingState::kNoPrerendering) { \
body; \
}
I prefer to define a private method, IsPrerendered, and write it as
```
if (IsPrerendered())
body;
```
Patch Set #7, Line 190: crrev.com/c/3767770
can you insert `https://`? complete url helps for some developer tools to pick up the link automatically.
ditto for others.
To view, visit change 3804328. To unsubscribe, or for help writing mail filters, visit settings.
Attention is currently required from: Kouhei Ueno, Takashi Toyoshima.
3 comments:
File components/page_load_metrics/browser/observers/assert_page_load_metrics_observer.h:
Patch Set #7, Line 17: // have no (non trivial) assumption on callback timings.
optional: […]
Makes sense.
This work is non trivial and makes diff large. I'll separate this as the next CL.
File components/page_load_metrics/browser/observers/assert_page_load_metrics_observer.cc:
// For ease of reading.
#define IF_PRERENDERED(body) \
if (GetDelegate().GetPrerenderingState() != \
PrerenderingState::kNoPrerendering) { \
body; \
}
I prefer to define a private method, IsPrerendered, and write it as […]
Done
can you insert `https://`? complete url helps for some developer tools to pick up the link automatic […]
Done
To view, visit change 3804328. To unsubscribe, or for help writing mail filters, visit settings.
Attention is currently required from: Ken Okada, Takashi Toyoshima.
Patch set 8:Code-Review +1
Attention is currently required from: Ken Okada.
Patch set 8:Code-Review +1
2 comments:
File components/page_load_metrics/browser/observers/assert_page_load_metrics_observer.h:
Patch Set #7, Line 17: // have no (non trivial) assumption on callback timings.
Makes sense. […]
sg
File components/page_load_metrics/browser/observers/assert_page_load_metrics_observer.cc:
if (IsPrerendered()) {
DCHECK(activated_);
}
fyi, `DCHECK(!IsPrerendered() || activated_);` may be a well-seen idiom to be used for this kind of checks. I'm not a big fun of it personally as it takes a little time to understand what it means, but just in case if you prefer I'm fine with either.
To view, visit change 3804328. To unsubscribe, or for help writing mail filters, visit settings.
1 comment:
File components/page_load_metrics/browser/observers/assert_page_load_metrics_observer.cc:
if (IsPrerendered()) {
DCHECK(activated_);
}
fyi, `DCHECK(!IsPrerendered() || activated_);` may be a well-seen idiom to be used for this kind of […]
Thanks. I have the same opinion.
To view, visit change 3804328. To unsubscribe, or for help writing mail filters, visit settings.
Patch set 8:Commit-Queue +2
Chromium LUCI CQ submitted this change.
PageLoadMetrics: Add AssertPageLoadMetricsObserver
As prerendering is added to navigation concept, the context and
assumptions of PageLoadMetricsObserver's callback become complex.
This CL
- adds AssertPageLoadMetricsObserver that describes the context
and assumptions of callbacks for ease of implementation of PLMOs.
- adds assertion about PageLoadTiming in
PageLoadMetricsUpdateDispatcher.
- updates comments and README.md.
Bug: 1317494, 1349308
Change-Id: I24f1231c7b45762f99315f4c457b287fe1caada4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3804328
Reviewed-by: Kouhei Ueno <kou...@chromium.org>
Commit-Queue: Ken Okada <ken...@chromium.org>
Reviewed-by: Takashi Toyoshima <toyo...@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1032878}
---
M chrome/browser/page_load_metrics/observers/README.md
M chrome/browser/page_load_metrics/page_load_metrics_initialize.cc
M components/page_load_metrics/browser/BUILD.gn
A components/page_load_metrics/browser/observers/assert_page_load_metrics_observer.cc
A components/page_load_metrics/browser/observers/assert_page_load_metrics_observer.h
M components/page_load_metrics/browser/page_load_metrics_observer_interface.h
M components/page_load_metrics/browser/page_load_metrics_update_dispatcher.cc
M components/page_load_metrics/browser/page_load_metrics_update_dispatcher.h
M components/page_load_metrics/browser/page_load_tracker.cc
M tools/metrics/histograms/enums.xml
10 files changed, 588 insertions(+), 25 deletions(-)