Commit 271b5ac0 authored by dmichael's avatar dmichael Committed by Commit bot

PPAPI: Make empty webcam names turn in to a space.

When permission for a webcam has not yet been granted, we still allow
enumerating the devices, but omit the name. Some Flash content can't
deal with an empty string for the webcam name. This turns the empty
string in to a space to work around the problem.

BUG=408404

Review URL: https://codereview.chromium.org/577983002

Cr-Commit-Position: refs/heads/master@{#295476}
parent 45e80089
...@@ -16,7 +16,9 @@ namespace { ...@@ -16,7 +16,9 @@ namespace {
ppapi::DeviceRefData FromStreamDeviceInfo(const StreamDeviceInfo& info) { ppapi::DeviceRefData FromStreamDeviceInfo(const StreamDeviceInfo& info) {
ppapi::DeviceRefData data; ppapi::DeviceRefData data;
data.id = info.device.id; data.id = info.device.id;
data.name = info.device.name; // Some Flash content can't handle an empty string, so stick a space in to
// make them happy. See crbug.com/408404.
data.name = info.device.name.empty() ? std::string(" ") : info.device.name;
data.type = PepperMediaDeviceManager::FromMediaStreamType(info.device.type); data.type = PepperMediaDeviceManager::FromMediaStreamType(info.device.type);
return data; return data;
} }
......
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