| 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 <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 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 using blink::WebString; | 165 using blink::WebString; |
| 166 using blink::WebURL; | 166 using blink::WebURL; |
| 167 using blink::WebVector; | 167 using blink::WebVector; |
| 168 | 168 |
| 169 namespace content { | 169 namespace content { |
| 170 | 170 |
| 171 namespace { | 171 namespace { |
| 172 | 172 |
| 173 bool g_sandbox_enabled = true; | 173 bool g_sandbox_enabled = true; |
| 174 double g_test_device_light_data = -1; | 174 double g_test_device_light_data = -1; |
| 175 base::LazyInstance<blink::WebDeviceMotionData>::Leaky | 175 base::LazyInstance<device::MotionData>::Leaky g_test_device_motion_data = |
| 176 g_test_device_motion_data = LAZY_INSTANCE_INITIALIZER; | 176 LAZY_INSTANCE_INITIALIZER; |
| 177 base::LazyInstance<blink::WebDeviceOrientationData>::Leaky | 177 base::LazyInstance<device::OrientationData>::Leaky |
| 178 g_test_device_orientation_data = LAZY_INSTANCE_INITIALIZER; | 178 g_test_device_orientation_data = LAZY_INSTANCE_INITIALIZER; |
| 179 | 179 |
| 180 media::AudioParameters GetAudioHardwareParams() { | 180 media::AudioParameters GetAudioHardwareParams() { |
| 181 blink::WebLocalFrame* const web_frame = | 181 blink::WebLocalFrame* const web_frame = |
| 182 blink::WebLocalFrame::frameForCurrentContext(); | 182 blink::WebLocalFrame::frameForCurrentContext(); |
| 183 RenderFrame* const render_frame = RenderFrame::FromWebFrame(web_frame); | 183 RenderFrame* const render_frame = RenderFrame::FromWebFrame(web_frame); |
| 184 if (!render_frame) | 184 if (!render_frame) |
| 185 return media::AudioParameters::UnavailableDeviceParams(); | 185 return media::AudioParameters::UnavailableDeviceParams(); |
| 186 | 186 |
| 187 return AudioDeviceFactory::GetOutputDeviceInfo(render_frame->GetRoutingID(), | 187 return AudioDeviceFactory::GetOutputDeviceInfo(render_frame->GetRoutingID(), |
| (...skipping 899 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1087 | 1087 |
| 1088 // static | 1088 // static |
| 1089 void RendererBlinkPlatformImpl::SetMockDeviceLightDataForTesting(double data) { | 1089 void RendererBlinkPlatformImpl::SetMockDeviceLightDataForTesting(double data) { |
| 1090 g_test_device_light_data = data; | 1090 g_test_device_light_data = data; |
| 1091 } | 1091 } |
| 1092 | 1092 |
| 1093 //------------------------------------------------------------------------------ | 1093 //------------------------------------------------------------------------------ |
| 1094 | 1094 |
| 1095 // static | 1095 // static |
| 1096 void RendererBlinkPlatformImpl::SetMockDeviceMotionDataForTesting( | 1096 void RendererBlinkPlatformImpl::SetMockDeviceMotionDataForTesting( |
| 1097 const blink::WebDeviceMotionData& data) { | 1097 const device::MotionData& data) { |
| 1098 g_test_device_motion_data.Get() = data; | 1098 g_test_device_motion_data.Get() = data; |
| 1099 } | 1099 } |
| 1100 | 1100 |
| 1101 //------------------------------------------------------------------------------ | 1101 //------------------------------------------------------------------------------ |
| 1102 | 1102 |
| 1103 // static | 1103 // static |
| 1104 void RendererBlinkPlatformImpl::SetMockDeviceOrientationDataForTesting( | 1104 void RendererBlinkPlatformImpl::SetMockDeviceOrientationDataForTesting( |
| 1105 const blink::WebDeviceOrientationData& data) { | 1105 const device::OrientationData& data) { |
| 1106 g_test_device_orientation_data.Get() = data; | 1106 g_test_device_orientation_data.Get() = data; |
| 1107 } | 1107 } |
| 1108 | 1108 |
| 1109 //------------------------------------------------------------------------------ | 1109 //------------------------------------------------------------------------------ |
| 1110 | 1110 |
| 1111 // static | 1111 // static |
| 1112 std::unique_ptr<PlatformEventObserverBase> | 1112 std::unique_ptr<PlatformEventObserverBase> |
| 1113 RendererBlinkPlatformImpl::CreatePlatformEventObserverFromType( | 1113 RendererBlinkPlatformImpl::CreatePlatformEventObserverFromType( |
| 1114 blink::WebPlatformEventType type) { | 1114 blink::WebPlatformEventType type) { |
| 1115 RenderThread* thread = RenderThreadImpl::current(); | 1115 RenderThread* thread = RenderThreadImpl::current(); |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1256 //------------------------------------------------------------------------------ | 1256 //------------------------------------------------------------------------------ |
| 1257 void RendererBlinkPlatformImpl::requestPurgeMemory() { | 1257 void RendererBlinkPlatformImpl::requestPurgeMemory() { |
| 1258 // TODO(tasak|bashi): We should use ChildMemoryCoordinator here, but | 1258 // TODO(tasak|bashi): We should use ChildMemoryCoordinator here, but |
| 1259 // ChildMemoryCoordinator isn't always available as it's only initialized | 1259 // ChildMemoryCoordinator isn't always available as it's only initialized |
| 1260 // when kMemoryCoordinatorV0 is enabled. | 1260 // when kMemoryCoordinatorV0 is enabled. |
| 1261 // Use ChildMemoryCoordinator when memory coordinator is always enabled. | 1261 // Use ChildMemoryCoordinator when memory coordinator is always enabled. |
| 1262 base::MemoryCoordinatorClientRegistry::GetInstance()->PurgeMemory(); | 1262 base::MemoryCoordinatorClientRegistry::GetInstance()->PurgeMemory(); |
| 1263 } | 1263 } |
| 1264 | 1264 |
| 1265 } // namespace content | 1265 } // namespace content |
| OLD | NEW |