std::vector<base::Value> WebContents::GetGrantedDevices(
    const url::Origin& origin,
    content::PermissionType permissionType,
    content::RenderFrameHost* render_frame_host) {
  const auto& devices_for_frame_host_it =
      granted_devices_.find(render_frame_host->GetFrameTreeNodeId());
  if (devices_for_frame_host_it == granted_devices_.end())
    return {};

  const auto& current_devices_it =
      devices_for_frame_host_it->second.find(permissionType);
  if (current_devices_it == devices_for_frame_host_it->second.end())
    return {};

  const auto& origin_devices_it = current_devices_it->second.find(origin);
  if (origin_devices_it == current_devices_it->second.end())
    return {};

  std::vector<base::Value> results;
  for (const auto& object : origin_devices_it->second)
    results.push_back(object->Clone());

  return results;
}
std::vector<base::Value> WebContents::GetGrantedDevices(
    const url::Origin& origin,
    content::PermissionType permissionType,
    content::RenderFrameHost* render_frame_host) {
  const auto& devices_for_frame_host_it =
      granted_devices_.find(render_frame_host->GetFrameTreeNodeId());
  if (devices_for_frame_host_it == granted_devices_.end())
    return {};

  const auto& current_devices_it =
      devices_for_frame_host_it->second.find(permissionType);
  if (current_devices_it == devices_for_frame_host_it->second.end())
    return {};

  const auto& origin_devices_it = current_devices_it->second.find(origin);
  if (origin_devices_it == current_devices_it->second.end())
    return {};

  std::vector<base::Value> results;
  for (const auto& object : origin_devices_it->second)
    results.push_back(object->Clone());

  return results;
}