Add the UMA PLT.BeginToFinish{,Doc}_AfterPreconnectRequest to measure PLT just after mouseevent preconnect triggers.
[Note to sheriff] This patch requires blink patch http://crrev.com/18598003 to be landed first.
This UMA aims to measure PLT on link navigations with {mouse,gesture}-event preconnects. The PLT is to be compared between experiment/control groups using Finch.
BUG=235361
Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=214313
On 2013/07/11 16:23:52, jam wrote: > https://codereview.chromium.org/18601004/diff/14001/webkit/glue/weburlrequest_extradata_impl.h > File webkit/glue/weburlrequest_extradata_impl.h (right): > > https://codereview.chromium.org/18601004/diff/14001/webkit/glue/weburlrequest_extradata_impl.h#newcode37 > ...
7 years, 5 months ago
(2013-07-12 01:06:11 UTC)
#4
On 2013/07/11 16:23:52, jam wrote:
>
https://codereview.chromium.org/18601004/diff/14001/webkit/glue/weburlrequest...
> File webkit/glue/weburlrequest_extradata_impl.h (right):
>
>
https://codereview.chromium.org/18601004/diff/14001/webkit/glue/weburlrequest...
> webkit/glue/weburlrequest_extradata_impl.h:37: int type_id() const { return
> type_id_; }
> hmm, seems best to avoid this hand rolled RTTI
Yes. I would like to avoid this, but didn't have a good idea.
I would like to use the flag was_after_preconnect_request() in willSendRequest,
but the problem is that currently there is no way to tell if ExtraData* is
actually content::RequestExtraData with the flag, or
webkit_glue::WebURLRequestExtradataImpl without the flag. An option would be to
move the flag to WebURLRequestExtraDataImpl, but the flag is never used outside
content/.
kouhei (in TOK)
On 2013/07/12 01:06:11, kouhei wrote: > On 2013/07/11 16:23:52, jam wrote: > > > https://codereview.chromium.org/18601004/diff/14001/webkit/glue/weburlrequest_extradata_impl.h ...
7 years, 5 months ago
(2013-07-16 06:10:07 UTC)
#5
On 2013/07/12 01:06:11, kouhei wrote:
> On 2013/07/11 16:23:52, jam wrote:
> >
>
https://codereview.chromium.org/18601004/diff/14001/webkit/glue/weburlrequest...
> > File webkit/glue/weburlrequest_extradata_impl.h (right):
> >
> >
>
https://codereview.chromium.org/18601004/diff/14001/webkit/glue/weburlrequest...
> > webkit/glue/weburlrequest_extradata_impl.h:37: int type_id() const { return
> > type_id_; }
> > hmm, seems best to avoid this hand rolled RTTI
>
> Yes. I would like to avoid this, but didn't have a good idea.
>
> I would like to use the flag was_after_preconnect_request() in
willSendRequest,
> but the problem is that currently there is no way to tell if ExtraData* is
> actually content::RequestExtraData with the flag, or
> webkit_glue::WebURLRequestExtradataImpl without the flag. An option would be
to
> move the flag to WebURLRequestExtraDataImpl, but the flag is never used
outside
> content/.
jam: Hi. Do you have any good idea for avoiding this RTTI? Or, can I just add
the flag in WebURLRequestExtraDataImpl?
jam
On 2013/07/16 06:10:07, kouhei wrote: > On 2013/07/12 01:06:11, kouhei wrote: > > On 2013/07/11 ...
7 years, 5 months ago
(2013-07-17 00:37:57 UTC)
#6
On 2013/07/16 06:10:07, kouhei wrote:
> On 2013/07/12 01:06:11, kouhei wrote:
> > On 2013/07/11 16:23:52, jam wrote:
> > >
> >
>
https://codereview.chromium.org/18601004/diff/14001/webkit/glue/weburlrequest...
> > > File webkit/glue/weburlrequest_extradata_impl.h (right):
> > >
> > >
> >
>
https://codereview.chromium.org/18601004/diff/14001/webkit/glue/weburlrequest...
> > > webkit/glue/weburlrequest_extradata_impl.h:37: int type_id() const {
return
> > > type_id_; }
> > > hmm, seems best to avoid this hand rolled RTTI
> >
> > Yes. I would like to avoid this, but didn't have a good idea.
> >
> > I would like to use the flag was_after_preconnect_request() in
> willSendRequest,
> > but the problem is that currently there is no way to tell if ExtraData* is
> > actually content::RequestExtraData with the flag, or
> > webkit_glue::WebURLRequestExtradataImpl without the flag. An option would be
> to
> > move the flag to WebURLRequestExtraDataImpl, but the flag is never used
> outside
> > content/.
>
> jam: Hi. Do you have any good idea for avoiding this RTTI? Or, can I just add
> the flag in WebURLRequestExtraDataImpl?
Under what conditions is there a WebURLRequestExtraDataImpl which doesn't derive
from content::RequestExtraData and which gets passed to RenderViewImpl?
kouhei (in TOK)
On 2013/07/17 00:37:57, jam wrote: > On 2013/07/16 06:10:07, kouhei wrote: > > On 2013/07/12 ...
7 years, 5 months ago
(2013-07-17 01:11:27 UTC)
#7
On 2013/07/17 00:37:57, jam wrote:
> On 2013/07/16 06:10:07, kouhei wrote:
> > On 2013/07/12 01:06:11, kouhei wrote:
> > > On 2013/07/11 16:23:52, jam wrote:
> > > >
> > >
> >
>
https://codereview.chromium.org/18601004/diff/14001/webkit/glue/weburlrequest...
> > > > File webkit/glue/weburlrequest_extradata_impl.h (right):
> > > >
> > > >
> > >
> >
>
https://codereview.chromium.org/18601004/diff/14001/webkit/glue/weburlrequest...
> > > > webkit/glue/weburlrequest_extradata_impl.h:37: int type_id() const {
> return
> > > > type_id_; }
> > > > hmm, seems best to avoid this hand rolled RTTI
> > >
> > > Yes. I would like to avoid this, but didn't have a good idea.
> > >
> > > I would like to use the flag was_after_preconnect_request() in
> > willSendRequest,
> > > but the problem is that currently there is no way to tell if ExtraData* is
> > > actually content::RequestExtraData with the flag, or
> > > webkit_glue::WebURLRequestExtradataImpl without the flag. An option would
be
> > to
> > > move the flag to WebURLRequestExtraDataImpl, but the flag is never used
> > outside
> > > content/.
> >
> > jam: Hi. Do you have any good idea for avoiding this RTTI? Or, can I just
add
> > the flag in WebURLRequestExtraDataImpl?
>
> Under what conditions is there a WebURLRequestExtraDataImpl which doesn't
derive
> from content::RequestExtraData and which gets passed to RenderViewImpl?
The class content::RequestExtraData is derived from
webkit_glue::WebURLRequestExtraDataImpl. The base class
webkit_glue::WebURLRequestExtraDataImpl may be used via ppapi before the
WebURLRequest reaches content::RenderViewImpl. In content/, we attach more
content/ specific data to WebURLRequest, so we switch to class RequestExtraData.
Currently, the switch is only done in willSendRequest, so RTTI is not used.
However, I would like to switch to content::RequestExtraData in callback
willRequestAfterPreconnect to attach new flag "m_afterPreconnectRequest". Then,
willSendRequest can no longer assume the extradata has only
webkit_glue::WebURLRequestExtraDataImpl data. I introduced typeid in the CL and
I agree this is not clean.
Another way I was thinking of is adding the flag m_afterPreconnectRequest in
webkit_glue::WebURLRequestExtraDataImpl and do not switch to
content::RequestExtraData in callback willRequestAfterPreconnect. This way, we
don't need RTTI, but it may be layer violation to add a flag to webkit_glue
which is only used in content/.
jam
On 2013/07/17 01:11:27, kouhei wrote: > On 2013/07/17 00:37:57, jam wrote: > > On 2013/07/16 ...
7 years, 5 months ago
(2013-07-22 23:53:28 UTC)
#8
On 2013/07/17 01:11:27, kouhei wrote:
> On 2013/07/17 00:37:57, jam wrote:
> > On 2013/07/16 06:10:07, kouhei wrote:
> > > On 2013/07/12 01:06:11, kouhei wrote:
> > > > On 2013/07/11 16:23:52, jam wrote:
> > > > >
> > > >
> > >
> >
>
https://codereview.chromium.org/18601004/diff/14001/webkit/glue/weburlrequest...
> > > > > File webkit/glue/weburlrequest_extradata_impl.h (right):
> > > > >
> > > > >
> > > >
> > >
> >
>
https://codereview.chromium.org/18601004/diff/14001/webkit/glue/weburlrequest...
> > > > > webkit/glue/weburlrequest_extradata_impl.h:37: int type_id() const {
> > return
> > > > > type_id_; }
> > > > > hmm, seems best to avoid this hand rolled RTTI
> > > >
> > > > Yes. I would like to avoid this, but didn't have a good idea.
> > > >
> > > > I would like to use the flag was_after_preconnect_request() in
> > > willSendRequest,
> > > > but the problem is that currently there is no way to tell if ExtraData*
is
> > > > actually content::RequestExtraData with the flag, or
> > > > webkit_glue::WebURLRequestExtradataImpl without the flag. An option
would
> be
> > > to
> > > > move the flag to WebURLRequestExtraDataImpl, but the flag is never used
> > > outside
> > > > content/.
> > >
> > > jam: Hi. Do you have any good idea for avoiding this RTTI? Or, can I just
> add
> > > the flag in WebURLRequestExtraDataImpl?
> >
> > Under what conditions is there a WebURLRequestExtraDataImpl which doesn't
> derive
> > from content::RequestExtraData and which gets passed to RenderViewImpl?
>
> The class content::RequestExtraData is derived from
> webkit_glue::WebURLRequestExtraDataImpl. The base class
> webkit_glue::WebURLRequestExtraDataImpl may be used via ppapi before the
> WebURLRequest reaches content::RenderViewImpl. In content/, we attach more
> content/ specific data to WebURLRequest, so we switch to class
RequestExtraData.
> Currently, the switch is only done in willSendRequest, so RTTI is not used.
>
> However, I would like to switch to content::RequestExtraData in callback
> willRequestAfterPreconnect to attach new flag "m_afterPreconnectRequest".
Then,
> willSendRequest can no longer assume the extradata has only
> webkit_glue::WebURLRequestExtraDataImpl data. I introduced typeid in the CL
and
> I agree this is not clean.
>
> Another way I was thinking of is adding the flag m_afterPreconnectRequest in
> webkit_glue::WebURLRequestExtraDataImpl and do not switch to
> content::RequestExtraData in callback willRequestAfterPreconnect. This way, we
> don't need RTTI, but it may be layer violation to add a flag to webkit_glue
> which is only used in content/.
all the files in src/webkit are going to be moving to src/content, now that
layout tests run in content_shell. so feel free to add content-specific flags to
that struct.
kouhei (in TOK)
Updated patch. jam: Would you take a look? > all the files in src/webkit are ...
7 years, 5 months ago
(2013-07-23 02:23:09 UTC)
#9
Updated patch.
jam: Would you take a look?
> all the files in src/webkit are going to be moving to src/content, now that
> layout tests run in content_shell. so feel free to add content-specific flags
to
> that struct.
Thanks for the explanation. I added the flag to
webkit_glue::WebURLRequestExtraDataImpl and removed the RTTI.
jam
lgtm, sorry for the delay I missed your message. In the future feel free to ...
7 years, 5 months ago
(2013-07-26 04:59:39 UTC)
#10
Failed to apply patch for content/renderer/render_view_impl.cc: While running patch -p1 --forward --force --no-backup-if-mismatch; patching file ...
7 years, 5 months ago
(2013-07-26 10:56:43 UTC)
#13
Failed to apply patch for content/renderer/render_view_impl.cc:
While running patch -p1 --forward --force --no-backup-if-mismatch;
patching file content/renderer/render_view_impl.cc
Hunk #1 succeeded at 3870 with fuzz 1 (offset -117 lines).
Hunk #2 FAILED at 4060.
Hunk #3 FAILED at 4077.
Hunk #4 FAILED at 4088.
3 out of 4 hunks FAILED -- saving rejects to file
content/renderer/render_view_impl.cc.rej
Patch: content/renderer/render_view_impl.cc
Index: content/renderer/render_view_impl.cc
diff --git a/content/renderer/render_view_impl.cc
b/content/renderer/render_view_impl.cc
index
9cf33c0fae0ef84d7c4d81dea6cba0e09f9b2e1c..00c4341b55ed18b79b6ea08d145c8bf8f0102602
100644
--- a/content/renderer/render_view_impl.cc
+++ b/content/renderer/render_view_impl.cc
@@ -3987,6 +3987,29 @@ void RenderViewImpl::assignIdentifierToRequest(
// Ignore
}
+void RenderViewImpl::willRequestAfterPreconnect(WebFrame* frame,
+ WebURLRequest& request) {
+ WebKit::WebReferrerPolicy referrer_policy = WebKit::WebReferrerPolicyDefault;
+ WebString custom_user_agent;
+
+ if (request.extraData()) {
+ // This will only be called before willSendRequest, so only ExtraData
+ // members we have to copy here is on WebURLRequestExtraDataImpl.
+ webkit_glue::WebURLRequestExtraDataImpl* old_extra_data =
+ static_cast<webkit_glue::WebURLRequestExtraDataImpl*>(
+ request.extraData());
+
+ referrer_policy = old_extra_data->referrer_policy();
+ custom_user_agent = old_extra_data->custom_user_agent();
+ }
+
+ bool was_after_preconnect_request = true;
+ // The args after |was_after_preconnect_request| are not used, and set to
+ // correct values at |willSendRequest|.
+ request.setExtraData(new webkit_glue::WebURLRequestExtraDataImpl(
+ referrer_policy, custom_user_agent, was_after_preconnect_request));
+}
+
void RenderViewImpl::willSendRequest(WebFrame* frame,
unsigned identifier,
WebURLRequest& request,
@@ -4037,11 +4060,14 @@ void RenderViewImpl::willSendRequest(WebFrame* frame,
// agent. This needs to be done here, after WebKit is through with setting
the
// user agent on its own.
WebString custom_user_agent;
+ bool was_after_preconnect_request = false;
if (request.extraData()) {
webkit_glue::WebURLRequestExtraDataImpl* old_extra_data =
static_cast<webkit_glue::WebURLRequestExtraDataImpl*>(
request.extraData());
custom_user_agent = old_extra_data->custom_user_agent();
+ was_after_preconnect_request =
+ old_extra_data->was_after_preconnect_request();
if (!custom_user_agent.isNull()) {
if (custom_user_agent.isEmpty())
@@ -4054,6 +4080,7 @@ void RenderViewImpl::willSendRequest(WebFrame* frame,
request.setExtraData(
new RequestExtraData(referrer_policy,
custom_user_agent,
+ was_after_preconnect_request,
(frame == top_frame),
frame->identifier(),
frame->parent() == top_frame,
@@ -4065,11 +4092,15 @@ void RenderViewImpl::willSendRequest(WebFrame* frame,
DocumentState* top_document_state =
DocumentState::FromDataSource(top_data_source);
- // TODO(gavinp): separate out prefetching and prerender field trials
- // if the rel=prerender rel type is sticking around.
- if (top_document_state &&
- request.targetType() == WebURLRequest::TargetIsPrefetch)
- top_document_state->set_was_prefetcher(true);
+ if (top_document_state) {
+ // TODO(gavinp): separate out prefetching and prerender field trials
+ // if the rel=prerender rel type is sticking around.
+ if (request.targetType() == WebURLRequest::TargetIsPrefetch)
+ top_document_state->set_was_prefetcher(true);
+
+ if (was_after_preconnect_request)
+ top_document_state->set_was_after_preconnect_request(true);
+ }
request.setRequestorID(routing_id_);
request.setHasUserGesture(WebUserGestureIndicator::isProcessingUserGesture());
kouhei (in TOK)
kinuko: Would you take a look at webkit/child/** and content/renderer/pepper/url_request_info_util.cc?
7 years, 4 months ago
(2013-07-29 00:38:36 UTC)
#14
kinuko: Would you take a look at webkit/child/** and
content/renderer/pepper/url_request_info_util.cc?
kinuko
On 2013/07/29 00:38:36, kouhei wrote: > kinuko: Would you take a look at webkit/child/** and ...
7 years, 4 months ago
(2013-07-29 02:24:01 UTC)
#15
On 2013/07/29 00:38:36, kouhei wrote:
> kinuko: Would you take a look at webkit/child/** and
> content/renderer/pepper/url_request_info_util.cc?
webkit/child changes lgtm
kouhei (in TOK)
On 2013/07/29 02:24:01, kinuko wrote: > On 2013/07/29 00:38:36, kouhei wrote: > > kinuko: Would ...
7 years, 4 months ago
(2013-07-29 02:26:30 UTC)
#16
On 2013/07/29 02:24:01, kinuko wrote:
> On 2013/07/29 00:38:36, kouhei wrote:
> > kinuko: Would you take a look at webkit/child/** and
> > content/renderer/pepper/url_request_info_util.cc?
>
> webkit/child changes lgtm
Thanks for review!
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/kouhei@chromium.org/18601004/50001
7 years, 4 months ago
(2013-07-29 02:26:47 UTC)
#17
Retried try job too often on win7_aura for step(s) interactive_ui_tests http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=win7_aura&number=64297
7 years, 4 months ago
(2013-07-29 04:06:54 UTC)
#18
Retried try job too often on win7_aura for step(s) interactive_ui_tests http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=win7_aura&number=64340
7 years, 4 months ago
(2013-07-29 05:53:59 UTC)
#20
Retried try job too often on win7_aura for step(s) interactive_ui_tests http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=win7_aura&number=64441
7 years, 4 months ago
(2013-07-29 09:31:56 UTC)
#22
Retried try job too often on win7_aura for step(s) interactive_ui_tests http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=win7_aura&number=64587
7 years, 4 months ago
(2013-07-29 17:15:28 UTC)
#24
Thanks for pointing this out. https://codereview.chromium.org/18601004/diff/50001/content/renderer/render_frame_impl.cc File content/renderer/render_frame_impl.cc (right): https://codereview.chromium.org/18601004/diff/50001/content/renderer/render_frame_impl.cc#newcode500 content/renderer/render_frame_impl.cc:500: // This will only ...
Issue 18601004: Add the UMA PLT.BeginToFinish{,Doc}_AfterPreconnectRequest
(Closed)
Created 7 years, 5 months ago by kouhei (in TOK)
Modified 7 years ago
Reviewers: jam, kinuko, jochen (gone - plz use gerrit)
Base URL: https://chromium.googlesource.com/chromium/src.git@master
Comments: 10