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

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

Issue 2635293002: Ensure navigator.getVRDisplays always resolves. (Closed)
Patch Set: 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 <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 #endif 119 #endif
120 120
121 #if defined(OS_MACOSX) 121 #if defined(OS_MACOSX)
122 #include "content/browser/frame_host/popup_menu_helper_mac.h" 122 #include "content/browser/frame_host/popup_menu_helper_mac.h"
123 #endif 123 #endif
124 124
125 #if defined(ENABLE_MOJO_CDM) 125 #if defined(ENABLE_MOJO_CDM)
126 #include "content/public/browser/provision_fetcher_impl.h" 126 #include "content/public/browser/provision_fetcher_impl.h"
127 #endif 127 #endif
128 128
129 #if defined(ENABLE_WEBVR)
130 #include "device/vr/vr_service_impl.h" // nogncheck 129 #include "device/vr/vr_service_impl.h" // nogncheck
131 #endif
132 130
133 using base::TimeDelta; 131 using base::TimeDelta;
134 132
135 namespace content { 133 namespace content {
136 134
137 namespace { 135 namespace {
138 136
139 // The next value to use for the accessibility reset token. 137 // The next value to use for the accessibility reset token.
140 int g_next_accessibility_reset_token = 1; 138 int g_next_accessibility_reset_token = 1;
141 139
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
233 } 231 }
234 } 232 }
235 233
236 const int process_id_; 234 const int process_id_;
237 const int routing_id_; 235 const int routing_id_;
238 236
239 DISALLOW_COPY_AND_ASSIGN(RemoterFactoryImpl); 237 DISALLOW_COPY_AND_ASSIGN(RemoterFactoryImpl);
240 }; 238 };
241 #endif // BUILDFLAG(ENABLE_MEDIA_REMOTING) 239 #endif // BUILDFLAG(ENABLE_MEDIA_REMOTING)
242 240
241 template <typename Interface>
242 void IgnoreInterfaceRequest(mojo::InterfaceRequest<Interface> request) {
243 // Intentionally ignore the interface request.
244 }
245
243 } // namespace 246 } // namespace
244 247
245 // static 248 // static
246 RenderFrameHost* RenderFrameHost::FromID(int render_process_id, 249 RenderFrameHost* RenderFrameHost::FromID(int render_process_id,
247 int render_frame_id) { 250 int render_frame_id) {
248 return RenderFrameHostImpl::FromID(render_process_id, render_frame_id); 251 return RenderFrameHostImpl::FromID(render_process_id, render_frame_id);
249 } 252 }
250 253
251 #if defined(OS_ANDROID) 254 #if defined(OS_ANDROID)
252 // static 255 // static
(...skipping 2014 matching lines...) Expand 10 before | Expand all | Expand 10 after
2267 // associated RenderFrame. This is important for showing the correct security 2270 // associated RenderFrame. This is important for showing the correct security
2268 // state of the page and also honoring user override of bad certificates. 2271 // state of the page and also honoring user override of bad certificates.
2269 GetInterfaceRegistry()->AddInterface( 2272 GetInterfaceRegistry()->AddInterface(
2270 base::Bind(&WebSocketManager::CreateWebSocket, 2273 base::Bind(&WebSocketManager::CreateWebSocket,
2271 process_->GetID(), 2274 process_->GetID(),
2272 routing_id_)); 2275 routing_id_));
2273 2276
2274 #if defined(ENABLE_WEBVR) 2277 #if defined(ENABLE_WEBVR)
2275 GetInterfaceRegistry()->AddInterface<device::mojom::VRService>( 2278 GetInterfaceRegistry()->AddInterface<device::mojom::VRService>(
2276 base::Bind(&device::VRServiceImpl::BindRequest)); 2279 base::Bind(&device::VRServiceImpl::BindRequest));
2280 #else
2281 GetInterfaceRegistry()->AddInterface<device::mojom::VRService>(
2282 base::Bind(&IgnoreInterfaceRequest<device::mojom::VRService>));
2277 #endif 2283 #endif
2284
2278 if (base::FeatureList::IsEnabled(features::kGenericSensor)) { 2285 if (base::FeatureList::IsEnabled(features::kGenericSensor)) {
2279 GetInterfaceRegistry()->AddInterface( 2286 GetInterfaceRegistry()->AddInterface(
2280 base::Bind(&device::SensorProviderImpl::Create, 2287 base::Bind(&device::SensorProviderImpl::Create,
2281 BrowserThread::GetTaskRunnerForThread(BrowserThread::FILE)), 2288 BrowserThread::GetTaskRunnerForThread(BrowserThread::FILE)),
2282 BrowserThread::GetTaskRunnerForThread(BrowserThread::IO)); 2289 BrowserThread::GetTaskRunnerForThread(BrowserThread::IO));
2283 } 2290 }
2284 2291
2285 #if defined(ENABLE_WEBRTC) 2292 #if defined(ENABLE_WEBRTC)
2286 // BrowserMainLoop::GetInstance() may be null on unit tests. 2293 // BrowserMainLoop::GetInstance() may be null on unit tests.
2287 if (BrowserMainLoop::GetInstance()) { 2294 if (BrowserMainLoop::GetInstance()) {
(...skipping 1037 matching lines...) Expand 10 before | Expand all | Expand 10 after
3325 // There is no pending NavigationEntry in these cases, so pass 0 as the 3332 // There is no pending NavigationEntry in these cases, so pass 0 as the
3326 // pending_nav_entry_id. If the previous handle was a prematurely aborted 3333 // pending_nav_entry_id. If the previous handle was a prematurely aborted
3327 // navigation loaded via LoadDataWithBaseURL, propagate the entry id. 3334 // navigation loaded via LoadDataWithBaseURL, propagate the entry id.
3328 return NavigationHandleImpl::Create( 3335 return NavigationHandleImpl::Create(
3329 params.url, frame_tree_node_, is_renderer_initiated, 3336 params.url, frame_tree_node_, is_renderer_initiated,
3330 params.was_within_same_page, params.is_srcdoc, base::TimeTicks::Now(), 3337 params.was_within_same_page, params.is_srcdoc, base::TimeTicks::Now(),
3331 entry_id_for_data_nav, false); // started_from_context_menu 3338 entry_id_for_data_nav, false); // started_from_context_menu
3332 } 3339 }
3333 3340
3334 } // namespace content 3341 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/BUILD.gn ('k') | third_party/WebKit/LayoutTests/vr/getVRDisplays_always_resolves.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698