Index: Source/core/page/DOMWindow.cpp |
diff --git a/Source/core/page/DOMWindow.cpp b/Source/core/page/DOMWindow.cpp |
index 65c7619ed6f22ab16cb236309f003da386b018f3..3ecb7973fc8a0d8bd544c041ab8a3dda0d743c29 100644 |
--- a/Source/core/page/DOMWindow.cpp |
+++ b/Source/core/page/DOMWindow.cpp |
@@ -227,79 +227,11 @@ static bool allowsBeforeUnloadListeners(DOMWindow* window) |
return frame == page->mainFrame(); |
} |
-bool DOMWindow::dispatchAllPendingBeforeUnloadEvents() |
-{ |
- DOMWindowSet& set = windowsWithBeforeUnloadEventListeners(); |
- if (set.isEmpty()) |
- return true; |
- |
- static bool alreadyDispatched = false; |
- ASSERT(!alreadyDispatched); |
- if (alreadyDispatched) |
- return true; |
- |
- Vector<RefPtr<DOMWindow> > windows; |
- DOMWindowSet::iterator end = set.end(); |
- for (DOMWindowSet::iterator it = set.begin(); it != end; ++it) |
- windows.append(it->key); |
- |
- size_t size = windows.size(); |
- for (size_t i = 0; i < size; ++i) { |
- DOMWindow* window = windows[i].get(); |
- if (!set.contains(window)) |
- continue; |
- |
- Frame* frame = window->frame(); |
- if (!frame) |
- continue; |
- |
- if (!frame->loader()->shouldClose()) |
- return false; |
- } |
- |
- enableSuddenTermination(); |
- |
- alreadyDispatched = true; |
- |
- return true; |
-} |
- |
unsigned DOMWindow::pendingUnloadEventListeners() const |
{ |
return windowsWithUnloadEventListeners().count(const_cast<DOMWindow*>(this)); |
} |
-void DOMWindow::dispatchAllPendingUnloadEvents() |
-{ |
- DOMWindowSet& set = windowsWithUnloadEventListeners(); |
- if (set.isEmpty()) |
- return; |
- |
- static bool alreadyDispatched = false; |
- ASSERT(!alreadyDispatched); |
- if (alreadyDispatched) |
- return; |
- |
- Vector<RefPtr<DOMWindow> > windows; |
- DOMWindowSet::iterator end = set.end(); |
- for (DOMWindowSet::iterator it = set.begin(); it != end; ++it) |
- windows.append(it->key); |
- |
- size_t size = windows.size(); |
- for (size_t i = 0; i < size; ++i) { |
- DOMWindow* window = windows[i].get(); |
- if (!set.contains(window)) |
- continue; |
- |
- window->dispatchEvent(PageTransitionEvent::create(eventNames().pagehideEvent, false), window->document()); |
- window->dispatchEvent(Event::create(eventNames().unloadEvent, false, false), window->document()); |
- } |
- |
- enableSuddenTermination(); |
- |
- alreadyDispatched = true; |
-} |
- |
// This function: |
// 1) Validates the pending changes are not changing any value to NaN; in that case keep original value. |
// 2) Constrains the window rect to the minimum window size and no bigger than the float rect's dimensions. |