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

Side by Side Diff: third_party/WebKit/Source/modules/vr/NavigatorVR.cpp

Issue 2394703003: Add deprecation messages to deprecated parts of the WebVR API. (Closed)
Patch Set: Sync/Rebase Created 4 years, 2 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "modules/vr/NavigatorVR.h" 5 #include "modules/vr/NavigatorVR.h"
6 6
7 #include "bindings/core/v8/ScriptPromiseResolver.h" 7 #include "bindings/core/v8/ScriptPromiseResolver.h"
8 #include "core/dom/DOMException.h" 8 #include "core/dom/DOMException.h"
9 #include "core/dom/Document.h" 9 #include "core/dom/Document.h"
10 #include "core/dom/ExceptionCode.h" 10 #include "core/dom/ExceptionCode.h"
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 Document* document = frame() ? frame()->document() : 0; 50 Document* document = frame() ? frame()->document() : 0;
51 51
52 if (!document || !controller()) { 52 if (!document || !controller()) {
53 DOMException* exception = DOMException::create( 53 DOMException* exception = DOMException::create(
54 InvalidStateError, "The object is no longer associated to a document."); 54 InvalidStateError, "The object is no longer associated to a document.");
55 resolver->reject(exception); 55 resolver->reject(exception);
56 return promise; 56 return promise;
57 } 57 }
58 58
59 UseCounter::count(*document, UseCounter::VRGetDisplays); 59 UseCounter::count(*document, UseCounter::VRGetDisplays);
60 ExecutionContext* executionContext = scriptState->getExecutionContext();
61 String errorMessage;
62 if (!executionContext->isSecureContext(errorMessage))
63 UseCounter::count(*document, UseCounter::VRGetDisplaysInsecureOrigin);
60 64
61 controller()->getDisplays(resolver); 65 controller()->getDisplays(resolver);
62 66
63 return promise; 67 return promise;
64 } 68 }
65 69
66 VRController* NavigatorVR::controller() { 70 VRController* NavigatorVR::controller() {
67 if (!frame()) 71 if (!frame())
68 return 0; 72 return 0;
69 73
(...skipping 30 matching lines...) Expand all
100 } 104 }
101 } 105 }
102 106
103 void NavigatorVR::fireVREvent(VRDisplayEvent* event) { 107 void NavigatorVR::fireVREvent(VRDisplayEvent* event) {
104 if (frame() && frame()->localDOMWindow()) { 108 if (frame() && frame()->localDOMWindow()) {
105 frame()->localDOMWindow()->enqueueWindowEvent(event); 109 frame()->localDOMWindow()->enqueueWindowEvent(event);
106 } 110 }
107 } 111 }
108 112
109 } // namespace blink 113 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/frame/UseCounter.h ('k') | third_party/WebKit/Source/modules/vr/VRDisplay.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698