Index: Source/core/frame/LocalDOMWindow.cpp |
diff --git a/Source/core/frame/LocalDOMWindow.cpp b/Source/core/frame/LocalDOMWindow.cpp |
index ee80a05b0ddfa044471e6f6a30942a0f01963611..af25054a292930e24335fe758a1e235ba3199b84 100644 |
--- a/Source/core/frame/LocalDOMWindow.cpp |
+++ b/Source/core/frame/LocalDOMWindow.cpp |
@@ -231,6 +231,8 @@ static void addUnloadEventListener(LocalDOMWindow* domWindow) |
if (set.isEmpty()) |
disableSuddenTermination(); |
clamy
2015/01/20 16:47:01
Note: this call as well as the equivalent ones dow
|
set.add(domWindow); |
+ domWindow->frame()->loader().client()->suddenTerminationDisablerChanged( |
+ true, FrameLoaderClient::UnloadHandler); |
} |
static void removeUnloadEventListener(LocalDOMWindow* domWindow) |
@@ -242,6 +244,8 @@ static void removeUnloadEventListener(LocalDOMWindow* domWindow) |
set.remove(it); |
if (set.isEmpty()) |
enableSuddenTermination(); |
+ domWindow->frame()->loader().client()->suddenTerminationDisablerChanged( |
+ false, FrameLoaderClient::UnloadHandler); |
} |
static void removeAllUnloadEventListeners(LocalDOMWindow* domWindow) |
@@ -253,6 +257,7 @@ static void removeAllUnloadEventListeners(LocalDOMWindow* domWindow) |
set.removeAll(it); |
if (set.isEmpty()) |
enableSuddenTermination(); |
+ // TODO: remove the right number here |
} |
static void addBeforeUnloadEventListener(LocalDOMWindow* domWindow) |
@@ -261,6 +266,8 @@ static void addBeforeUnloadEventListener(LocalDOMWindow* domWindow) |
if (set.isEmpty()) |
disableSuddenTermination(); |
set.add(domWindow); |
+ domWindow->frame()->loader().client()->suddenTerminationDisablerChanged( |
+ true, FrameLoaderClient::BeforeUnloadHandler); |
} |
static void removeBeforeUnloadEventListener(LocalDOMWindow* domWindow) |
@@ -272,6 +279,8 @@ static void removeBeforeUnloadEventListener(LocalDOMWindow* domWindow) |
set.remove(it); |
if (set.isEmpty()) |
enableSuddenTermination(); |
+ domWindow->frame()->loader().client()->suddenTerminationDisablerChanged( |
+ false, FrameLoaderClient::BeforeUnloadHandler); |
} |
static void removeAllBeforeUnloadEventListeners(LocalDOMWindow* domWindow) |
@@ -283,6 +292,7 @@ static void removeAllBeforeUnloadEventListeners(LocalDOMWindow* domWindow) |
set.removeAll(it); |
if (set.isEmpty()) |
enableSuddenTermination(); |
+ // TODO: remove the right number here |
} |
static bool allowsBeforeUnloadListeners(LocalDOMWindow* window) |