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

Side by Side Diff: content/browser/frame_host/render_frame_host_impl.cc

Issue 2698083007: Port device_generic_sensor to be hosted in Device Service. (Closed)
Patch Set: code rebase Created 3 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/browser/frame_host/render_frame_host_impl.h" 5 #include "content/browser/frame_host/render_frame_host_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 #include "content/public/common/content_constants.h" 88 #include "content/public/common/content_constants.h"
89 #include "content/public/common/content_features.h" 89 #include "content/public/common/content_features.h"
90 #include "content/public/common/content_switches.h" 90 #include "content/public/common/content_switches.h"
91 #include "content/public/common/file_chooser_file_info.h" 91 #include "content/public/common/file_chooser_file_info.h"
92 #include "content/public/common/file_chooser_params.h" 92 #include "content/public/common/file_chooser_params.h"
93 #include "content/public/common/isolated_world_ids.h" 93 #include "content/public/common/isolated_world_ids.h"
94 #include "content/public/common/service_manager_connection.h" 94 #include "content/public/common/service_manager_connection.h"
95 #include "content/public/common/service_names.mojom.h" 95 #include "content/public/common/service_names.mojom.h"
96 #include "content/public/common/url_constants.h" 96 #include "content/public/common/url_constants.h"
97 #include "content/public/common/url_utils.h" 97 #include "content/public/common/url_utils.h"
98 #include "device/generic_sensor/sensor_provider_impl.h"
99 #include "device/geolocation/geolocation_service_context.h" 98 #include "device/geolocation/geolocation_service_context.h"
100 #include "device/vr/features.h" 99 #include "device/vr/features.h"
101 #include "device/wake_lock/public/interfaces/wake_lock_context.mojom.h" 100 #include "device/wake_lock/public/interfaces/wake_lock_context.mojom.h"
102 #include "device/wake_lock/public/interfaces/wake_lock_service.mojom.h" 101 #include "device/wake_lock/public/interfaces/wake_lock_service.mojom.h"
103 #include "media/base/media_switches.h" 102 #include "media/base/media_switches.h"
104 #include "media/media_features.h" 103 #include "media/media_features.h"
105 #include "media/mojo/interfaces/media_service.mojom.h" 104 #include "media/mojo/interfaces/media_service.mojom.h"
106 #include "media/mojo/interfaces/remoting.mojom.h" 105 #include "media/mojo/interfaces/remoting.mojom.h"
107 #include "mojo/public/cpp/bindings/associated_interface_ptr.h" 106 #include "mojo/public/cpp/bindings/associated_interface_ptr.h"
108 #include "mojo/public/cpp/bindings/strong_binding.h" 107 #include "mojo/public/cpp/bindings/strong_binding.h"
(...skipping 2377 matching lines...) Expand 10 before | Expand all | Expand 10 after
2486 routing_id_)); 2485 routing_id_));
2487 2486
2488 #if BUILDFLAG(ENABLE_VR) 2487 #if BUILDFLAG(ENABLE_VR)
2489 GetInterfaceRegistry()->AddInterface<device::mojom::VRService>( 2488 GetInterfaceRegistry()->AddInterface<device::mojom::VRService>(
2490 base::Bind(&device::VRServiceImpl::Create)); 2489 base::Bind(&device::VRServiceImpl::Create));
2491 #else 2490 #else
2492 GetInterfaceRegistry()->AddInterface<device::mojom::VRService>( 2491 GetInterfaceRegistry()->AddInterface<device::mojom::VRService>(
2493 base::Bind(&IgnoreInterfaceRequest<device::mojom::VRService>)); 2492 base::Bind(&IgnoreInterfaceRequest<device::mojom::VRService>));
2494 #endif 2493 #endif
2495 2494
2496 if (base::FeatureList::IsEnabled(features::kGenericSensor)) {
2497 GetInterfaceRegistry()->AddInterface(
2498 base::Bind(&device::SensorProviderImpl::Create,
2499 BrowserThread::GetTaskRunnerForThread(BrowserThread::FILE)),
2500 BrowserThread::GetTaskRunnerForThread(BrowserThread::IO));
2501 }
2502
2503 #if BUILDFLAG(ENABLE_WEBRTC) 2495 #if BUILDFLAG(ENABLE_WEBRTC)
2504 // BrowserMainLoop::GetInstance() may be null on unit tests. 2496 // BrowserMainLoop::GetInstance() may be null on unit tests.
2505 if (BrowserMainLoop::GetInstance()) { 2497 if (BrowserMainLoop::GetInstance()) {
2506 // BrowserMainLoop, which owns MediaStreamManager, is alive for the lifetime 2498 // BrowserMainLoop, which owns MediaStreamManager, is alive for the lifetime
2507 // of Mojo communication (see BrowserMainLoop::ShutdownThreadsAndCleanUp(), 2499 // of Mojo communication (see BrowserMainLoop::ShutdownThreadsAndCleanUp(),
2508 // which shuts down Mojo). Hence, passing that MediaStreamManager instance 2500 // which shuts down Mojo). Hence, passing that MediaStreamManager instance
2509 // as a raw pointer here is safe. 2501 // as a raw pointer here is safe.
2510 MediaStreamManager* media_stream_manager = 2502 MediaStreamManager* media_stream_manager =
2511 BrowserMainLoop::GetInstance()->media_stream_manager(); 2503 BrowserMainLoop::GetInstance()->media_stream_manager();
2512 GetInterfaceRegistry()->AddInterface( 2504 GetInterfaceRegistry()->AddInterface(
(...skipping 1115 matching lines...) Expand 10 before | Expand all | Expand 10 after
3628 service_manager::mojom::InterfaceProviderPtr provider; 3620 service_manager::mojom::InterfaceProviderPtr provider;
3629 BindInterfaceRegistryForRenderFrameHost(mojo::MakeRequest(&provider), this); 3621 BindInterfaceRegistryForRenderFrameHost(mojo::MakeRequest(&provider), this);
3630 java_interfaces_.reset(new service_manager::InterfaceProvider); 3622 java_interfaces_.reset(new service_manager::InterfaceProvider);
3631 java_interfaces_->Bind(std::move(provider)); 3623 java_interfaces_->Bind(std::move(provider));
3632 } 3624 }
3633 return java_interfaces_.get(); 3625 return java_interfaces_.get();
3634 } 3626 }
3635 #endif 3627 #endif
3636 3628
3637 } // namespace content 3629 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698