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

Unified Diff: Source/core/page/PointerLockController.cpp

Issue 23819007: Have Node::document() return a reference instead of a pointer (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase on master Created 7 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/page/Page.cpp ('k') | Source/core/page/PrintContext.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/page/PointerLockController.cpp
diff --git a/Source/core/page/PointerLockController.cpp b/Source/core/page/PointerLockController.cpp
index 6347dda43f4fa6f1afe51394d89246f4a64d2441..015c7ff9904b5a20830cf213c7a34185a399b1ec 100644
--- a/Source/core/page/PointerLockController.cpp
+++ b/Source/core/page/PointerLockController.cpp
@@ -51,15 +51,15 @@ void PointerLockController::requestPointerLock(Element* target)
return;
}
- if (target->document()->isSandboxed(SandboxPointerLock)) {
+ if (target->document().isSandboxed(SandboxPointerLock)) {
// FIXME: This message should be moved off the console once a solution to https://bugs.webkit.org/show_bug.cgi?id=103274 exists.
- target->document()->addConsoleMessage(SecurityMessageSource, ErrorMessageLevel, "Blocked pointer lock on an element because the element's frame is sandboxed and the 'allow-pointer-lock' permission is not set.");
+ target->document().addConsoleMessage(SecurityMessageSource, ErrorMessageLevel, "Blocked pointer lock on an element because the element's frame is sandboxed and the 'allow-pointer-lock' permission is not set.");
enqueueEvent(eventNames().webkitpointerlockerrorEvent, target);
return;
}
if (m_element) {
- if (m_element->document() != target->document()) {
+ if (&m_element->document() != &target->document()) {
enqueueEvent(eventNames().webkitpointerlockerrorEvent, target);
return;
}
@@ -81,7 +81,7 @@ void PointerLockController::requestPointerUnlock()
void PointerLockController::elementRemoved(Element* element)
{
if (m_element == element) {
- m_documentOfRemovedElementWhileWaitingForUnlock = m_element->document();
+ m_documentOfRemovedElementWhileWaitingForUnlock = &m_element->document();
// Set element null immediately to block any future interaction with it
// including mouse events received before the unlock completes.
clearElement();
@@ -91,7 +91,7 @@ void PointerLockController::elementRemoved(Element* element)
void PointerLockController::documentDetached(Document* document)
{
- if (m_element && m_element->document() == document) {
+ if (m_element && &m_element->document() == document) {
clearElement();
requestPointerUnlock();
}
@@ -121,14 +121,14 @@ void PointerLockController::didNotAcquirePointerLock()
void PointerLockController::didLosePointerLock()
{
- enqueueEvent(eventNames().webkitpointerlockchangeEvent, m_element ? m_element->document() : m_documentOfRemovedElementWhileWaitingForUnlock.get());
+ enqueueEvent(eventNames().webkitpointerlockchangeEvent, m_element ? &m_element->document() : m_documentOfRemovedElementWhileWaitingForUnlock.get());
clearElement();
m_documentOfRemovedElementWhileWaitingForUnlock = 0;
}
void PointerLockController::dispatchLockedMouseEvent(const PlatformMouseEvent& event, const AtomicString& eventType)
{
- if (!m_element || !m_element->document()->frame())
+ if (!m_element || !m_element->document().frame())
return;
m_element->dispatchMouseEvent(event, eventType, event.clickCount());
@@ -147,7 +147,7 @@ void PointerLockController::clearElement()
void PointerLockController::enqueueEvent(const AtomicString& type, Element* element)
{
if (element)
- enqueueEvent(type, element->document());
+ enqueueEvent(type, &element->document());
}
void PointerLockController::enqueueEvent(const AtomicString& type, Document* document)
« no previous file with comments | « Source/core/page/Page.cpp ('k') | Source/core/page/PrintContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698