New issue
Advanced search Search tips

Issue 592171 link

Starred by 3 users

Issue metadata

Status: Fixed
Owner:
Closed: Mar 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 2
Type: Bug



Sign in to add a comment

PerformanceResourceTiming objects serialized as PerformanceEntry objects

Reported by jsch...@twitter.com, Mar 5 2016

Issue description

UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2664.1 Safari/537.36

Steps to reproduce the problem:
1. Visit any site, e.g. https://chromiumbugs.appspot.com
2. open JS console
3. enter performance.getEntriesByType('resource')[0]
4. observe object with ~20 keys, like connectStart, secureConnectionStart, etc (as shown in attachment)
5. enter JSON.stringify( performance.getEntriesByType('resource')[0] )
6. Observe JSON string with < 5 keys, e.g. '"{"name":"https://chromiumbugs.appspot.com/static/css/wizard.css","entryType":"resource","startTime":340.26500000000004,"duration":322.91}"'

What is the expected behavior?
All entries present a PerformanceResourceTiming object should exist after serialization, e.g. 

{
  "initiatorType": "link",
  "redirectStart": 0,
  "redirectEnd": 0,
  "fetchStart": 340.26500000000004,
  "domainLookupStart": 340.26500000000004,
  "domainLookupEnd": 340.26500000000004,
  "connectStart": 340.26500000000004,
  "connectEnd": 340.26500000000004,
  "secureConnectionStart": 0,
  "requestStart": 384.77000000000004,
  "responseStart": 644.1550000000001,
  "responseEnd": 663.1750000000001,
  "workerStart": 0,
  "name": "https://chromiumbugs.appspot.com/static/css/wizard.css",
  "entryType": "resource",
  "startTime": 340.26500000000004,
  "duration": 322.91
}

What went wrong?
Many keys are missing. e.g. 

{
  "name": "https://chromiumbugs.appspot.com/static/css/wizard.css",
  "entryType": "resource",
  "startTime": 340.26500000000004,
  "duration": 322.91
}

It appears to be serialized as a PerformanceEntry object, not a PerformanceResourceTiming object

Did this work before? N/A 

Chrome version: 51.0.2664.1  Channel: canary
OS Version: OS X 10.11.3
Flash Version: Shockwave Flash 21.0 r0

This applies to console's copy command as well
 
Screen Shot 2016-03-04 at 4.58.26 PM.png
174 KB View Download

Comment 1 by kochi@chromium.org, Mar 7 2016

Labels: -OS-Mac OS-All
Owner: ksakamoto@chromium.org
Status: Assigned (was: Unconfirmed)
Assigning ksakamoto@ - if you know any better person to look at this issue, could you reassign?

Comment 2 by kochi@chromium.org, Mar 7 2016

Components: -Blink Blink>PerformanceAPIs
Project Member

Comment 3 by bugdroid1@chromium.org, Mar 11 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/48db6a49b37d8302a9bedd6321110546dccaf7eb

commit 48db6a49b37d8302a9bedd6321110546dccaf7eb
Author: ksakamoto <ksakamoto@chromium.org>
Date: Fri Mar 11 08:11:07 2016

Fix JSON serialization of PerformanceEntry subclasses

Attributes defined in PerformanceEntry subclasses were not included in
serialized object because toJSONForBinding() wasn't polymorphic.

BUG= 592171 
test=http/tests/misc/performance-entry-serializer.html

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

Cr-Commit-Position: refs/heads/master@{#380577}

[add] https://crrev.com/48db6a49b37d8302a9bedd6321110546dccaf7eb/third_party/WebKit/LayoutTests/http/tests/misc/performance-entry-serializer.html
[modify] https://crrev.com/48db6a49b37d8302a9bedd6321110546dccaf7eb/third_party/WebKit/Source/core/timing/PerformanceCompositeTiming.cpp
[modify] https://crrev.com/48db6a49b37d8302a9bedd6321110546dccaf7eb/third_party/WebKit/Source/core/timing/PerformanceCompositeTiming.h
[modify] https://crrev.com/48db6a49b37d8302a9bedd6321110546dccaf7eb/third_party/WebKit/Source/core/timing/PerformanceEntry.cpp
[modify] https://crrev.com/48db6a49b37d8302a9bedd6321110546dccaf7eb/third_party/WebKit/Source/core/timing/PerformanceEntry.h
[modify] https://crrev.com/48db6a49b37d8302a9bedd6321110546dccaf7eb/third_party/WebKit/Source/core/timing/PerformanceRenderTiming.cpp
[modify] https://crrev.com/48db6a49b37d8302a9bedd6321110546dccaf7eb/third_party/WebKit/Source/core/timing/PerformanceRenderTiming.h
[modify] https://crrev.com/48db6a49b37d8302a9bedd6321110546dccaf7eb/third_party/WebKit/Source/core/timing/PerformanceResourceTiming.cpp
[modify] https://crrev.com/48db6a49b37d8302a9bedd6321110546dccaf7eb/third_party/WebKit/Source/core/timing/PerformanceResourceTiming.h

Status: Fixed (was: Assigned)
 Issue 587713  has been merged into this issue.

Sign in to add a comment