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

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

Issue 2614873002: Ensure navigator.getVRDisplays always resolves. (Closed)
Patch Set: Addition test nits 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
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/vr/getVRDisplays_always_resolves.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #if defined(ENABLE_WEBVR)
129 #include "device/vr/vr_service_impl.h" // nogncheck 128 #include "device/vr/vr_service_impl.h" // nogncheck
130 #endif
131 129
132 using base::TimeDelta; 130 using base::TimeDelta;
133 131
134 namespace content { 132 namespace content {
135 133
136 namespace { 134 namespace {
137 135
138 // The next value to use for the accessibility reset token. 136 // The next value to use for the accessibility reset token.
139 int g_next_accessibility_reset_token = 1; 137 int g_next_accessibility_reset_token = 1;
140 138
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
232 } 230 }
233 } 231 }
234 232
235 const int process_id_; 233 const int process_id_;
236 const int routing_id_; 234 const int routing_id_;
237 235
238 DISALLOW_COPY_AND_ASSIGN(RemoterFactoryImpl); 236 DISALLOW_COPY_AND_ASSIGN(RemoterFactoryImpl);
239 }; 237 };
240 #endif // BUILDFLAG(ENABLE_MEDIA_REMOTING) 238 #endif // BUILDFLAG(ENABLE_MEDIA_REMOTING)
241 239
240 template <typename Interface>
241 void IgnoreInterfaceRequest(mojo::InterfaceRequest<Interface> request) {
242 // Intentionally ignore the interface request.
243 }
244
242 } // namespace 245 } // namespace
243 246
244 // static 247 // static
245 RenderFrameHost* RenderFrameHost::FromID(int render_process_id, 248 RenderFrameHost* RenderFrameHost::FromID(int render_process_id,
246 int render_frame_id) { 249 int render_frame_id) {
247 return RenderFrameHostImpl::FromID(render_process_id, render_frame_id); 250 return RenderFrameHostImpl::FromID(render_process_id, render_frame_id);
248 } 251 }
249 252
250 #if defined(OS_ANDROID) 253 #if defined(OS_ANDROID)
251 // static 254 // static
(...skipping 2049 matching lines...) Expand 10 before | Expand all | Expand 10 after
2301 // associated RenderFrame. This is important for showing the correct security 2304 // associated RenderFrame. This is important for showing the correct security
2302 // state of the page and also honoring user override of bad certificates. 2305 // state of the page and also honoring user override of bad certificates.
2303 GetInterfaceRegistry()->AddInterface( 2306 GetInterfaceRegistry()->AddInterface(
2304 base::Bind(&WebSocketManager::CreateWebSocket, 2307 base::Bind(&WebSocketManager::CreateWebSocket,
2305 process_->GetID(), 2308 process_->GetID(),
2306 routing_id_)); 2309 routing_id_));
2307 2310
2308 #if defined(ENABLE_WEBVR) 2311 #if defined(ENABLE_WEBVR)
2309 GetInterfaceRegistry()->AddInterface<device::mojom::VRService>( 2312 GetInterfaceRegistry()->AddInterface<device::mojom::VRService>(
2310 base::Bind(&device::VRServiceImpl::Create)); 2313 base::Bind(&device::VRServiceImpl::Create));
2314 #else
2315 GetInterfaceRegistry()->AddInterface<device::mojom::VRService>(
2316 base::Bind(&IgnoreInterfaceRequest<device::mojom::VRService>));
2311 #endif 2317 #endif
2318
2312 if (base::FeatureList::IsEnabled(features::kGenericSensor)) { 2319 if (base::FeatureList::IsEnabled(features::kGenericSensor)) {
2313 GetInterfaceRegistry()->AddInterface( 2320 GetInterfaceRegistry()->AddInterface(
2314 base::Bind(&device::SensorProviderImpl::Create, 2321 base::Bind(&device::SensorProviderImpl::Create,
2315 BrowserThread::GetTaskRunnerForThread(BrowserThread::FILE)), 2322 BrowserThread::GetTaskRunnerForThread(BrowserThread::FILE)),
2316 BrowserThread::GetTaskRunnerForThread(BrowserThread::IO)); 2323 BrowserThread::GetTaskRunnerForThread(BrowserThread::IO));
2317 } 2324 }
2318 2325
2319 #if BUILDFLAG(ENABLE_WEBRTC) 2326 #if BUILDFLAG(ENABLE_WEBRTC)
2320 // BrowserMainLoop::GetInstance() may be null on unit tests. 2327 // BrowserMainLoop::GetInstance() may be null on unit tests.
2321 if (BrowserMainLoop::GetInstance()) { 2328 if (BrowserMainLoop::GetInstance()) {
(...skipping 1062 matching lines...) Expand 10 before | Expand all | Expand 10 after
3384 // There is no pending NavigationEntry in these cases, so pass 0 as the 3391 // There is no pending NavigationEntry in these cases, so pass 0 as the
3385 // pending_nav_entry_id. If the previous handle was a prematurely aborted 3392 // pending_nav_entry_id. If the previous handle was a prematurely aborted
3386 // navigation loaded via LoadDataWithBaseURL, propagate the entry id. 3393 // navigation loaded via LoadDataWithBaseURL, propagate the entry id.
3387 return NavigationHandleImpl::Create( 3394 return NavigationHandleImpl::Create(
3388 params.url, frame_tree_node_, is_renderer_initiated, 3395 params.url, frame_tree_node_, is_renderer_initiated,
3389 params.was_within_same_page, base::TimeTicks::Now(), 3396 params.was_within_same_page, base::TimeTicks::Now(),
3390 entry_id_for_data_nav, false); // started_from_context_menu 3397 entry_id_for_data_nav, false); // started_from_context_menu
3391 } 3398 }
3392 3399
3393 } // namespace content 3400 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/vr/getVRDisplays_always_resolves.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698