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

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

Issue 2603553002: Ports VRService to be hosted in the device service.
Patch Set: Ports VRService to be hosted in the device service. Created 3 years, 11 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 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 #include "content/browser/media/android/media_player_renderer.h" 118 #include "content/browser/media/android/media_player_renderer.h"
119 #include "media/base/audio_renderer_sink.h" 119 #include "media/base/audio_renderer_sink.h"
120 #include "media/base/video_renderer_sink.h" 120 #include "media/base/video_renderer_sink.h"
121 #include "media/mojo/services/mojo_renderer_service.h" // nogncheck 121 #include "media/mojo/services/mojo_renderer_service.h" // nogncheck
122 #endif 122 #endif
123 123
124 #if defined(OS_MACOSX) 124 #if defined(OS_MACOSX)
125 #include "content/browser/frame_host/popup_menu_helper_mac.h" 125 #include "content/browser/frame_host/popup_menu_helper_mac.h"
126 #endif 126 #endif
127 127
128 #include "device/vr/vr_service_impl.h" // nogncheck
129
130 using base::TimeDelta; 128 using base::TimeDelta;
131 129
132 namespace content { 130 namespace content {
133 131
134 namespace { 132 namespace {
135 133
136 // The next value to use for the accessibility reset token. 134 // The next value to use for the accessibility reset token.
137 int g_next_accessibility_reset_token = 1; 135 int g_next_accessibility_reset_token = 1;
138 136
139 // The next value to use for the javascript callback id. 137 // The next value to use for the javascript callback id.
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
230 } 228 }
231 } 229 }
232 230
233 const int process_id_; 231 const int process_id_;
234 const int routing_id_; 232 const int routing_id_;
235 233
236 DISALLOW_COPY_AND_ASSIGN(RemoterFactoryImpl); 234 DISALLOW_COPY_AND_ASSIGN(RemoterFactoryImpl);
237 }; 235 };
238 #endif // BUILDFLAG(ENABLE_MEDIA_REMOTING) 236 #endif // BUILDFLAG(ENABLE_MEDIA_REMOTING)
239 237
240 template <typename Interface>
241 void IgnoreInterfaceRequest(mojo::InterfaceRequest<Interface> request) {
242 // Intentionally ignore the interface request.
243 }
244
245 } // namespace 238 } // namespace
246 239
247 // static 240 // static
248 RenderFrameHost* RenderFrameHost::FromID(int render_process_id, 241 RenderFrameHost* RenderFrameHost::FromID(int render_process_id,
249 int render_frame_id) { 242 int render_frame_id) {
250 return RenderFrameHostImpl::FromID(render_process_id, render_frame_id); 243 return RenderFrameHostImpl::FromID(render_process_id, render_frame_id);
251 } 244 }
252 245
253 #if defined(OS_ANDROID) 246 #if defined(OS_ANDROID)
254 // static 247 // static
(...skipping 2047 matching lines...) Expand 10 before | Expand all | Expand 10 after
2302 GetInterfaceRegistry()->AddInterface<media::mojom::InterfaceFactory>(this); 2295 GetInterfaceRegistry()->AddInterface<media::mojom::InterfaceFactory>(this);
2303 2296
2304 // This is to support usage of WebSockets in cases in which there is an 2297 // This is to support usage of WebSockets in cases in which there is an
2305 // associated RenderFrame. This is important for showing the correct security 2298 // associated RenderFrame. This is important for showing the correct security
2306 // state of the page and also honoring user override of bad certificates. 2299 // state of the page and also honoring user override of bad certificates.
2307 GetInterfaceRegistry()->AddInterface( 2300 GetInterfaceRegistry()->AddInterface(
2308 base::Bind(&WebSocketManager::CreateWebSocket, 2301 base::Bind(&WebSocketManager::CreateWebSocket,
2309 process_->GetID(), 2302 process_->GetID(),
2310 routing_id_)); 2303 routing_id_));
2311 2304
2312 #if defined(ENABLE_WEBVR)
2313 GetInterfaceRegistry()->AddInterface<device::mojom::VRService>(
2314 base::Bind(&device::VRServiceImpl::Create));
2315 #else
2316 GetInterfaceRegistry()->AddInterface<device::mojom::VRService>(
2317 base::Bind(&IgnoreInterfaceRequest<device::mojom::VRService>));
2318 #endif
2319
2320 if (base::FeatureList::IsEnabled(features::kGenericSensor)) { 2305 if (base::FeatureList::IsEnabled(features::kGenericSensor)) {
2321 GetInterfaceRegistry()->AddInterface( 2306 GetInterfaceRegistry()->AddInterface(
2322 base::Bind(&device::SensorProviderImpl::Create, 2307 base::Bind(&device::SensorProviderImpl::Create,
2323 BrowserThread::GetTaskRunnerForThread(BrowserThread::FILE)), 2308 BrowserThread::GetTaskRunnerForThread(BrowserThread::FILE)),
2324 BrowserThread::GetTaskRunnerForThread(BrowserThread::IO)); 2309 BrowserThread::GetTaskRunnerForThread(BrowserThread::IO));
2325 } 2310 }
2326 2311
2327 #if BUILDFLAG(ENABLE_WEBRTC) 2312 #if BUILDFLAG(ENABLE_WEBRTC)
2328 // BrowserMainLoop::GetInstance() may be null on unit tests. 2313 // BrowserMainLoop::GetInstance() may be null on unit tests.
2329 if (BrowserMainLoop::GetInstance()) { 2314 if (BrowserMainLoop::GetInstance()) {
(...skipping 1062 matching lines...) Expand 10 before | Expand all | Expand 10 after
3392 // There is no pending NavigationEntry in these cases, so pass 0 as the 3377 // There is no pending NavigationEntry in these cases, so pass 0 as the
3393 // pending_nav_entry_id. If the previous handle was a prematurely aborted 3378 // pending_nav_entry_id. If the previous handle was a prematurely aborted
3394 // navigation loaded via LoadDataWithBaseURL, propagate the entry id. 3379 // navigation loaded via LoadDataWithBaseURL, propagate the entry id.
3395 return NavigationHandleImpl::Create( 3380 return NavigationHandleImpl::Create(
3396 params.url, frame_tree_node_, is_renderer_initiated, 3381 params.url, frame_tree_node_, is_renderer_initiated,
3397 params.was_within_same_page, base::TimeTicks::Now(), 3382 params.was_within_same_page, base::TimeTicks::Now(),
3398 entry_id_for_data_nav, false); // started_from_context_menu 3383 entry_id_for_data_nav, false); // started_from_context_menu
3399 } 3384 }
3400 3385
3401 } // namespace content 3386 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698