Commit c4fbac9d authored by Russ Hamilton's avatar Russ Hamilton Committed by Commit Bot

Instrument AudioContext.getChannelData for identifiability study.

Bug: 973801
Change-Id: I5bc5154a5aecb85b5f04a70c238f3b7ef684b8df
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2354668
Commit-Queue: Russ Hamilton <behamilton@google.com>
Reviewed-by: default avatarDaniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/master@{#798135}
parent ce124c4d
...@@ -73,4 +73,17 @@ void Dactyloscoper::RecordDirectSurface(ExecutionContext* context, ...@@ -73,4 +73,17 @@ void Dactyloscoper::RecordDirectSurface(ExecutionContext* context,
Dactyloscoper::RecordDirectSurface(context, feature, builder.GetToken()); Dactyloscoper::RecordDirectSurface(context, feature, builder.GetToken());
} }
void Dactyloscoper::RecordDirectSurface(ExecutionContext* context,
WebFeature feature,
NotShared<DOMFloat32Array> buffer) {
if (!IdentifiabilityStudySettings::Get()->IsActive() || !context)
return;
if (buffer.IsNull() || buffer->lengthAsSizeT() == 0)
return;
IdentifiableTokenBuilder builder(
base::make_span(static_cast<uint8_t*>(buffer->BaseAddress()),
buffer->byteLengthAsSizeT()));
Dactyloscoper::RecordDirectSurface(context, feature, builder.GetToken());
}
} // namespace blink } // namespace blink
...@@ -8,6 +8,8 @@ ...@@ -8,6 +8,8 @@
#include "third_party/blink/public/common/privacy_budget/identifiable_token.h" #include "third_party/blink/public/common/privacy_budget/identifiable_token.h"
#include "third_party/blink/renderer/core/core_export.h" #include "third_party/blink/renderer/core/core_export.h"
#include "third_party/blink/renderer/core/frame/web_feature.h" #include "third_party/blink/renderer/core/frame/web_feature.h"
#include "third_party/blink/renderer/core/typed_arrays/array_buffer_view_helpers.h"
#include "third_party/blink/renderer/core/typed_arrays/dom_typed_array.h"
#include "third_party/blink/renderer/platform/wtf/allocator/allocator.h" #include "third_party/blink/renderer/platform/wtf/allocator/allocator.h"
#include "third_party/blink/renderer/platform/wtf/forward.h" #include "third_party/blink/renderer/platform/wtf/forward.h"
#include "third_party/blink/renderer/platform/wtf/text/wtf_string.h" #include "third_party/blink/renderer/platform/wtf/text/wtf_string.h"
...@@ -33,6 +35,9 @@ class CORE_EXPORT Dactyloscoper { ...@@ -33,6 +35,9 @@ class CORE_EXPORT Dactyloscoper {
static void RecordDirectSurface(ExecutionContext*, static void RecordDirectSurface(ExecutionContext*,
WebFeature, WebFeature,
Vector<String>); Vector<String>);
static void RecordDirectSurface(ExecutionContext*,
WebFeature,
NotShared<DOMFloat32Array>);
private: private:
DISALLOW_COPY_AND_ASSIGN(Dactyloscoper); DISALLOW_COPY_AND_ASSIGN(Dactyloscoper);
......
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
// Channel access // Channel access
readonly attribute unsigned long numberOfChannels; readonly attribute unsigned long numberOfChannels;
[HighEntropy, Measure, RaisesException] Float32Array getChannelData( [HighEntropy=Direct, Measure, RaisesException] Float32Array getChannelData(
unsigned long channelIndex); unsigned long channelIndex);
[HighEntropy, Measure, RaisesException] void copyFromChannel( [HighEntropy, Measure, RaisesException] void copyFromChannel(
Float32Array destination, Float32Array destination,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment