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

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

Issue 829803003: Adding Chrome-side WebVR interface (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Don't install message filter unless enable flag is present. Created 5 years, 8 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
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 "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/files/file_path.h" 8 #include "base/files/file_path.h"
9 #include "base/lazy_instance.h" 9 #include "base/lazy_instance.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 #include "content/renderer/media/audio_decoder.h" 48 #include "content/renderer/media/audio_decoder.h"
49 #include "content/renderer/media/renderer_webaudiodevice_impl.h" 49 #include "content/renderer/media/renderer_webaudiodevice_impl.h"
50 #include "content/renderer/media/renderer_webmidiaccessor_impl.h" 50 #include "content/renderer/media/renderer_webmidiaccessor_impl.h"
51 #include "content/renderer/render_thread_impl.h" 51 #include "content/renderer/render_thread_impl.h"
52 #include "content/renderer/renderer_clipboard_delegate.h" 52 #include "content/renderer/renderer_clipboard_delegate.h"
53 #include "content/renderer/scheduler/renderer_scheduler.h" 53 #include "content/renderer/scheduler/renderer_scheduler.h"
54 #include "content/renderer/scheduler/web_scheduler_impl.h" 54 #include "content/renderer/scheduler/web_scheduler_impl.h"
55 #include "content/renderer/scheduler/webthread_impl_for_scheduler.h" 55 #include "content/renderer/scheduler/webthread_impl_for_scheduler.h"
56 #include "content/renderer/screen_orientation/screen_orientation_observer.h" 56 #include "content/renderer/screen_orientation/screen_orientation_observer.h"
57 #include "content/renderer/service_worker/webserviceworkercachestorage_impl.h" 57 #include "content/renderer/service_worker/webserviceworkercachestorage_impl.h"
58 #include "content/renderer/vr_dispatcher.h"
58 #include "content/renderer/webclipboard_impl.h" 59 #include "content/renderer/webclipboard_impl.h"
59 #include "content/renderer/webgraphicscontext3d_provider_impl.h" 60 #include "content/renderer/webgraphicscontext3d_provider_impl.h"
60 #include "content/renderer/webpublicsuffixlist_impl.h" 61 #include "content/renderer/webpublicsuffixlist_impl.h"
61 #include "gpu/config/gpu_info.h" 62 #include "gpu/config/gpu_info.h"
62 #include "ipc/ipc_sync_message_filter.h" 63 #include "ipc/ipc_sync_message_filter.h"
63 #include "media/audio/audio_output_device.h" 64 #include "media/audio/audio_output_device.h"
64 #include "media/base/audio_hardware_config.h" 65 #include "media/base/audio_hardware_config.h"
65 #include "media/base/key_systems.h" 66 #include "media/base/key_systems.h"
66 #include "media/blink/webcontentdecryptionmodule_impl.h" 67 #include "media/blink/webcontentdecryptionmodule_impl.h"
67 #include "media/filters/stream_parser_factory.h" 68 #include "media/filters/stream_parser_factory.h"
68 #include "net/base/mime_util.h" 69 #include "net/base/mime_util.h"
69 #include "net/base/net_util.h" 70 #include "net/base/net_util.h"
70 #include "storage/common/database/database_identifier.h" 71 #include "storage/common/database/database_identifier.h"
71 #include "storage/common/quota/quota_types.h" 72 #include "storage/common/quota/quota_types.h"
72 #include "third_party/WebKit/public/platform/WebBatteryStatusListener.h" 73 #include "third_party/WebKit/public/platform/WebBatteryStatusListener.h"
73 #include "third_party/WebKit/public/platform/WebBlobRegistry.h" 74 #include "third_party/WebKit/public/platform/WebBlobRegistry.h"
74 #include "third_party/WebKit/public/platform/WebDeviceLightListener.h" 75 #include "third_party/WebKit/public/platform/WebDeviceLightListener.h"
75 #include "third_party/WebKit/public/platform/WebDeviceMotionListener.h" 76 #include "third_party/WebKit/public/platform/WebDeviceMotionListener.h"
76 #include "third_party/WebKit/public/platform/WebDeviceOrientationListener.h" 77 #include "third_party/WebKit/public/platform/WebDeviceOrientationListener.h"
77 #include "third_party/WebKit/public/platform/WebFileInfo.h" 78 #include "third_party/WebKit/public/platform/WebFileInfo.h"
78 #include "third_party/WebKit/public/platform/WebGamepads.h" 79 #include "third_party/WebKit/public/platform/WebGamepads.h"
79 #include "third_party/WebKit/public/platform/WebMediaStreamCenter.h" 80 #include "third_party/WebKit/public/platform/WebMediaStreamCenter.h"
80 #include "third_party/WebKit/public/platform/WebMediaStreamCenterClient.h" 81 #include "third_party/WebKit/public/platform/WebMediaStreamCenterClient.h"
81 #include "third_party/WebKit/public/platform/WebPluginListBuilder.h" 82 #include "third_party/WebKit/public/platform/WebPluginListBuilder.h"
82 #include "third_party/WebKit/public/platform/WebURL.h" 83 #include "third_party/WebKit/public/platform/WebURL.h"
84 #include "third_party/WebKit/public/platform/WebVR.h"
83 #include "third_party/WebKit/public/platform/WebVector.h" 85 #include "third_party/WebKit/public/platform/WebVector.h"
84 #include "ui/gfx/color_profile.h" 86 #include "ui/gfx/color_profile.h"
85 #include "url/gurl.h" 87 #include "url/gurl.h"
86 88
87 #if defined(OS_ANDROID) 89 #if defined(OS_ANDROID)
88 #include "content/renderer/android/synchronous_compositor_factory.h" 90 #include "content/renderer/android/synchronous_compositor_factory.h"
89 #include "content/renderer/media/android/audio_decoder_android.h" 91 #include "content/renderer/media/android/audio_decoder_android.h"
90 #include "gpu/blink/webgraphicscontext3d_in_process_command_buffer_impl.h" 92 #include "gpu/blink/webgraphicscontext3d_in_process_command_buffer_impl.h"
91 #endif 93 #endif
92 94
(...skipping 753 matching lines...) Expand 10 before | Expand all | Expand 10 after
846 void RendererBlinkPlatformImpl::sampleGamepads(WebGamepads& gamepads) { 848 void RendererBlinkPlatformImpl::sampleGamepads(WebGamepads& gamepads) {
847 PlatformEventObserverBase* observer = 849 PlatformEventObserverBase* observer =
848 platform_event_observers_.Lookup(blink::WebPlatformEventGamepad); 850 platform_event_observers_.Lookup(blink::WebPlatformEventGamepad);
849 if (!observer) 851 if (!observer)
850 return; 852 return;
851 static_cast<RendererGamepadProvider*>(observer)->SampleGamepads(gamepads); 853 static_cast<RendererGamepadProvider*>(observer)->SampleGamepads(gamepads);
852 } 854 }
853 855
854 //------------------------------------------------------------------------------ 856 //------------------------------------------------------------------------------
855 857
858 void RendererBlinkPlatformImpl::getVRDevices(
859 blink::WebVector<blink::WebVRDevice>* devices) {
860 RenderThreadImpl* render_thread = RenderThreadImpl::current();
861 DCHECK(render_thread);
862 if (!render_thread)
863 return;
864
865 render_thread->vr_dispatcher()->GetVRDevices(devices);
866 }
867
868 void RendererBlinkPlatformImpl::getHMDSensorState(
869 unsigned index, blink::WebHMDSensorState& into) {
870 RenderThreadImpl* render_thread = RenderThreadImpl::current();
871 DCHECK(render_thread);
872 if (!render_thread)
873 return;
874
875 render_thread->vr_dispatcher()->GetSensorState(index, into);
876 }
877
878 void RendererBlinkPlatformImpl::resetVRSensor(unsigned index) {
879 RenderThreadImpl* render_thread = RenderThreadImpl::current();
880 DCHECK(render_thread);
881 if (!render_thread)
882 return;
883
884 render_thread->vr_dispatcher()->ResetSensor(index);
885 }
886
887 void RendererBlinkPlatformImpl::getVRRenderTargetRects(unsigned index,
888 blink::WebVRFieldOfView leftFov,
889 blink::WebVRFieldOfView rightFov,
890 blink::WebVRVector4* leftRect,
891 blink::WebVRVector4* rightRect) {
892 RenderThreadImpl* render_thread = RenderThreadImpl::current();
893 DCHECK(render_thread);
894 if (!render_thread)
895 return;
896
897 render_thread->vr_dispatcher()->GetRenderTargetRects(
898 index, leftFov, rightFov, leftRect, rightRect);
899 }
900
901 //------------------------------------------------------------------------------
902
856 WebRTCPeerConnectionHandler* 903 WebRTCPeerConnectionHandler*
857 RendererBlinkPlatformImpl::createRTCPeerConnectionHandler( 904 RendererBlinkPlatformImpl::createRTCPeerConnectionHandler(
858 WebRTCPeerConnectionHandlerClient* client) { 905 WebRTCPeerConnectionHandlerClient* client) {
859 RenderThreadImpl* render_thread = RenderThreadImpl::current(); 906 RenderThreadImpl* render_thread = RenderThreadImpl::current();
860 DCHECK(render_thread); 907 DCHECK(render_thread);
861 if (!render_thread) 908 if (!render_thread)
862 return NULL; 909 return NULL;
863 910
864 #if defined(ENABLE_WEBRTC) 911 #if defined(ENABLE_WEBRTC)
865 WebRTCPeerConnectionHandler* peer_connection_handler = 912 WebRTCPeerConnectionHandler* peer_connection_handler =
(...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after
1213 //------------------------------------------------------------------------------ 1260 //------------------------------------------------------------------------------
1214 1261
1215 void RendererBlinkPlatformImpl::MockBatteryStatusChangedForTesting( 1262 void RendererBlinkPlatformImpl::MockBatteryStatusChangedForTesting(
1216 const blink::WebBatteryStatus& status) { 1263 const blink::WebBatteryStatus& status) {
1217 if (!g_test_battery_status_listener) 1264 if (!g_test_battery_status_listener)
1218 return; 1265 return;
1219 g_test_battery_status_listener->updateBatteryStatus(status); 1266 g_test_battery_status_listener->updateBatteryStatus(status);
1220 } 1267 }
1221 1268
1222 } // namespace content 1269 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698