@@ -37,10 +37,10 @@ class ResourceSummary {
37
37
/**
38
38
* @param {Array<LH.Artifacts.NetworkRequest> } networkRecords
39
39
* @param {string } mainResourceURL
40
- * @param {LH.Audit.Context } context
40
+ * @param {LH.Config.Settings } settings
41
41
* @return {Record<LH.Budget.ResourceType, ResourceEntry> }
42
42
*/
43
- static summarize ( networkRecords , mainResourceURL , context ) {
43
+ static summarize ( networkRecords , mainResourceURL , settings ) {
44
44
/** @type {Record<LH.Budget.ResourceType, ResourceEntry> } */
45
45
const resourceSummary = {
46
46
'stylesheet' : { count : 0 , resourceSize : 0 , transferSize : 0 } ,
@@ -53,7 +53,7 @@ class ResourceSummary {
53
53
'total' : { count : 0 , resourceSize : 0 , transferSize : 0 } ,
54
54
'third-party' : { count : 0 , resourceSize : 0 , transferSize : 0 } ,
55
55
} ;
56
- const budget = Budget . getMatchingBudget ( context . settings . budgets , mainResourceURL ) ;
56
+ const budget = Budget . getMatchingBudget ( settings . budgets , mainResourceURL ) ;
57
57
/** @type {ReadonlyArray<string> } */
58
58
let firstPartyHosts = [ ] ;
59
59
if ( budget && budget . options && budget . options . firstPartyHostnames ) {
@@ -102,16 +102,16 @@ class ResourceSummary {
102
102
}
103
103
104
104
/**
105
- * @param {{URL: LH.Artifacts['URL'], devtoolsLog: LH.DevtoolsLog} } data
106
- * @param {LH.Audit.Context } context
105
+ * @param {{URL: LH.Artifacts['URL'], devtoolsLog: LH.DevtoolsLog, settings: LH.Config.Settings } } data
106
+ * @param {LH.Gatherer.ComputedContext } context
107
107
* @return {Promise<Record<LH.Budget.ResourceType,ResourceEntry>> }
108
108
*/
109
109
static async compute_ ( data , context ) {
110
110
const [ networkRecords , mainResource ] = await Promise . all ( [
111
111
NetworkRecords . request ( data . devtoolsLog , context ) ,
112
112
MainResource . request ( data , context ) ,
113
113
] ) ;
114
- return ResourceSummary . summarize ( networkRecords , mainResource . url , context ) ;
114
+ return ResourceSummary . summarize ( networkRecords , mainResource . url , data . settings ) ;
115
115
}
116
116
}
117
117
0 commit comments