Offer Resource Timing in workers
This patch makes worker's performance timeline populated with resource
timings. Most of the changes are plumbing for ResourceTimingInfo from
ResourceFetcher in main thread to WorkerThreadableLoader in worker
thread.
BUG=465641
TEST=http/tests/workers,http/tests/serviceworker
Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=197707
Looking good. I'm still not 100% comfortable with the current plumbing, but we could probably ...
4 years, 10 months ago
(2015-06-23 05:09:50 UTC)
#10
Looking good. I'm still not 100% comfortable with the current plumbing, but we
could probably call for Nate's voice here.
https://codereview.chromium.org/1184403003/diff/140001/Source/core/fetch/Reso...
File Source/core/fetch/ResourceFetcher.cpp (right):
https://codereview.chromium.org/1184403003/diff/140001/Source/core/fetch/Reso...
Source/core/fetch/ResourceFetcher.cpp:816:
resource->reportResourceTimingToWorker(*info);
I'm wondering if we could rather make it general to both worker and document?
(From Resource's pov it's basically just about exposing resource timing info to
its client, it doesn't seem to need to know about Worker)
Putting aside all gotcha my preference is:
Resource has a method like: reportResourceTimingToClients()
we could have a default impl which sends timing info to clients
ResourceClient has a method like: didReceiveResourceTiming()
which could have a default impl for Document case
DocumentThreadableLoader overrides it
Also: please help me understand a bit more: for worker case is RawResource the
only resource we want to care about, or would we need to implement it in other
resource/resourceclient someday?
4 years, 10 months ago
(2015-06-23 06:47:34 UTC)
#11
https://codereview.chromium.org/1184403003/diff/140001/Source/core/fetch/Reso...
File Source/core/fetch/ResourceFetcher.cpp (right):
https://codereview.chromium.org/1184403003/diff/140001/Source/core/fetch/Reso...
Source/core/fetch/ResourceFetcher.cpp:816:
resource->reportResourceTimingToWorker(*info);
On 2015/06/23 05:09:50, kinuko wrote:
> I'm wondering if we could rather make it general to both worker and document?
> (From Resource's pov it's basically just about exposing resource timing info
to
> its client, it doesn't seem to need to know about Worker)
Yeah I tried to unify worker / document path, but couldn't come up with an
elegant way to do so.
> Putting aside all gotcha my preference is:
>
> Resource has a method like: reportResourceTimingToClients()
> we could have a default impl which sends timing info to clients
> ResourceClient has a method like: didReceiveResourceTiming()
> which could have a default impl for Document case
> DocumentThreadableLoader overrides it
Thanks for the naming suggestion. Renamed the methods in that manner.
Now Resource doesn't care about worker, so reportResourceTimingToClients is
called unconditionally and only DocumentThreadableLoader handles it.
> Also: please help me understand a bit more: for worker case is RawResource the
> only resource we want to care about, or would we need to implement it in other
> resource/resourceclient someday?
We only need to care about RawResource as long as all worker-initiated requests
use DocumentThreadableLoader, since DocumentThreadableLoader treats every
resource as RawResource.
kinuko
Thanks, lgtm https://codereview.chromium.org/1184403003/diff/160001/Source/core/fetch/Resource.h File Source/core/fetch/Resource.h (right): https://codereview.chromium.org/1184403003/diff/160001/Source/core/fetch/Resource.h#newcode200 Source/core/fetch/Resource.h:200: // Reports resource timing to the worker ...
4 years, 10 months ago
(2015-06-23 07:48:42 UTC)
#12
Nate, could you take a look? https://codereview.chromium.org/1184403003/diff/160001/Source/core/fetch/Resource.h File Source/core/fetch/Resource.h (right): https://codereview.chromium.org/1184403003/diff/160001/Source/core/fetch/Resource.h#newcode200 Source/core/fetch/Resource.h:200: // Reports resource ...
4 years, 10 months ago
(2015-06-23 08:05:08 UTC)
#13
LGTM, though I don't think you have approval for Source/platform/ yet? https://codereview.chromium.org/1184403003/diff/180001/Source/core/loader/ThreadableLoaderClient.h File Source/core/loader/ThreadableLoaderClient.h (right): ...
4 years, 10 months ago
(2015-06-23 18:17:17 UTC)
#14
+tkent@ Kent-san, could you take a look for Source/platform? This patch moves ResourceTimingInfo to platform/ ...
4 years, 10 months ago
(2015-06-24 01:31:32 UTC)
#16
+tkent@
Kent-san, could you take a look for Source/platform?
This patch moves ResourceTimingInfo to platform/ to make it cross-thread
copyable.
https://codereview.chromium.org/1184403003/diff/180001/Source/core/loader/Thr...
File Source/core/loader/ThreadableLoaderClient.h (right):
https://codereview.chromium.org/1184403003/diff/180001/Source/core/loader/Thr...
Source/core/loader/ThreadableLoaderClient.h:60: virtual void
didReceiveResourceTiming(const ResourceTimingInfo&) { }
On 2015/06/23 18:17:17, Nate Chapin wrote:
> I don't know the worker logic very well; is there a way to send a message to
the
> worker without going through ThreadableLoaderClient? This is ok, but the
> plumbing does seem a little strange.
I agree this is a bit strange, but kinuko@ and I think there's no cleaner way...
https://codereview.chromium.org/1184403003/diff/180001/Source/core/timing/Res...
File Source/core/timing/ResourceTimingInfo.h (left):
https://codereview.chromium.org/1184403003/diff/180001/Source/core/timing/Res...
Source/core/timing/ResourceTimingInfo.h:1: /*
On 2015/06/23 18:17:17, Nate Chapin wrote:
> Nit #1: This looks like it's blanking the file, rather than deleting it?
It seems codereview marks a file 'M' when it is moved?
The patch header says "deleted file mode 100644", so I think I'm deleting it.
> Nit #2: Please remove the rule for core/timing/ResourceTimingInfo.h in
> Source/core/fetch/DEPS. Now that it is in platform/network/, it is no longer a
> layering violation.
Done.
tkent
Looking. On 2015/06/24 01:31:32, Kunihiko Sakamoto wrote: > Kent-san, could you take a look for ...
4 years, 10 months ago
(2015-06-24 01:51:50 UTC)
#17
Looking.
On 2015/06/24 01:31:32, Kunihiko Sakamoto wrote:
> Kent-san, could you take a look for Source/platform?
> This patch moves ResourceTimingInfo to platform/ to make it cross-thread
> copyable.
You don't need to move ResourceTimingInfo only for cross-thread copyable.
But the moving makes sense because it is network-related data.
Try jobs failed on following builders: mac_blink_rel on tryserver.blink (JOB_FAILED, http://build.chromium.org/p/tryserver.blink/builders/mac_blink_rel/builds/60506)
4 years, 10 months ago
(2015-06-24 05:29:11 UTC)
#27
Issue 1184403003: Offer Resource Timing in workers
(Closed)
Created 4 years, 10 months ago by Kunihiko Sakamoto
Modified 4 years, 10 months ago
Reviewers: Nate Chapin, kinuko, tkent
Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Comments: 18