// Copyright 2020 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

import {ls} from '../common/common.js';  // eslint-disable-line rulesdir/es_modules_import

import {Issue, IssueCategory, IssueKind, MarkdownIssueDescription} from './Issue.js';  // eslint-disable-line no-unused-vars
import {IssuesModel} from './IssuesModel.js';  // eslint-disable-line no-unused-vars

export class SharedArrayBufferTransferIssue extends Issue {
  private issueDetails: Protocol.Audits.SharedArrayBufferTransferIssueDetails;

  constructor(issueDetails: Protocol.Audits.SharedArrayBufferTransferIssueDetails, issuesModel: IssuesModel) {
    super(Protocol.Audits.InspectorIssueCode.SharedArrayBufferTransferIssue, issuesModel);
    this.issueDetails = issueDetails;
  }

  getCategory(): IssueCategory {
    return IssueCategory.Other;
  }

  sharedArrayBufferTransfers(): Protocol.Audits.SharedArrayBufferTransferIssueDetails[] {
    return [this.issueDetails];
  }

  details(): Protocol.Audits.SharedArrayBufferTransferIssueDetails {
    return this.issueDetails;
  }

  getDescription(): MarkdownIssueDescription {
    return {
      file: 'issues/descriptions/sharedArrayBufferTransfer.md',
      substitutions: undefined,
      issueKind: IssueKind.BreakingChange,
      links: [{link: 'https://web.dev/enabling-shared-array-buffer/', linkTitle: ls`Enabling Shared Array Buffer`}],
    };
  }

  primaryKey(): string {
    return JSON.stringify(this.issueDetails);
  }
}

// Copyright 2020 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

import {ls} from '../common/common.js';  // eslint-disable-line rulesdir/es_modules_import

import {Issue, IssueCategory, IssueKind, MarkdownIssueDescription} from './Issue.js';  // eslint-disable-line no-unused-vars
import {IssuesModel} from './IssuesModel.js';  // eslint-disable-line no-unused-vars

export class SharedArrayBufferTransferIssue extends Issue {
  private issueDetails: Protocol.Audits.SharedArrayBufferTransferIssueDetails;

  constructor(issueDetails: Protocol.Audits.SharedArrayBufferTransferIssueDetails, issuesModel: IssuesModel) {
    super(Protocol.Audits.InspectorIssueCode.SharedArrayBufferTransferIssue, issuesModel);
    this.issueDetails = issueDetails;
  }

  getCategory(): IssueCategory {
    return IssueCategory.Other;
  }

  sharedArrayBufferTransfers(): Protocol.Audits.SharedArrayBufferTransferIssueDetails[] {
    return [this.issueDetails];
  }

  details(): Protocol.Audits.SharedArrayBufferTransferIssueDetails {
    return this.issueDetails;
  }

  getDescription(): MarkdownIssueDescription {
    return {
      file: 'issues/descriptions/sharedArrayBufferTransfer.md',
      substitutions: undefined,
      issueKind: IssueKind.BreakingChange,
      links: [{
        link: 'https://developer.chrome.com/blog/enabling-shared-array-buffer/',
        linkTitle: ls`Enabling Shared Array Buffer`,
      }],
    };
  }

  primaryKey(): string {
    return JSON.stringify(this.issueDetails);
  }
}

Update link for SAB usage
Update link for SAB usage

Bug: chromium:1051466
Change-Id: I763a78101cd1b397b3b1eb7176ca359821623fac
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2637619
Reviewed-by: Wolfgang Beyer <573aa99bb19da47d816981118f95c945310dd3f4@chromium.org>
Commit-Queue: Sigurd Schneider <f04d242e109628a27a0f75fd49a87722bcf291fd@chromium.org>
