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

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

Issue 2614873002: Ensure navigator.getVRDisplays always resolves. (Closed)
Patch Set: addressing test nits from ddorwin@ 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 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 #include "content/browser/media/android/media_player_renderer.h" 117 #include "content/browser/media/android/media_player_renderer.h"
118 #include "media/base/audio_renderer_sink.h" 118 #include "media/base/audio_renderer_sink.h"
119 #include "media/base/video_renderer_sink.h" 119 #include "media/base/video_renderer_sink.h"
120 #include "media/mojo/services/mojo_renderer_service.h" // nogncheck 120 #include "media/mojo/services/mojo_renderer_service.h" // nogncheck
121 #endif 121 #endif
122 122
123 #if defined(OS_MACOSX) 123 #if defined(OS_MACOSX)
124 #include "content/browser/frame_host/popup_menu_helper_mac.h" 124 #include "content/browser/frame_host/popup_menu_helper_mac.h"
125 #endif 125 #endif
126 126
127 #if defined(ENABLE_WEBVR)
128 #include "device/vr/vr_service_impl.h" // nogncheck 127 #include "device/vr/vr_service_impl.h" // nogncheck
129 #endif
130 128
131 using base::TimeDelta; 129 using base::TimeDelta;
132 130
133 namespace content { 131 namespace content {
134 132
135 namespace { 133 namespace {
136 134
137 // The next value to use for the accessibility reset token. 135 // The next value to use for the accessibility reset token.
138 int g_next_accessibility_reset_token = 1; 136 int g_next_accessibility_reset_token = 1;
139 137
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
231 } 229 }
232 } 230 }
233 231
234 const int process_id_; 232 const int process_id_;
235 const int routing_id_; 233 const int routing_id_;
236 234
237 DISALLOW_COPY_AND_ASSIGN(RemoterFactoryImpl); 235 DISALLOW_COPY_AND_ASSIGN(RemoterFactoryImpl);
238 }; 236 };
239 #endif // BUILDFLAG(ENABLE_MEDIA_REMOTING) 237 #endif // BUILDFLAG(ENABLE_MEDIA_REMOTING)
240 238
239 template <typename Interface>
240 void IgnoreInterfaceRequest(mojo::InterfaceRequest<Interface> request) {
241 // Intentionally ignore the interface request.
242 }
243
241 } // namespace 244 } // namespace
242 245
243 // static 246 // static
244 RenderFrameHost* RenderFrameHost::FromID(int render_process_id, 247 RenderFrameHost* RenderFrameHost::FromID(int render_process_id,
245 int render_frame_id) { 248 int render_frame_id) {
246 return RenderFrameHostImpl::FromID(render_process_id, render_frame_id); 249 return RenderFrameHostImpl::FromID(render_process_id, render_frame_id);
247 } 250 }
248 251
249 #if defined(OS_ANDROID) 252 #if defined(OS_ANDROID)
250 // static 253 // static
(...skipping 2013 matching lines...) Expand 10 before | Expand all | Expand 10 after
2264 // associated RenderFrame. This is important for showing the correct security 2267 // associated RenderFrame. This is important for showing the correct security
2265 // state of the page and also honoring user override of bad certificates. 2268 // state of the page and also honoring user override of bad certificates.
2266 GetInterfaceRegistry()->AddInterface( 2269 GetInterfaceRegistry()->AddInterface(
2267 base::Bind(&WebSocketManager::CreateWebSocket, 2270 base::Bind(&WebSocketManager::CreateWebSocket,
2268 process_->GetID(), 2271 process_->GetID(),
2269 routing_id_)); 2272 routing_id_));
2270 2273
2271 #if defined(ENABLE_WEBVR) 2274 #if defined(ENABLE_WEBVR)
2272 GetInterfaceRegistry()->AddInterface<device::mojom::VRService>( 2275 GetInterfaceRegistry()->AddInterface<device::mojom::VRService>(
2273 base::Bind(&device::VRServiceImpl::Create)); 2276 base::Bind(&device::VRServiceImpl::Create));
2277 #else
2278 GetInterfaceRegistry()->AddInterface<device::mojom::VRService>(
2279 base::Bind(&IgnoreInterfaceRequest<device::mojom::VRService>));
2274 #endif 2280 #endif
2281
2275 if (base::FeatureList::IsEnabled(features::kGenericSensor)) { 2282 if (base::FeatureList::IsEnabled(features::kGenericSensor)) {
2276 GetInterfaceRegistry()->AddInterface( 2283 GetInterfaceRegistry()->AddInterface(
2277 base::Bind(&device::SensorProviderImpl::Create, 2284 base::Bind(&device::SensorProviderImpl::Create,
2278 BrowserThread::GetTaskRunnerForThread(BrowserThread::FILE)), 2285 BrowserThread::GetTaskRunnerForThread(BrowserThread::FILE)),
2279 BrowserThread::GetTaskRunnerForThread(BrowserThread::IO)); 2286 BrowserThread::GetTaskRunnerForThread(BrowserThread::IO));
2280 } 2287 }
2281 2288
2282 #if BUILDFLAG(ENABLE_WEBRTC) 2289 #if BUILDFLAG(ENABLE_WEBRTC)
2283 // BrowserMainLoop::GetInstance() may be null on unit tests. 2290 // BrowserMainLoop::GetInstance() may be null on unit tests.
2284 if (BrowserMainLoop::GetInstance()) { 2291 if (BrowserMainLoop::GetInstance()) {
(...skipping 1062 matching lines...) Expand 10 before | Expand all | Expand 10 after
3347 // There is no pending NavigationEntry in these cases, so pass 0 as the 3354 // There is no pending NavigationEntry in these cases, so pass 0 as the
3348 // pending_nav_entry_id. If the previous handle was a prematurely aborted 3355 // pending_nav_entry_id. If the previous handle was a prematurely aborted
3349 // navigation loaded via LoadDataWithBaseURL, propagate the entry id. 3356 // navigation loaded via LoadDataWithBaseURL, propagate the entry id.
3350 return NavigationHandleImpl::Create( 3357 return NavigationHandleImpl::Create(
3351 params.url, frame_tree_node_, is_renderer_initiated, 3358 params.url, frame_tree_node_, is_renderer_initiated,
3352 params.was_within_same_page, base::TimeTicks::Now(), 3359 params.was_within_same_page, base::TimeTicks::Now(),
3353 entry_id_for_data_nav, false); // started_from_context_menu 3360 entry_id_for_data_nav, false); // started_from_context_menu
3354 } 3361 }
3355 3362
3356 } // namespace content 3363 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698