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

Side by Side Diff: device/vr/vr_display_impl.cc

Issue 2853013004: Re-enable webVR presentation for insecure origins. (Closed)
Patch Set: Created 3 years, 7 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 | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 <utility> 5 #include <utility>
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "device/vr/vr_device.h" 8 #include "device/vr/vr_device.h"
9 #include "device/vr/vr_device_manager.h" 9 #include "device/vr/vr_device_manager.h"
10 #include "device/vr/vr_service_impl.h" 10 #include "device/vr/vr_service_impl.h"
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 client_->OnActivate(reason); 52 client_->OnActivate(reason);
53 } 53 }
54 54
55 void VRDisplayImpl::OnDeactivate(mojom::VRDisplayEventReason reason) { 55 void VRDisplayImpl::OnDeactivate(mojom::VRDisplayEventReason reason) {
56 client_->OnDeactivate(reason); 56 client_->OnDeactivate(reason);
57 } 57 }
58 58
59 void VRDisplayImpl::RequestPresent(bool secure_origin, 59 void VRDisplayImpl::RequestPresent(bool secure_origin,
60 mojom::VRSubmitFrameClientPtr submit_client, 60 mojom::VRSubmitFrameClientPtr submit_client,
61 const RequestPresentCallback& callback) { 61 const RequestPresentCallback& callback) {
62 // TODO(mthiesse): Re-enable insecure origin support once webVR content 62 if (!device_->IsAccessAllowed(this)) {
63 // warnings are fixed. crbug.com/704937
64 if (!device_->IsAccessAllowed(this) || !secure_origin) {
65 callback.Run(false); 63 callback.Run(false);
66 return; 64 return;
67 } 65 }
68 66
69 device_->RequestPresent( 67 device_->RequestPresent(
70 std::move(submit_client), 68 std::move(submit_client),
71 base::Bind(&VRDisplayImpl::RequestPresentResult, 69 base::Bind(&VRDisplayImpl::RequestPresentResult,
72 weak_ptr_factory_.GetWeakPtr(), callback, secure_origin)); 70 weak_ptr_factory_.GetWeakPtr(), callback, secure_origin));
73 } 71 }
74 72
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 source_height); 105 source_height);
108 } 106 }
109 107
110 void VRDisplayImpl::GetVRVSyncProvider(mojom::VRVSyncProviderRequest request) { 108 void VRDisplayImpl::GetVRVSyncProvider(mojom::VRVSyncProviderRequest request) {
111 if (!device_->IsAccessAllowed(this)) { 109 if (!device_->IsAccessAllowed(this)) {
112 return; 110 return;
113 } 111 }
114 device_->GetVRVSyncProvider(std::move(request)); 112 device_->GetVRVSyncProvider(std::move(request));
115 } 113 }
116 } 114 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698