| OLD | NEW |
| 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 <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 #include "content/public/common/service_registry.h" | 51 #include "content/public/common/service_registry.h" |
| 52 #include "content/public/common/webplugininfo.h" | 52 #include "content/public/common/webplugininfo.h" |
| 53 #include "content/public/renderer/content_renderer_client.h" | 53 #include "content/public/renderer/content_renderer_client.h" |
| 54 #include "content/renderer/battery_status/battery_status_dispatcher.h" | 54 #include "content/renderer/battery_status/battery_status_dispatcher.h" |
| 55 #include "content/renderer/cache_storage/webserviceworkercachestorage_impl.h" | 55 #include "content/renderer/cache_storage/webserviceworkercachestorage_impl.h" |
| 56 #include "content/renderer/device_sensors/device_light_event_pump.h" | 56 #include "content/renderer/device_sensors/device_light_event_pump.h" |
| 57 #include "content/renderer/device_sensors/device_motion_event_pump.h" | 57 #include "content/renderer/device_sensors/device_motion_event_pump.h" |
| 58 #include "content/renderer/device_sensors/device_orientation_absolute_event_pump
.h" | 58 #include "content/renderer/device_sensors/device_orientation_absolute_event_pump
.h" |
| 59 #include "content/renderer/device_sensors/device_orientation_event_pump.h" | 59 #include "content/renderer/device_sensors/device_orientation_event_pump.h" |
| 60 #include "content/renderer/dom_storage/webstoragenamespace_impl.h" | 60 #include "content/renderer/dom_storage/webstoragenamespace_impl.h" |
| 61 #include "content/renderer/font_access/web_font_access_impl.h" |
| 61 #include "content/renderer/gamepad_shared_memory_reader.h" | 62 #include "content/renderer/gamepad_shared_memory_reader.h" |
| 62 #include "content/renderer/media/audio_decoder.h" | 63 #include "content/renderer/media/audio_decoder.h" |
| 63 #include "content/renderer/media/canvas_capture_handler.h" | 64 #include "content/renderer/media/canvas_capture_handler.h" |
| 64 #include "content/renderer/media/media_recorder_handler.h" | 65 #include "content/renderer/media/media_recorder_handler.h" |
| 65 #include "content/renderer/media/renderer_webaudiodevice_impl.h" | 66 #include "content/renderer/media/renderer_webaudiodevice_impl.h" |
| 66 #include "content/renderer/media/renderer_webmidiaccessor_impl.h" | 67 #include "content/renderer/media/renderer_webmidiaccessor_impl.h" |
| 67 #include "content/renderer/media/rtc_certificate_generator.h" | 68 #include "content/renderer/media/rtc_certificate_generator.h" |
| 68 #include "content/renderer/render_thread_impl.h" | 69 #include "content/renderer/render_thread_impl.h" |
| 69 #include "content/renderer/renderer_clipboard_delegate.h" | 70 #include "content/renderer/renderer_clipboard_delegate.h" |
| 70 #include "content/renderer/screen_orientation/screen_orientation_observer.h" | 71 #include "content/renderer/screen_orientation/screen_orientation_observer.h" |
| (...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 240 : BlinkPlatformImpl(renderer_scheduler->DefaultTaskRunner()), | 241 : BlinkPlatformImpl(renderer_scheduler->DefaultTaskRunner()), |
| 241 main_thread_(renderer_scheduler->CreateMainThread()), | 242 main_thread_(renderer_scheduler->CreateMainThread()), |
| 242 clipboard_delegate_(new RendererClipboardDelegate), | 243 clipboard_delegate_(new RendererClipboardDelegate), |
| 243 clipboard_(new WebClipboardImpl(clipboard_delegate_.get())), | 244 clipboard_(new WebClipboardImpl(clipboard_delegate_.get())), |
| 244 mime_registry_(new RendererBlinkPlatformImpl::MimeRegistry), | 245 mime_registry_(new RendererBlinkPlatformImpl::MimeRegistry), |
| 245 sudden_termination_disables_(0), | 246 sudden_termination_disables_(0), |
| 246 plugin_refresh_allowed_(true), | 247 plugin_refresh_allowed_(true), |
| 247 default_task_runner_(renderer_scheduler->DefaultTaskRunner()), | 248 default_task_runner_(renderer_scheduler->DefaultTaskRunner()), |
| 248 loading_task_runner_(renderer_scheduler->LoadingTaskRunner()), | 249 loading_task_runner_(renderer_scheduler->LoadingTaskRunner()), |
| 249 web_scrollbar_behavior_(new WebScrollbarBehaviorImpl), | 250 web_scrollbar_behavior_(new WebScrollbarBehaviorImpl), |
| 251 web_font_access_(new WebFontAccessImpl), |
| 250 renderer_scheduler_(renderer_scheduler) { | 252 renderer_scheduler_(renderer_scheduler) { |
| 251 #if !defined(OS_ANDROID) && !defined(OS_WIN) | 253 #if !defined(OS_ANDROID) && !defined(OS_WIN) |
| 252 if (g_sandbox_enabled && sandboxEnabled()) { | 254 if (g_sandbox_enabled && sandboxEnabled()) { |
| 253 sandbox_support_.reset(new RendererBlinkPlatformImpl::SandboxSupport); | 255 sandbox_support_.reset(new RendererBlinkPlatformImpl::SandboxSupport); |
| 254 } else { | 256 } else { |
| 255 DVLOG(1) << "Disabling sandbox support for testing."; | 257 DVLOG(1) << "Disabling sandbox support for testing."; |
| 256 } | 258 } |
| 257 #endif | 259 #endif |
| 258 | 260 |
| 259 // ChildThread may not exist in some tests. | 261 // ChildThread may not exist in some tests. |
| (...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 678 | 680 |
| 679 unsigned RendererBlinkPlatformImpl::audioHardwareOutputChannels() { | 681 unsigned RendererBlinkPlatformImpl::audioHardwareOutputChannels() { |
| 680 RenderThreadImpl* thread = RenderThreadImpl::current(); | 682 RenderThreadImpl* thread = RenderThreadImpl::current(); |
| 681 return thread->GetAudioHardwareConfig()->GetOutputChannels(); | 683 return thread->GetAudioHardwareConfig()->GetOutputChannels(); |
| 682 } | 684 } |
| 683 | 685 |
| 684 WebDatabaseObserver* RendererBlinkPlatformImpl::databaseObserver() { | 686 WebDatabaseObserver* RendererBlinkPlatformImpl::databaseObserver() { |
| 685 return web_database_observer_impl_.get(); | 687 return web_database_observer_impl_.get(); |
| 686 } | 688 } |
| 687 | 689 |
| 690 blink::WebFontAccess* RendererBlinkPlatformImpl::fontAccess() { |
| 691 return web_font_access_.get(); |
| 692 } |
| 693 |
| 688 WebAudioDevice* RendererBlinkPlatformImpl::createAudioDevice( | 694 WebAudioDevice* RendererBlinkPlatformImpl::createAudioDevice( |
| 689 size_t buffer_size, | 695 size_t buffer_size, |
| 690 unsigned input_channels, | 696 unsigned input_channels, |
| 691 unsigned channels, | 697 unsigned channels, |
| 692 double sample_rate, | 698 double sample_rate, |
| 693 WebAudioDevice::RenderCallback* callback, | 699 WebAudioDevice::RenderCallback* callback, |
| 694 const blink::WebString& input_device_id) { | 700 const blink::WebString& input_device_id) { |
| 695 // Use a mock for testing. | 701 // Use a mock for testing. |
| 696 blink::WebAudioDevice* mock_device = | 702 blink::WebAudioDevice* mock_device = |
| 697 GetContentClient()->renderer()->OverrideCreateAudioDevice(sample_rate); | 703 GetContentClient()->renderer()->OverrideCreateAudioDevice(sample_rate); |
| (...skipping 590 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1288 //------------------------------------------------------------------------------ | 1294 //------------------------------------------------------------------------------ |
| 1289 | 1295 |
| 1290 void RendererBlinkPlatformImpl::MockBatteryStatusChangedForTesting( | 1296 void RendererBlinkPlatformImpl::MockBatteryStatusChangedForTesting( |
| 1291 const blink::WebBatteryStatus& status) { | 1297 const blink::WebBatteryStatus& status) { |
| 1292 if (!g_test_battery_status_listener) | 1298 if (!g_test_battery_status_listener) |
| 1293 return; | 1299 return; |
| 1294 g_test_battery_status_listener->updateBatteryStatus(status); | 1300 g_test_battery_status_listener->updateBatteryStatus(status); |
| 1295 } | 1301 } |
| 1296 | 1302 |
| 1297 } // namespace content | 1303 } // namespace content |
| OLD | NEW |