forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Instrument RTCRtp[Sender/Receiver] for the identifiability study.
Bug: 973801 Change-Id: Ia1b993bbbde328442bf041c25de912f14be06d0d Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2485677 Commit-Queue: Caleb Raitto <caraitto@chromium.org> Reviewed-by: Florent Castelli <orphis@chromium.org> Reviewed-by: Guido Urdaneta <guidou@chromium.org> Reviewed-by: Asanka Herath <asanka@chromium.org> Cr-Commit-Position: refs/heads/master@{#821873}
- Loading branch information
Showing
12 changed files
with
142 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
64 changes: 64 additions & 0 deletions
64
third_party/blink/renderer/modules/peerconnection/identifiability_metrics.cc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
// 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. | ||
|
||
#include "third_party/blink/renderer/modules/peerconnection/identifiability_metrics.h" | ||
#include "third_party/blink/renderer/modules/peerconnection/rtc_rtp_codec_capability.h" | ||
#include "third_party/blink/renderer/modules/peerconnection/rtc_rtp_header_extension_capability.h" | ||
#include "third_party/blink/renderer/platform/privacy_budget/identifiability_digest_helpers.h" | ||
|
||
namespace blink { | ||
|
||
void IdentifiabilityAddRTCRtpCapabilitiesToBuilder( | ||
IdentifiableTokenBuilder& builder, | ||
const RTCRtpCapabilities& capabilities) { | ||
if (capabilities.hasCodecs()) { | ||
for (const auto& codec : capabilities.codecs()) { | ||
if (codec->hasMimeType()) { | ||
builder.AddToken( | ||
IdentifiabilitySensitiveStringToken(codec->mimeType())); | ||
} else { | ||
builder.AddToken(IdentifiableToken()); | ||
} | ||
if (codec->hasClockRate()) { | ||
builder.AddValue(codec->clockRate()); | ||
} else { | ||
builder.AddToken(IdentifiableToken()); | ||
} | ||
if (codec->hasChannels()) { | ||
builder.AddValue(codec->channels()); | ||
} else { | ||
builder.AddToken(IdentifiableToken()); | ||
} | ||
if (codec->hasSdpFmtpLine()) { | ||
builder.AddToken( | ||
IdentifiabilitySensitiveStringToken(codec->sdpFmtpLine())); | ||
} else { | ||
builder.AddToken(IdentifiableToken()); | ||
} | ||
if (codec->hasScalabilityModes()) { | ||
for (const auto& mode : codec->scalabilityModes()) { | ||
builder.AddToken(IdentifiabilitySensitiveStringToken(mode)); | ||
} | ||
} else { | ||
builder.AddToken(IdentifiableToken()); | ||
} | ||
} | ||
} else { | ||
builder.AddToken(IdentifiableToken()); | ||
} | ||
if (capabilities.hasHeaderExtensions()) { | ||
for (const auto& header_extension : capabilities.headerExtensions()) { | ||
if (header_extension->hasUri()) { | ||
builder.AddToken( | ||
IdentifiabilitySensitiveStringToken(header_extension->uri())); | ||
} else { | ||
builder.AddToken(IdentifiableToken()); | ||
} | ||
} | ||
} else { | ||
builder.AddToken(IdentifiableToken()); | ||
} | ||
} | ||
|
||
} // namespace blink |
19 changes: 19 additions & 0 deletions
19
third_party/blink/renderer/modules/peerconnection/identifiability_metrics.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// 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. | ||
|
||
#ifndef THIRD_PARTY_BLINK_RENDERER_MODULES_PEERCONNECTION_IDENTIFIABILITY_METRICS_H_ | ||
#define THIRD_PARTY_BLINK_RENDERER_MODULES_PEERCONNECTION_IDENTIFIABILITY_METRICS_H_ | ||
|
||
#include "third_party/blink/public/common/privacy_budget/identifiable_token_builder.h" | ||
#include "third_party/blink/renderer/modules/peerconnection/rtc_rtp_capabilities.h" | ||
|
||
namespace blink { | ||
|
||
void IdentifiabilityAddRTCRtpCapabilitiesToBuilder( | ||
IdentifiableTokenBuilder& builder, | ||
const RTCRtpCapabilities& capabilities); | ||
|
||
} // namespace blink | ||
|
||
#endif // THIRD_PARTY_BLINK_RENDERER_MODULES_PEERCONNECTION_IDENTIFIABILITY_METRICS_H_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters