@@ -68,27 +68,20 @@ export interface CookieReportInfo {
6868 insight ?: Protocol . Audits . CookieIssueInsight ;
6969}
7070
71- export class CookieIssue extends Issue {
72- #issueDetails: Protocol . Audits . CookieIssueDetails ;
73-
74- constructor (
75- code : string , issueDetails : Protocol . Audits . CookieIssueDetails , issuesModel : SDK . IssuesModel . IssuesModel | null ,
76- issueId : Protocol . Audits . IssueId | undefined ) {
77- super ( code , issuesModel , issueId ) ;
78- this . #issueDetails = issueDetails ;
79- }
80-
71+ export class CookieIssue extends Issue < Protocol . Audits . CookieIssueDetails > {
8172 cookieId ( ) : string {
82- if ( this . #issueDetails. cookie ) {
83- const { domain, path, name} = this . #issueDetails. cookie ;
73+ const details = this . details ( ) ;
74+ if ( details . cookie ) {
75+ const { domain, path, name} = details . cookie ;
8476 const cookieId = `${ domain } ;${ path } ;${ name } ` ;
8577 return cookieId ;
8678 }
87- return this . #issueDetails . rawCookieLine ?? 'no-cookie-info' ;
79+ return this . details ( ) . rawCookieLine ?? 'no-cookie-info' ;
8880 }
8981
9082 primaryKey ( ) : string {
91- const requestId = this . #issueDetails. request ? this . #issueDetails. request . requestId : 'no-request' ;
83+ const details = this . details ( ) ;
84+ const requestId = details . request ? details . request . requestId : 'no-request' ;
9285 return `${ this . code ( ) } -(${ this . cookieId ( ) } )-(${ requestId } )` ;
9386 }
9487
@@ -210,22 +203,25 @@ export class CookieIssue extends Issue {
210203 }
211204
212205 override cookies ( ) : Iterable < Protocol . Audits . AffectedCookie > {
213- if ( this . #issueDetails. cookie ) {
214- return [ this . #issueDetails. cookie ] ;
206+ const details = this . details ( ) ;
207+ if ( details . cookie ) {
208+ return [ details . cookie ] ;
215209 }
216210 return [ ] ;
217211 }
218212
219213 override rawCookieLines ( ) : Iterable < string > {
220- if ( this . #issueDetails. rawCookieLine ) {
221- return [ this . #issueDetails. rawCookieLine ] ;
214+ const details = this . details ( ) ;
215+ if ( details . rawCookieLine ) {
216+ return [ details . rawCookieLine ] ;
222217 }
223218 return [ ] ;
224219 }
225220
226221 override requests ( ) : Iterable < Protocol . Audits . AffectedRequest > {
227- if ( this . #issueDetails. request ) {
228- return [ this . #issueDetails. request ] ;
222+ const details = this . details ( ) ;
223+ if ( details . request ) {
224+ return [ details . request ] ;
229225 }
230226 return [ ] ;
231227 }
@@ -244,27 +240,28 @@ export class CookieIssue extends Issue {
244240
245241 override isCausedByThirdParty ( ) : boolean {
246242 const outermostFrame = SDK . FrameManager . FrameManager . instance ( ) . getOutermostFrame ( ) ;
247- return isCausedByThirdParty ( outermostFrame , this . #issueDetails . cookieUrl , this . #issueDetails . siteForCookies ) ;
243+ return isCausedByThirdParty ( outermostFrame , this . details ( ) . cookieUrl , this . details ( ) . siteForCookies ) ;
248244 }
249245
250246 getKind ( ) : IssueKind {
251- if ( this . #issueDetails . cookieExclusionReasons ?. length > 0 ) {
247+ if ( this . details ( ) . cookieExclusionReasons ?. length > 0 ) {
252248 return IssueKind . PAGE_ERROR ;
253249 }
254250 return IssueKind . BREAKING_CHANGE ;
255251 }
256252
257253 makeCookieReportEntry ( ) : CookieReportInfo | undefined {
258- const status = CookieIssue . getCookieStatus ( this . #issueDetails) ;
259- if ( this . #issueDetails. cookie && this . #issueDetails. cookieUrl && status !== undefined ) {
260- const entity = ThirdPartyWeb . ThirdPartyWeb . getEntity ( this . #issueDetails. cookieUrl ) ;
254+ const status = CookieIssue . getCookieStatus ( this . details ( ) ) ;
255+ const details = this . details ( ) ;
256+ if ( details . cookie && details . cookieUrl && status !== undefined ) {
257+ const entity = ThirdPartyWeb . ThirdPartyWeb . getEntity ( details . cookieUrl ) ;
261258 return {
262- name : this . #issueDetails . cookie . name ,
263- domain : this . #issueDetails . cookie . domain ,
259+ name : details . cookie . name ,
260+ domain : details . cookie . domain ,
264261 type : entity ?. category ,
265262 platform : entity ?. name ,
266263 status,
267- insight : this . #issueDetails . insight ,
264+ insight : this . details ( ) . insight ,
268265 } ;
269266 }
270267
@@ -332,8 +329,8 @@ export class CookieIssue extends Issue {
332329 return new SDK . ConsoleModel . ConsoleMessage (
333330 issuesModel . target ( ) . model ( SDK . RuntimeModel . RuntimeModel ) , Common . Console . FrontendMessageSource . ISSUE_PANEL ,
334331 Protocol . Log . LogEntryLevel . Warning , UIStrings . consoleTpcdErrorMessage , {
335- url : this . #issueDetails . request ?. url as Platform . DevToolsPath . UrlString | undefined ,
336- affectedResources : { requestId : this . #issueDetails . request ?. requestId , issueId : this . issueId } ,
332+ url : this . details ( ) . request ?. url as Platform . DevToolsPath . UrlString | undefined ,
333+ affectedResources : { requestId : this . details ( ) . request ?. requestId , issueId : this . issueId } ,
337334 isCookieReportIssue : true
338335 } ) ;
339336 }
0 commit comments