Bound audio API stable ID to a kiosk app profile

Desktop / Chromium - tbarzic [chromium.org] - 17 April 2017 19:12 EDT

This addresses a concern raised during the privacy review for the API. The problem is that stable ID might be unique to a particular audio device, thus making the audio device globally identifiable.

This updates stable device ID exposed by audio API to be unique within a browser context, but not globally. The stable ID is calculated from the stable ID returned by cras using a persistent map from the cras stable ID to an ordinal ID, which is assigned as the index of the stable ID in the list of known stable IDs saved in user prefs.

BUG=707418

Review-Url: https://codereview.chromium.org/2787783003 Cr-Commit-Position: refs/heads/master@{#465053}

fa3c7ef Bound audio API stable ID to a kiosk app profile
chrome/browser/prefs/browser_prefs.cc | 2 +
extensions/browser/BUILD.gn | 6 +-
extensions/browser/api/audio/BUILD.gn | 5 ++
extensions/browser/api/audio/audio_api.cc | 28 +++++--
extensions/browser/api/audio/audio_api.h | 16 +++-
.../api/audio/audio_device_id_calculator.cc | 66 ++++++++++++++++
.../browser/api/audio/audio_device_id_calculator.h | 60 +++++++++++++++
.../audio/audio_device_id_calculator_unittest.cc | 88 ++++++++++++++++++++++
extensions/browser/api/audio/audio_service.cc | 3 +-
extensions/browser/api/audio/audio_service.h | 4 +-
.../browser/api/audio/audio_service_chromeos.cc | 20 +++--
extensions/browser/api/audio/pref_names.cc | 11 +++
extensions/browser/api/audio/pref_names.h | 18 +++++
.../browser/shell_extensions_browser_client.cc | 2 +
extensions/shell/browser/shell_prefs.cc | 2 +
.../data/api_test/audio/add_nodes/background.js | 6 +-
.../data/api_test/audio/remove_nodes/background.js | 4 +-
extensions/test/data/api_test/audio/test.js | 24 +++---
18 files changed, 330 insertions(+), 35 deletions(-)

Upstream: git.chromium.org


  • Share