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

Side by Side Diff: content/renderer/renderer_blink_platform_impl.cc

Issue 2626023006: Check that render-frame is valid before returning audio params in Blink. (Closed)
Patch Set: Add test Created 3 years, 11 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 | « content/renderer/blink_platform_audio_hardware_browsertest.cc ('k') | content/test/BUILD.gn » ('j') | 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/renderer_blink_platform_impl.h" 5 #include "content/renderer/renderer_blink_platform_impl.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 double g_test_device_light_data = -1; 173 double g_test_device_light_data = -1;
174 base::LazyInstance<blink::WebDeviceMotionData>::Leaky 174 base::LazyInstance<blink::WebDeviceMotionData>::Leaky
175 g_test_device_motion_data = LAZY_INSTANCE_INITIALIZER; 175 g_test_device_motion_data = LAZY_INSTANCE_INITIALIZER;
176 base::LazyInstance<blink::WebDeviceOrientationData>::Leaky 176 base::LazyInstance<blink::WebDeviceOrientationData>::Leaky
177 g_test_device_orientation_data = LAZY_INSTANCE_INITIALIZER; 177 g_test_device_orientation_data = LAZY_INSTANCE_INITIALIZER;
178 178
179 media::AudioParameters GetAudioHardwareParams() { 179 media::AudioParameters GetAudioHardwareParams() {
180 blink::WebLocalFrame* const web_frame = 180 blink::WebLocalFrame* const web_frame =
181 blink::WebLocalFrame::frameForCurrentContext(); 181 blink::WebLocalFrame::frameForCurrentContext();
182 RenderFrame* const render_frame = RenderFrame::FromWebFrame(web_frame); 182 RenderFrame* const render_frame = RenderFrame::FromWebFrame(web_frame);
183 if (!render_frame)
184 return media::AudioParameters::UnavailableDeviceParams();
185
183 return AudioDeviceFactory::GetOutputDeviceInfo(render_frame->GetRoutingID(), 186 return AudioDeviceFactory::GetOutputDeviceInfo(render_frame->GetRoutingID(),
184 0, std::string(), 187 0, std::string(),
185 web_frame->getSecurityOrigin()) 188 web_frame->getSecurityOrigin())
186 .output_params(); 189 .output_params();
187 } 190 }
188 191
189 } // namespace 192 } // namespace
190 193
191 //------------------------------------------------------------------------------ 194 //------------------------------------------------------------------------------
192 195
(...skipping 1102 matching lines...) Expand 10 before | Expand all | Expand 10 after
1295 return &trial_token_validator_; 1298 return &trial_token_validator_;
1296 } 1299 }
1297 1300
1298 void RendererBlinkPlatformImpl::workerContextCreated( 1301 void RendererBlinkPlatformImpl::workerContextCreated(
1299 const v8::Local<v8::Context>& worker) { 1302 const v8::Local<v8::Context>& worker) {
1300 GetContentClient()->renderer()->DidInitializeWorkerContextOnWorkerThread( 1303 GetContentClient()->renderer()->DidInitializeWorkerContextOnWorkerThread(
1301 worker); 1304 worker);
1302 } 1305 }
1303 1306
1304 } // namespace content 1307 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/blink_platform_audio_hardware_browsertest.cc ('k') | content/test/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698