Index: Source/core/dom/WheelController.cpp |
diff --git a/Source/core/dom/WheelController.cpp b/Source/core/dom/WheelController.cpp |
index 68d5b18b2e5076f8afa0212cca5321b5aba27e0a..132445e94c29bb55cb28a28d524e6dd6f7cd5cb9 100644 |
--- a/Source/core/dom/WheelController.cpp |
+++ b/Source/core/dom/WheelController.cpp |
@@ -35,8 +35,8 @@ |
namespace WebCore { |
-WheelController::WheelController(Document* document) |
- : DOMWindowLifecycleObserver(document->domWindow()) |
+WheelController::WheelController(Document& document) |
+ : DOMWindowLifecycleObserver(document.domWindow()) |
, m_wheelEventHandlerCount(0) |
{ |
} |
@@ -50,7 +50,7 @@ const char* WheelController::supplementName() |
return "WheelController"; |
} |
-WheelController* WheelController::from(Document* document) |
+WheelController* WheelController::from(Document& document) |
{ |
WheelController* controller = static_cast<WheelController*>(DocumentSupplement::from(document, supplementName())); |
if (!controller) { |
@@ -60,9 +60,9 @@ WheelController* WheelController::from(Document* document) |
return controller; |
} |
-static void wheelEventHandlerCountChanged(Document* document) |
+static void wheelEventHandlerCountChanged(Document& document) |
{ |
- Page* page = document->page(); |
+ Page* page = document.page(); |
if (!page) |
return; |
@@ -70,17 +70,17 @@ static void wheelEventHandlerCountChanged(Document* document) |
if (!scrollingCoordinator) |
return; |
- FrameView* frameView = document->view(); |
+ FrameView* frameView = document.view(); |
if (!frameView) |
return; |
scrollingCoordinator->frameViewWheelEventHandlerCountChanged(frameView); |
} |
-void WheelController::didAddWheelEventHandler(Document* document) |
+void WheelController::didAddWheelEventHandler(Document& document) |
{ |
++m_wheelEventHandlerCount; |
- Page* page = document->page(); |
+ Page* page = document.page(); |
Frame* mainFrame = page ? page->mainFrame() : 0; |
if (mainFrame) |
mainFrame->notifyChromeClientWheelEventHandlerCountChanged(); |
@@ -88,11 +88,11 @@ void WheelController::didAddWheelEventHandler(Document* document) |
wheelEventHandlerCountChanged(document); |
} |
-void WheelController::didRemoveWheelEventHandler(Document* document) |
+void WheelController::didRemoveWheelEventHandler(Document& document) |
{ |
ASSERT(m_wheelEventHandlerCount > 0); |
--m_wheelEventHandlerCount; |
- Page* page = document->page(); |
+ Page* page = document.page(); |
Frame* mainFrame = page ? page->mainFrame() : 0; |
if (mainFrame) |
mainFrame->notifyChromeClientWheelEventHandlerCountChanged(); |
@@ -106,7 +106,8 @@ void WheelController::didAddEventListener(DOMWindow* window, const AtomicString& |
return; |
Document* document = window->document(); |
- didAddWheelEventHandler(document); |
+ ASSERT(document); |
+ didAddWheelEventHandler(*document); |
} |
void WheelController::didRemoveEventListener(DOMWindow* window, const AtomicString& eventType) |
@@ -115,7 +116,8 @@ void WheelController::didRemoveEventListener(DOMWindow* window, const AtomicStri |
return; |
Document* document = window->document(); |
- didRemoveWheelEventHandler(document); |
+ ASSERT(document); |
+ didRemoveWheelEventHandler(*document); |
} |
} // namespace WebCore |