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

Unified Diff: third_party/WebKit/Source/modules/vr/NavigatorVR.cpp

Issue 2562323002: Devirtualize Frame::domWindow(). (Closed)
Patch Set: Created 4 years 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/modules/vr/NavigatorVR.cpp
diff --git a/third_party/WebKit/Source/modules/vr/NavigatorVR.cpp b/third_party/WebKit/Source/modules/vr/NavigatorVR.cpp
index 68a6c6b14e998fb4675a7cdbb3c4d9fc3735c9c4..a076fa5a003582cec64e1ae6b5230c459e563d32 100644
--- a/third_party/WebKit/Source/modules/vr/NavigatorVR.cpp
+++ b/third_party/WebKit/Source/modules/vr/NavigatorVR.cpp
@@ -97,7 +97,7 @@ DEFINE_TRACE(NavigatorVR) {
NavigatorVR::NavigatorVR(LocalFrame* frame)
: DOMWindowProperty(frame), PageVisibilityObserver(frame->page()) {
- frame->localDOMWindow()->registerEventListenerObserver(this);
+ frame->domWindow()->registerEventListenerObserver(this);
}
NavigatorVR::~NavigatorVR() {}
@@ -107,17 +107,19 @@ const char* NavigatorVR::supplementName() {
}
void NavigatorVR::enqueueVREvent(VRDisplayEvent* event) {
- if (frame() && frame()->localDOMWindow()) {
- frame()->localDOMWindow()->enqueueWindowEvent(event);
+ // TODO(dcheng): Why does this need to check both frame and domWindow?
+ if (frame() && frame()->domWindow()) {
+ frame()->domWindow()->enqueueWindowEvent(event);
}
}
void NavigatorVR::dispatchVRGestureEvent(VRDisplayEvent* event) {
- if (frame() && frame()->localDOMWindow()) {
+ // TODO(dcheng): Why does this need to check both frame and domWindow?
+ if (frame() && frame()->domWindow()) {
UserGestureIndicator gestureIndicator(
DocumentUserGestureToken::create(frame()->document()));
- event->setTarget(frame()->localDOMWindow());
- frame()->localDOMWindow()->dispatchEvent(event);
+ event->setTarget(frame()->domWindow());
+ frame()->domWindow()->dispatchEvent(event);
}
}

Powered by Google App Engine
This is Rietveld 408576698