Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3)

Side by Side Diff: content/renderer/pepper/pepper_media_device_manager.cc

Issue 577983002: PPAPI: Make empty webcam names turn in to a space. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: wrap in std::string constructor so types match Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/renderer/pepper/pepper_media_device_manager.h" 5 #include "content/renderer/pepper/pepper_media_device_manager.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "content/renderer/media/media_stream_dispatcher.h" 8 #include "content/renderer/media/media_stream_dispatcher.h"
9 #include "content/renderer/render_frame_impl.h" 9 #include "content/renderer/render_frame_impl.h"
10 #include "ppapi/shared_impl/ppb_device_ref_shared.h" 10 #include "ppapi/shared_impl/ppb_device_ref_shared.h"
11 11
12 namespace content { 12 namespace content {
13 13
14 namespace { 14 namespace {
15 15
16 ppapi::DeviceRefData FromStreamDeviceInfo(const StreamDeviceInfo& info) { 16 ppapi::DeviceRefData FromStreamDeviceInfo(const StreamDeviceInfo& info) {
17 ppapi::DeviceRefData data; 17 ppapi::DeviceRefData data;
18 data.id = info.device.id; 18 data.id = info.device.id;
19 data.name = info.device.name; 19 // Some Flash content can't handle an empty string, so stick a space in to
20 // make them happy. See crbug.com/408404.
21 data.name = info.device.name.empty() ? std::string(" ") : info.device.name;
20 data.type = PepperMediaDeviceManager::FromMediaStreamType(info.device.type); 22 data.type = PepperMediaDeviceManager::FromMediaStreamType(info.device.type);
21 return data; 23 return data;
22 } 24 }
23 25
24 } // namespace 26 } // namespace
25 27
26 PepperMediaDeviceManager* PepperMediaDeviceManager::GetForRenderFrame( 28 PepperMediaDeviceManager* PepperMediaDeviceManager::GetForRenderFrame(
27 RenderFrame* render_frame) { 29 RenderFrame* render_frame) {
28 PepperMediaDeviceManager* handler = 30 PepperMediaDeviceManager* handler =
29 PepperMediaDeviceManager::Get(render_frame); 31 PepperMediaDeviceManager::Get(render_frame);
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after
245 MediaStreamDispatcher* PepperMediaDeviceManager::GetMediaStreamDispatcher() 247 MediaStreamDispatcher* PepperMediaDeviceManager::GetMediaStreamDispatcher()
246 const { 248 const {
247 DCHECK(render_frame()); 249 DCHECK(render_frame());
248 MediaStreamDispatcher* const dispatcher = 250 MediaStreamDispatcher* const dispatcher =
249 static_cast<RenderFrameImpl*>(render_frame())->GetMediaStreamDispatcher(); 251 static_cast<RenderFrameImpl*>(render_frame())->GetMediaStreamDispatcher();
250 DCHECK(dispatcher); 252 DCHECK(dispatcher);
251 return dispatcher; 253 return dispatcher;
252 } 254 }
253 255
254 } // namespace content 256 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698