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

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

Issue 2896583005: Reland: Refactor DeviceMotionEventPump to use //device/generic_sensor instead of //device/sensors (Closed)
Patch Set: updated test code Created 3 years, 7 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 <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
165 using blink::WebSize; 165 using blink::WebSize;
166 using blink::WebString; 166 using blink::WebString;
167 using blink::WebURL; 167 using blink::WebURL;
168 using blink::WebVector; 168 using blink::WebVector;
169 169
170 namespace content { 170 namespace content {
171 171
172 namespace { 172 namespace {
173 173
174 bool g_sandbox_enabled = true; 174 bool g_sandbox_enabled = true;
175 base::LazyInstance<device::MotionData>::Leaky g_test_device_motion_data = 175 base::LazyInstance<blink::WebDeviceMotionData>::Leaky
176 LAZY_INSTANCE_INITIALIZER; 176 g_test_device_motion_data = LAZY_INSTANCE_INITIALIZER;
177 base::LazyInstance<device::OrientationData>::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
(...skipping 928 matching lines...) Expand 10 before | Expand all | Expand 10 after
1115 1115
1116 void RendererBlinkPlatformImpl::RecordRapporURL(const char* metric, 1116 void RendererBlinkPlatformImpl::RecordRapporURL(const char* metric,
1117 const blink::WebURL& url) { 1117 const blink::WebURL& url) {
1118 GetContentClient()->renderer()->RecordRapporURL(metric, url); 1118 GetContentClient()->renderer()->RecordRapporURL(metric, url);
1119 } 1119 }
1120 1120
1121 //------------------------------------------------------------------------------ 1121 //------------------------------------------------------------------------------
1122 1122
1123 // static 1123 // static
1124 void RendererBlinkPlatformImpl::SetMockDeviceMotionDataForTesting( 1124 void RendererBlinkPlatformImpl::SetMockDeviceMotionDataForTesting(
1125 const device::MotionData& data) { 1125 const blink::WebDeviceMotionData& data) {
1126 g_test_device_motion_data.Get() = data; 1126 g_test_device_motion_data.Get() = data;
1127 } 1127 }
1128 1128
1129 //------------------------------------------------------------------------------ 1129 //------------------------------------------------------------------------------
1130 1130
1131 // static 1131 // static
1132 void RendererBlinkPlatformImpl::SetMockDeviceOrientationDataForTesting( 1132 void RendererBlinkPlatformImpl::SetMockDeviceOrientationDataForTesting(
1133 const device::OrientationData& data) { 1133 const device::OrientationData& data) {
1134 g_test_device_orientation_data.Get() = data; 1134 g_test_device_orientation_data.Get() = data;
1135 } 1135 }
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
1281 //------------------------------------------------------------------------------ 1281 //------------------------------------------------------------------------------
1282 void RendererBlinkPlatformImpl::RequestPurgeMemory() { 1282 void RendererBlinkPlatformImpl::RequestPurgeMemory() {
1283 // TODO(tasak|bashi): We should use ChildMemoryCoordinator here, but 1283 // TODO(tasak|bashi): We should use ChildMemoryCoordinator here, but
1284 // ChildMemoryCoordinator isn't always available as it's only initialized 1284 // ChildMemoryCoordinator isn't always available as it's only initialized
1285 // when kMemoryCoordinatorV0 is enabled. 1285 // when kMemoryCoordinatorV0 is enabled.
1286 // Use ChildMemoryCoordinator when memory coordinator is always enabled. 1286 // Use ChildMemoryCoordinator when memory coordinator is always enabled.
1287 base::MemoryCoordinatorClientRegistry::GetInstance()->PurgeMemory(); 1287 base::MemoryCoordinatorClientRegistry::GetInstance()->PurgeMemory();
1288 } 1288 }
1289 1289
1290 } // namespace content 1290 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698