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

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

Issue 17603004: Remove dead code in DOMWindow. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 6 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/DOMWindow.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.
« no previous file with comments | « Source/core/page/DOMWindow.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698