Skip to content

Commit

Permalink
[devtools] Remove unused Mojo types and corresponding conversion code
Browse files Browse the repository at this point in the history
[email protected]

Bug: chromium:1202622
Change-Id: I66eae0c8605e950a16f8cb67daf1ff14d566358e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2901519
Reviewed-by: Sigurd Schneider <[email protected]>
Reviewed-by: Alex Gough <[email protected]>
Commit-Queue: Simon Zünd <[email protected]>
Cr-Commit-Position: refs/heads/master@{#884320}
NOKEYCHECK=True
GitOrigin-RevId: ac8bf8cee14d60bd48681b2c4f5b23b862b22cf4
  • Loading branch information
szuend authored and copybara-github committed May 19, 2021
1 parent 30af5ff commit 0876526
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 65 deletions.
19 changes: 0 additions & 19 deletions blink/public/mojom/devtools/inspector_issue.mojom
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ enum InspectorIssueCode {
kTrustedWebActivityIssue,
kHeavyAdIssue,
kLowTextContrastIssue,
kAttributionReportingIssue,
};

// Information about a cookie that is affected by an issue.
Expand Down Expand Up @@ -173,23 +172,6 @@ struct LowTextContrastIssue {
string font_weight;
};

enum AttributionReportingIssueType {
kPermissionPolicyDisabled,
kInvalidAttributionSourceEventId,
kInvalidAttributionData,
kAttributionSourceUntrustworthyOrigin,
kAttributionUntrustworthyOrigin,
};

struct AttributionReportingIssue {
AttributionReportingIssueType violation_type;
AffectedFrame? frame;
AffectedRequest? request;
// 0 is not a valid node id and is used to indicate absence.
int32 violating_node_id = 0;
string? invalid_parameter;
};

// A collection of optional fields that may store additional data depending
// on the issue code.
struct InspectorIssueDetails {
Expand All @@ -201,7 +183,6 @@ struct InspectorIssueDetails {
TrustedWebActivityIssueDetails? twa_issue_details;
HeavyAdIssueDetails? heavy_ad_issue_details;
LowTextContrastIssue? low_text_contrast_details;
AttributionReportingIssue? attribution_reporting_issue_details;
};

struct InspectorIssueInfo {
Expand Down
46 changes: 0 additions & 46 deletions blink/renderer/core/inspector/inspector_issue_conversion.cc
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,6 @@ blink::protocol::String InspectorIssueCodeValue(
return "";
case mojom::blink::InspectorIssueCode::kLowTextContrastIssue:
return protocol::Audits::InspectorIssueCodeEnum::LowTextContrastIssue;
case mojom::blink::InspectorIssueCode::kAttributionReportingIssue:
return protocol::Audits::InspectorIssueCodeEnum::
AttributionReportingIssue;
}
}

Expand Down Expand Up @@ -319,32 +316,6 @@ std::unique_ptr<protocol::Audits::SourceCodeLocation> BuildAffectedLocation(
return protocol_affected_location;
}

protocol::String BuildAttributionReportingIssueType(
blink::mojom::blink::AttributionReportingIssueType type) {
switch (type) {
case blink::mojom::blink::AttributionReportingIssueType::
kPermissionPolicyDisabled:
return protocol::Audits::AttributionReportingIssueTypeEnum::
PermissionPolicyDisabled;
case blink::mojom::blink::AttributionReportingIssueType::
kInvalidAttributionSourceEventId:
return protocol::Audits::AttributionReportingIssueTypeEnum::
InvalidAttributionSourceEventId;
case blink::mojom::blink::AttributionReportingIssueType::
kInvalidAttributionData:
return protocol::Audits::AttributionReportingIssueTypeEnum::
InvalidAttributionData;
case blink::mojom::blink::AttributionReportingIssueType::
kAttributionSourceUntrustworthyOrigin:
return protocol::Audits::AttributionReportingIssueTypeEnum::
AttributionSourceUntrustworthyOrigin;
case blink::mojom::blink::AttributionReportingIssueType::
kAttributionUntrustworthyOrigin:
return protocol::Audits::AttributionReportingIssueTypeEnum::
AttributionUntrustworthyOrigin;
}
}

} // namespace

std::unique_ptr<protocol::Audits::InspectorIssue>
Expand Down Expand Up @@ -460,23 +431,6 @@ ConvertInspectorIssueToProtocolFormat(InspectorIssue* issue) {
issueDetails.setLowTextContrastIssueDetails(std::move(lowContrastDetails));
}

if (issue->Details()->attribution_reporting_issue_details) {
const auto* d = issue->Details()->attribution_reporting_issue_details.get();
auto details = protocol::Audits::AttributionReportingIssueDetails::create()
.setViolationType(BuildAttributionReportingIssueType(
d->violation_type))
.build();
if (d->frame)
details->setFrame(BuildAffectedFrame(d->frame));
if (d->request)
details->setRequest(BuildAffectedRequest(d->request));
if (d->violating_node_id)
details->setViolatingNodeId(d->violating_node_id);
if (d->invalid_parameter)
details->setInvalidParameter(d->invalid_parameter);
issueDetails.setAttributionReportingIssueDetails(std::move(details));
}

return protocol::Audits::InspectorIssue::create()
.setCode(InspectorIssueCodeValue(issue->Code()))
.setDetails(issueDetails.build())
Expand Down

0 comments on commit 0876526

Please sign in to comment.