Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
3848575
remove network record dependency
patrickhulce Jun 8, 2018
58e7c51
fix byte-efficiency-audit
patrickhulce Jun 8, 2018
f35c56c
SUPER WIP
patrickhulce Jun 8, 2018
ade9def
fix tests
patrickhulce Jun 8, 2018
05194ea
fix tests
patrickhulce Jun 8, 2018
dd11851
golden LHR diffs
patrickhulce Jun 8, 2018
5988b11
remove commented code
patrickhulce Jun 11, 2018
1c16232
more tests
patrickhulce Jun 11, 2018
aecb428
more feedback
patrickhulce Jun 13, 2018
432b989
dump more of WebInspector
patrickhulce Jun 13, 2018
0324bc0
fix resource category
patrickhulce Jun 13, 2018
c5db54d
Merge branch 'master' into standardize_network_req_api
patrickhulce Jun 13, 2018
5836b4c
merge conflicts
patrickhulce Jun 13, 2018
cee1f0e
cleanup ts-nocheck files
patrickhulce Jun 13, 2018
4212ab6
fix mixed content
patrickhulce Jun 13, 2018
7634cf8
typo
patrickhulce Jun 14, 2018
21fe6df
feedback
patrickhulce Jun 14, 2018
1f0ac70
Merge branch 'master' into standardize_network_req_api
patrickhulce Jun 15, 2018
915449f
remove unused portions of ResourceType
patrickhulce Jun 18, 2018
95551ee
Merge branch 'master' into standardize_network_req_api
patrickhulce Jun 18, 2018
92e8abf
match two subtle DT behaviors
patrickhulce Jun 18, 2018
b831cbb
more DT behavior matching
patrickhulce Jun 19, 2018
911a268
Merge branch 'master' into standardize_network_req_api
patrickhulce Jun 19, 2018
d11d2e7
update lantern expectations
patrickhulce Jun 19, 2018
a2015af
feedback
patrickhulce Jun 19, 2018
e5bea12
more feedback
patrickhulce Jun 19, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
more DT behavior matching
  • Loading branch information
patrickhulce committed Jun 19, 2018
commit b831cbb3b70ef8942841791816031566560b78ab
10 changes: 9 additions & 1 deletion lighthouse-core/lib/network-request.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ module.exports = class NetworkRequest {
constructor() {
this.requestId = '';
this._requestId = '';
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as mentioned, i'd love if a followup normalized these paths.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah for sure 👍

this.connectionId = '';
// TODO(phulce): remove default DevTools connectionId
this.connectionId = '0';
this.connectionReused = false;

this.url = '';
Expand Down Expand Up @@ -138,6 +139,8 @@ module.exports = class NetworkRequest {
* @param {LH.Crdp.Network.LoadingFinishedEvent} data
*/
onLoadingFinished(data) {
if (this.finished) return;
Copy link
Copy Markdown
Contributor

@brendankenny brendankenny Jun 19, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

when does this happen and is that bad or just expected?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it seems to be expected for a certain class of request failures (aborted redirected requests)

not sure how to best comment it...maybe?
// On cancelled requests, DevTools can send duplicate erroneous events, prefer the first one for best timing data

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that's 👍


this.finished = true;
this.endTime = data.timestamp;
if (data.encodedDataLength >= 0) {
Expand All @@ -151,6 +154,8 @@ module.exports = class NetworkRequest {
* @param {LH.Crdp.Network.LoadingFailedEvent} data
*/
onLoadingFailed(data) {
if (this.finished) return;

this.finished = true;
this.endTime = data.timestamp;

Expand Down Expand Up @@ -187,6 +192,9 @@ module.exports = class NetworkRequest {
* @param {LH.Crdp.Network.ResponseReceivedEvent['type']=} resourceType
*/
_onResponse(response, timestamp, resourceType) {
this.url = response.url;
this._url = response.url;

this.connectionId = String(response.connectionId);
this.connectionReused = response.connectionReused;

Expand Down