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

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

Issue 2885203004: Refactor content/renderer/device_sensors to use device/generic_sensor instead of device/sensors (Closed)
Patch Set: updated content/renderer/BUILD.gn 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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 #include "content/common/gpu_stream_constants.h" 42 #include "content/common/gpu_stream_constants.h"
43 #include "content/common/render_process_messages.h" 43 #include "content/common/render_process_messages.h"
44 #include "content/public/common/content_switches.h" 44 #include "content/public/common/content_switches.h"
45 #include "content/public/common/service_manager_connection.h" 45 #include "content/public/common/service_manager_connection.h"
46 #include "content/public/common/webplugininfo.h" 46 #include "content/public/common/webplugininfo.h"
47 #include "content/public/renderer/content_renderer_client.h" 47 #include "content/public/renderer/content_renderer_client.h"
48 #include "content/public/renderer/media_stream_utils.h" 48 #include "content/public/renderer/media_stream_utils.h"
49 #include "content/public/renderer/render_frame.h" 49 #include "content/public/renderer/render_frame.h"
50 #include "content/renderer/cache_storage/webserviceworkercachestorage_impl.h" 50 #include "content/renderer/cache_storage/webserviceworkercachestorage_impl.h"
51 #include "content/renderer/device_sensors/device_motion_event_pump.h" 51 #include "content/renderer/device_sensors/device_motion_event_pump.h"
52 #include "content/renderer/device_sensors/device_orientation_absolute_event_pump .h"
52 #include "content/renderer/device_sensors/device_orientation_event_pump.h" 53 #include "content/renderer/device_sensors/device_orientation_event_pump.h"
53 #include "content/renderer/dom_storage/local_storage_cached_areas.h" 54 #include "content/renderer/dom_storage/local_storage_cached_areas.h"
54 #include "content/renderer/dom_storage/local_storage_namespace.h" 55 #include "content/renderer/dom_storage/local_storage_namespace.h"
55 #include "content/renderer/dom_storage/webstoragenamespace_impl.h" 56 #include "content/renderer/dom_storage/webstoragenamespace_impl.h"
56 #include "content/renderer/gamepad_shared_memory_reader.h" 57 #include "content/renderer/gamepad_shared_memory_reader.h"
57 #include "content/renderer/image_capture/image_capture_frame_grabber.h" 58 #include "content/renderer/image_capture/image_capture_frame_grabber.h"
58 #include "content/renderer/media/audio_decoder.h" 59 #include "content/renderer/media/audio_decoder.h"
59 #include "content/renderer/media/audio_device_factory.h" 60 #include "content/renderer/media/audio_device_factory.h"
60 #include "content/renderer/media/renderer_webaudiodevice_impl.h" 61 #include "content/renderer/media/renderer_webaudiodevice_impl.h"
61 #include "content/renderer/media/renderer_webmidiaccessor_impl.h" 62 #include "content/renderer/media/renderer_webmidiaccessor_impl.h"
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 using blink::WebSize; 166 using blink::WebSize;
166 using blink::WebString; 167 using blink::WebString;
167 using blink::WebURL; 168 using blink::WebURL;
168 using blink::WebVector; 169 using blink::WebVector;
169 170
170 namespace content { 171 namespace content {
171 172
172 namespace { 173 namespace {
173 174
174 bool g_sandbox_enabled = true; 175 bool g_sandbox_enabled = true;
175 base::LazyInstance<device::MotionData>::Leaky g_test_device_motion_data = 176 base::LazyInstance<blink::WebDeviceMotionData>::Leaky
176 LAZY_INSTANCE_INITIALIZER; 177 g_test_device_motion_data = LAZY_INSTANCE_INITIALIZER;
177 base::LazyInstance<device::OrientationData>::Leaky 178 base::LazyInstance<blink::WebDeviceOrientationData>::Leaky
178 g_test_device_orientation_data = LAZY_INSTANCE_INITIALIZER; 179 g_test_device_orientation_data = LAZY_INSTANCE_INITIALIZER;
179 180
180 media::AudioParameters GetAudioHardwareParams() { 181 media::AudioParameters GetAudioHardwareParams() {
181 blink::WebLocalFrame* const web_frame = 182 blink::WebLocalFrame* const web_frame =
182 blink::WebLocalFrame::FrameForCurrentContext(); 183 blink::WebLocalFrame::FrameForCurrentContext();
183 RenderFrame* const render_frame = RenderFrame::FromWebFrame(web_frame); 184 RenderFrame* const render_frame = RenderFrame::FromWebFrame(web_frame);
184 if (!render_frame) 185 if (!render_frame)
185 return media::AudioParameters::UnavailableDeviceParams(); 186 return media::AudioParameters::UnavailableDeviceParams();
186 187
187 return AudioDeviceFactory::GetOutputDeviceInfo(render_frame->GetRoutingID(), 188 return AudioDeviceFactory::GetOutputDeviceInfo(render_frame->GetRoutingID(),
(...skipping 927 matching lines...) Expand 10 before | Expand all | Expand 10 after
1115 1116
1116 void RendererBlinkPlatformImpl::RecordRapporURL(const char* metric, 1117 void RendererBlinkPlatformImpl::RecordRapporURL(const char* metric,
1117 const blink::WebURL& url) { 1118 const blink::WebURL& url) {
1118 GetContentClient()->renderer()->RecordRapporURL(metric, url); 1119 GetContentClient()->renderer()->RecordRapporURL(metric, url);
1119 } 1120 }
1120 1121
1121 //------------------------------------------------------------------------------ 1122 //------------------------------------------------------------------------------
1122 1123
1123 // static 1124 // static
1124 void RendererBlinkPlatformImpl::SetMockDeviceMotionDataForTesting( 1125 void RendererBlinkPlatformImpl::SetMockDeviceMotionDataForTesting(
1125 const device::MotionData& data) { 1126 const blink::WebDeviceMotionData& data) {
1126 g_test_device_motion_data.Get() = data; 1127 g_test_device_motion_data.Get() = data;
1127 } 1128 }
1128 1129
1129 //------------------------------------------------------------------------------ 1130 //------------------------------------------------------------------------------
1130 1131
1131 // static 1132 // static
1132 void RendererBlinkPlatformImpl::SetMockDeviceOrientationDataForTesting( 1133 void RendererBlinkPlatformImpl::SetMockDeviceOrientationDataForTesting(
1133 const device::OrientationData& data) { 1134 const blink::WebDeviceOrientationData& data) {
1134 g_test_device_orientation_data.Get() = data; 1135 g_test_device_orientation_data.Get() = data;
1135 } 1136 }
1136 1137
1137 //------------------------------------------------------------------------------ 1138 //------------------------------------------------------------------------------
1138 1139
1139 // static 1140 // static
1140 std::unique_ptr<PlatformEventObserverBase> 1141 std::unique_ptr<PlatformEventObserverBase>
1141 RendererBlinkPlatformImpl::CreatePlatformEventObserverFromType( 1142 RendererBlinkPlatformImpl::CreatePlatformEventObserverFromType(
1142 blink::WebPlatformEventType type) { 1143 blink::WebPlatformEventType type) {
1143 RenderThread* thread = RenderThreadImpl::current(); 1144 RenderThread* thread = RenderThreadImpl::current();
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
1281 //------------------------------------------------------------------------------ 1282 //------------------------------------------------------------------------------
1282 void RendererBlinkPlatformImpl::RequestPurgeMemory() { 1283 void RendererBlinkPlatformImpl::RequestPurgeMemory() {
1283 // TODO(tasak|bashi): We should use ChildMemoryCoordinator here, but 1284 // TODO(tasak|bashi): We should use ChildMemoryCoordinator here, but
1284 // ChildMemoryCoordinator isn't always available as it's only initialized 1285 // ChildMemoryCoordinator isn't always available as it's only initialized
1285 // when kMemoryCoordinatorV0 is enabled. 1286 // when kMemoryCoordinatorV0 is enabled.
1286 // Use ChildMemoryCoordinator when memory coordinator is always enabled. 1287 // Use ChildMemoryCoordinator when memory coordinator is always enabled.
1287 base::MemoryCoordinatorClientRegistry::GetInstance()->PurgeMemory(); 1288 base::MemoryCoordinatorClientRegistry::GetInstance()->PurgeMemory();
1288 } 1289 }
1289 1290
1290 } // namespace content 1291 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698