Diff
Modified: trunk/Source/WebKit2/CMakeLists.txt (212831 => 212832)
--- trunk/Source/WebKit2/CMakeLists.txt 2017-02-22 17:05:22 UTC (rev 212831)
+++ trunk/Source/WebKit2/CMakeLists.txt 2017-02-22 17:15:45 UTC (rev 212832)
@@ -273,6 +273,7 @@
Shared/WebsiteData/WebsiteData.cpp
+ UIProcess/BackgroundProcessResponsivenessTimer.cpp
UIProcess/ChildProcessProxy.cpp
UIProcess/DrawingAreaProxy.cpp
UIProcess/FrameLoadState.cpp
@@ -285,7 +286,6 @@
UIProcess/ResponsivenessTimer.cpp
UIProcess/StatisticsRequest.cpp
UIProcess/TextCheckerCompletion.cpp
- UIProcess/UnresponsiveWebProcessTerminator.cpp
UIProcess/UserMediaPermissionCheckProxy.cpp
UIProcess/UserMediaPermissionRequestManagerProxy.cpp
UIProcess/UserMediaPermissionRequestProxy.cpp
Modified: trunk/Source/WebKit2/ChangeLog (212831 => 212832)
--- trunk/Source/WebKit2/ChangeLog 2017-02-22 17:05:22 UTC (rev 212831)
+++ trunk/Source/WebKit2/ChangeLog 2017-02-22 17:15:45 UTC (rev 212832)
@@ -1,3 +1,35 @@
+2017-02-22 Chris Dumez <[email protected]>
+
+ [WK2] Call processDidBecomeUnresponsive delegate when a background process is unresponsive
+ https://bugs.webkit.org/show_bug.cgi?id=168683
+ <rdar://problem/30558745>
+
+ Reviewed by Dan Bernstein.
+
+ Call processDidBecomeUnresponsive delegate when a background process is unresponsive
+ instead of killing it on WebKit side. This gives the client the choice about what it
+ wants to do about this process.
+
+ * UIProcess/API/APIProcessPoolConfiguration.cpp:
+ (API::ProcessPoolConfiguration::copy):
+ * UIProcess/API/APIProcessPoolConfiguration.h:
+ * UIProcess/API/C/WKContext.cpp:
+ * UIProcess/API/C/WKContextPrivate.h:
+ * UIProcess/BackgroundProcessResponsivenessTimer.cpp: Renamed from Source/WebKit2/UIProcess/UnresponsiveWebProcessTerminator.cpp.
+ (WebKit::BackgroundProcessResponsivenessTimer::BackgroundProcessResponsivenessTimer):
+ (WebKit::BackgroundProcessResponsivenessTimer::updateState):
+ (WebKit::BackgroundProcessResponsivenessTimer::timerFired):
+ * UIProcess/BackgroundProcessResponsivenessTimer.h: Renamed from Source/WebKit2/UIProcess/UnresponsiveWebProcessTerminator.h.
+ * UIProcess/WebPageProxy.cpp:
+ (WebKit::WebPageProxy::reattachToWebProcess):
+ (WebKit::WebPageProxy::dispatchActivityStateChange):
+ (WebKit::WebPageProxy::terminateProcess):
+ * UIProcess/WebPageProxy.h:
+ * UIProcess/WebProcessProxy.cpp:
+ (WebKit::m_backgroundResponsivenessTimer):
+ * UIProcess/WebProcessProxy.h:
+ * WebKit2.xcodeproj/project.pbxproj:
+
2017-02-22 Carlos Garcia Campos <[email protected]>
NetworkProcess: Stop disabling buffering when NETWORK_CACHE is disabled in build
Modified: trunk/Source/WebKit2/UIProcess/API/APIProcessPoolConfiguration.cpp (212831 => 212832)
--- trunk/Source/WebKit2/UIProcess/API/APIProcessPoolConfiguration.cpp 2017-02-22 17:05:22 UTC (rev 212831)
+++ trunk/Source/WebKit2/UIProcess/API/APIProcessPoolConfiguration.cpp 2017-02-22 17:15:45 UTC (rev 212832)
@@ -96,7 +96,6 @@
copy->m_maximumProcessCount = this->m_maximumProcessCount;
copy->m_cacheModel = this->m_cacheModel;
copy->m_diskCacheSpeculativeValidationEnabled = this->m_diskCacheSpeculativeValidationEnabled;
- copy->m_unresponsiveBackgroundProcessesTerminationEnabled = this->m_unresponsiveBackgroundProcessesTerminationEnabled;
copy->m_diskCacheSizeOverride = this->m_diskCacheSizeOverride;
copy->m_applicationCacheDirectory = this->m_applicationCacheDirectory;
copy->m_applicationCacheFlatFileSubdirectoryName = this->m_applicationCacheFlatFileSubdirectoryName;
Modified: trunk/Source/WebKit2/UIProcess/API/APIProcessPoolConfiguration.h (212831 => 212832)
--- trunk/Source/WebKit2/UIProcess/API/APIProcessPoolConfiguration.h 2017-02-22 17:05:22 UTC (rev 212831)
+++ trunk/Source/WebKit2/UIProcess/API/APIProcessPoolConfiguration.h 2017-02-22 17:15:45 UTC (rev 212832)
@@ -55,9 +55,6 @@
bool diskCacheSpeculativeValidationEnabled() const { return m_diskCacheSpeculativeValidationEnabled; }
void setDiskCacheSpeculativeValidationEnabled(bool enabled) { m_diskCacheSpeculativeValidationEnabled = enabled; }
- bool unresponsiveBackgroundProcessesTerminationEnabled() const { return m_unresponsiveBackgroundProcessesTerminationEnabled; }
- void setUnresponsiveBackgroundProcessesTerminationEnabled(bool enabled) { m_unresponsiveBackgroundProcessesTerminationEnabled = enabled; }
-
WebKit::CacheModel cacheModel() const { return m_cacheModel; }
void setCacheModel(WebKit::CacheModel cacheModel) { m_cacheModel = cacheModel; }
@@ -124,7 +121,6 @@
unsigned m_maximumProcessCount { 0 };
bool m_diskCacheSpeculativeValidationEnabled { false };
- bool m_unresponsiveBackgroundProcessesTerminationEnabled { false };
WebKit::CacheModel m_cacheModel { WebKit::CacheModelPrimaryWebBrowser };
int64_t m_diskCacheSizeOverride { -1 };
Modified: trunk/Source/WebKit2/UIProcess/API/C/WKContext.cpp (212831 => 212832)
--- trunk/Source/WebKit2/UIProcess/API/C/WKContext.cpp 2017-02-22 17:05:22 UTC (rev 212831)
+++ trunk/Source/WebKit2/UIProcess/API/C/WKContext.cpp 2017-02-22 17:15:45 UTC (rev 212832)
@@ -397,11 +397,6 @@
toImpl(contextRef)->configuration().setDiskCacheSpeculativeValidationEnabled(value);
}
-void WKContextSetUnresponsiveBackgroundProcessesTerminationEnabled(WKContextRef contextRef, bool value)
-{
- toImpl(contextRef)->configuration().setUnresponsiveBackgroundProcessesTerminationEnabled(value);
-}
-
WKCookieManagerRef WKContextGetCookieManager(WKContextRef contextRef)
{
return toAPI(toImpl(contextRef)->supplement<WebCookieManagerProxy>());
Modified: trunk/Source/WebKit2/UIProcess/API/C/WKContextPrivate.h (212831 => 212832)
--- trunk/Source/WebKit2/UIProcess/API/C/WKContextPrivate.h 2017-02-22 17:05:22 UTC (rev 212831)
+++ trunk/Source/WebKit2/UIProcess/API/C/WKContextPrivate.h 2017-02-22 17:15:45 UTC (rev 212832)
@@ -62,8 +62,6 @@
WK_EXPORT void WKContextSetDiskCacheSpeculativeValidationEnabled(WKContextRef context, bool value);
-WK_EXPORT void WKContextSetUnresponsiveBackgroundProcessesTerminationEnabled(WKContextRef context, bool value);
-
WK_EXPORT void WKContextSetIconDatabasePath(WKContextRef context, WKStringRef iconDatabasePath);
WK_EXPORT void WKContextAllowSpecificHTTPSCertificateForHost(WKContextRef context, WKCertificateInfoRef certificate, WKStringRef host);
Copied: trunk/Source/WebKit2/UIProcess/BackgroundProcessResponsivenessTimer.cpp (from rev 212831, trunk/Source/WebKit2/UIProcess/UnresponsiveWebProcessTerminator.cpp) (0 => 212832)
--- trunk/Source/WebKit2/UIProcess/BackgroundProcessResponsivenessTimer.cpp (rev 0)
+++ trunk/Source/WebKit2/UIProcess/BackgroundProcessResponsivenessTimer.cpp 2017-02-22 17:15:45 UTC (rev 212832)
@@ -0,0 +1,75 @@
+/*
+ * Copyright (C) 2017 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "BackgroundProcessResponsivenessTimer.h"
+
+#include "Logging.h"
+
+namespace WebKit {
+
+static const std::chrono::seconds initialInterval { 20s };
+static const std::chrono::seconds maximumInterval { 8h };
+
+BackgroundProcessResponsivenessTimer::BackgroundProcessResponsivenessTimer(WebProcessProxy& webProcessProxy)
+ : m_webProcessProxy(webProcessProxy)
+ , m_interval(initialInterval)
+ , m_timer(RunLoop::main(), this, &BackgroundProcessResponsivenessTimer::timerFired)
+{
+}
+
+void BackgroundProcessResponsivenessTimer::updateState()
+{
+ if (!shouldBeActive()) {
+ if (m_timer.isActive()) {
+ m_interval = initialInterval;
+ m_timer.stop();
+ }
+ return;
+ }
+
+ if (!m_timer.isActive())
+ m_timer.startOneShot(m_interval);
+}
+
+void BackgroundProcessResponsivenessTimer::timerFired()
+{
+ ASSERT(shouldBeActive());
+ // WebProcessProxy::responsive() takes care of calling processDidBecomeUnresponsive for us.
+ m_webProcessProxy.isResponsive([this](bool processIsResponsive) {
+ if (processIsResponsive) {
+ // Exponential backoff to avoid waking up the process too often.
+ m_interval = std::min(m_interval * 2, maximumInterval);
+ m_timer.startOneShot(m_interval);
+ return;
+ }
+
+ RELEASE_LOG_ERROR(PerformanceLogging, "Notified the client that a background WebProcess has become unresponsive");
+ WTFLogAlways("Notified the client that a background WebProcess has become unresponsive");
+ m_interval = initialInterval;
+ });
+}
+
+} // namespace WebKit
Copied: trunk/Source/WebKit2/UIProcess/BackgroundProcessResponsivenessTimer.h (from rev 212831, trunk/Source/WebKit2/UIProcess/UnresponsiveWebProcessTerminator.h) (0 => 212832)
--- trunk/Source/WebKit2/UIProcess/BackgroundProcessResponsivenessTimer.h (rev 0)
+++ trunk/Source/WebKit2/UIProcess/BackgroundProcessResponsivenessTimer.h 2017-02-22 17:15:45 UTC (rev 212832)
@@ -0,0 +1,47 @@
+/*
+ * Copyright (C) 2017 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#include "WebProcessProxy.h"
+#include <wtf/RunLoop.h>
+
+namespace WebKit {
+
+class BackgroundProcessResponsivenessTimer {
+public:
+ explicit BackgroundProcessResponsivenessTimer(WebProcessProxy&);
+ void updateState();
+
+private:
+ void timerFired();
+ bool shouldBeActive() const { return !m_webProcessProxy.visiblePageCount() && m_webProcessProxy.pageCount(); }
+
+ WebProcessProxy& m_webProcessProxy;
+ std::chrono::seconds m_interval;
+ RunLoop::Timer<BackgroundProcessResponsivenessTimer> m_timer;
+};
+
+}
Deleted: trunk/Source/WebKit2/UIProcess/UnresponsiveWebProcessTerminator.cpp (212831 => 212832)
--- trunk/Source/WebKit2/UIProcess/UnresponsiveWebProcessTerminator.cpp 2017-02-22 17:05:22 UTC (rev 212831)
+++ trunk/Source/WebKit2/UIProcess/UnresponsiveWebProcessTerminator.cpp 2017-02-22 17:15:45 UTC (rev 212832)
@@ -1,82 +0,0 @@
-/*
- * Copyright (C) 2017 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "UnresponsiveWebProcessTerminator.h"
-
-#include "Logging.h"
-
-namespace WebKit {
-
-static const std::chrono::seconds initialInterval { 20s };
-static const std::chrono::seconds maximumInterval { 8h };
-
-UnresponsiveWebProcessTerminator::UnresponsiveWebProcessTerminator(WebProcessProxy& webProcessProxy)
- : m_webProcessProxy(webProcessProxy)
- , m_interval(initialInterval)
- , m_timer(RunLoop::main(), this, &UnresponsiveWebProcessTerminator::timerFired)
-{
-}
-
-void UnresponsiveWebProcessTerminator::updateState()
-{
- if (!shouldBeActive()) {
- if (m_timer.isActive()) {
- m_interval = initialInterval;
- m_timer.stop();
- }
- return;
- }
-
- if (!m_timer.isActive())
- m_timer.startOneShot(m_interval);
-}
-
-static Vector<RefPtr<WebPageProxy>> pagesCopy(WTF::IteratorRange<WebProcessProxy::WebPageProxyMap::const_iterator::Values> pages)
-{
- Vector<RefPtr<WebPageProxy>> vector;
- for (auto& page : pages)
- vector.append(page);
- return vector;
-}
-
-void UnresponsiveWebProcessTerminator::timerFired()
-{
- ASSERT(shouldBeActive());
- m_webProcessProxy.isResponsive([this](bool processIsResponsive) {
- if (processIsResponsive) {
- // Exponential backoff to avoid waking up the process too often.
- m_interval = std::min(m_interval * 2, maximumInterval);
- m_timer.startOneShot(m_interval);
- return;
- }
-
- RELEASE_LOG_ERROR(PerformanceLogging, "Killing a background WebProcess because it is not responsive");
- for (auto& page : pagesCopy(m_webProcessProxy.pages()))
- page->terminateProcess(WebPageProxy::TerminationReason::UnresponsiveWhileInBackground);
- });
-}
-
-} // namespace WebKit
Deleted: trunk/Source/WebKit2/UIProcess/UnresponsiveWebProcessTerminator.h (212831 => 212832)
--- trunk/Source/WebKit2/UIProcess/UnresponsiveWebProcessTerminator.h 2017-02-22 17:05:22 UTC (rev 212831)
+++ trunk/Source/WebKit2/UIProcess/UnresponsiveWebProcessTerminator.h 2017-02-22 17:15:45 UTC (rev 212832)
@@ -1,47 +0,0 @@
-/*
- * Copyright (C) 2017 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#pragma once
-
-#include "WebProcessProxy.h"
-#include <wtf/RunLoop.h>
-
-namespace WebKit {
-
-class UnresponsiveWebProcessTerminator {
-public:
- explicit UnresponsiveWebProcessTerminator(WebProcessProxy&);
- void updateState();
-
-private:
- void timerFired();
- bool shouldBeActive() const { return !m_webProcessProxy.visiblePageCount() && m_webProcessProxy.pageCount(); }
-
- WebProcessProxy& m_webProcessProxy;
- std::chrono::seconds m_interval;
- RunLoop::Timer<UnresponsiveWebProcessTerminator> m_timer;
-};
-
-}
Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp (212831 => 212832)
--- trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp 2017-02-22 17:05:22 UTC (rev 212831)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp 2017-02-22 17:15:45 UTC (rev 212832)
@@ -712,7 +712,6 @@
ASSERT(m_process->state() == WebProcessProxy::State::Terminated);
m_isValid = true;
- m_wasKilledForBeingUnresponsiveWhileInBackground = false;
m_process->removeWebPage(m_pageID);
m_process->removeMessageReceiver(Messages::WebPageProxy::messageReceiverName(), m_pageID);
@@ -1514,19 +1513,6 @@
}
}
-void WebPageProxy::reloadAfterBeingKilledInBackground()
-{
- ASSERT(!isValid());
-
- RELEASE_LOG_IF_ALLOWED("%p - Reloading tab that was killed in the background", this);
-
- // Only report as a crash if the page was ever visible, otherwise silently reload.
- if (m_hasEverBeenVisible)
- processDidCrash();
- else
- reattachToWebProcessForReload();
-}
-
void WebPageProxy::dispatchActivityStateChange()
{
#if PLATFORM(COCOA)
@@ -1533,11 +1519,8 @@
m_activityStateChangeDispatcher->invalidate();
#endif
- if (!isValid()) {
- if (m_potentiallyChangedActivityStateFlags & ActivityState::IsVisible && m_wasKilledForBeingUnresponsiveWhileInBackground)
- reloadAfterBeingKilledInBackground();
+ if (!isValid())
return;
- }
// If the visibility state may have changed, then so may the visually idle & occluded agnostic state.
if (m_potentiallyChangedActivityStateFlags & ActivityState::IsVisible)
@@ -1576,10 +1559,9 @@
#endif
if (changed & ActivityState::IsVisible) {
- if (isViewVisible()) {
- m_hasEverBeenVisible = true;
+ if (isViewVisible())
m_visiblePageToken = m_process->visiblePageToken();
- } else {
+ else {
m_visiblePageToken = nullptr;
// If we've started the responsiveness timer as part of telling the web process to update the backing store
@@ -2394,7 +2376,7 @@
m_process->send(Messages::WebPage::SetCustomTextEncodingName(encodingName), m_pageID);
}
-void WebPageProxy::terminateProcess(TerminationReason terminationReason)
+void WebPageProxy::terminateProcess()
{
// NOTE: This uses a check of m_isValid rather than calling isValid() since
// we want this to run even for pages being closed or that already closed.
@@ -2403,7 +2385,6 @@
m_process->requestTermination();
resetStateAfterProcessExited();
- m_wasKilledForBeingUnresponsiveWhileInBackground = terminationReason == TerminationReason::UnresponsiveWhileInBackground;
}
SessionState WebPageProxy::sessionState(const std::function<bool (WebBackForwardListItem&)>& filter) const
Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.h (212831 => 212832)
--- trunk/Source/WebKit2/UIProcess/WebPageProxy.h 2017-02-22 17:05:22 UTC (rev 212831)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.h 2017-02-22 17:15:45 UTC (rev 212832)
@@ -675,8 +675,7 @@
double estimatedProgress() const;
- enum class TerminationReason { UnresponsiveWhileInBackground, Other };
- void terminateProcess(TerminationReason = TerminationReason::Other);
+ void terminateProcess();
SessionState sessionState(const std::function<bool (WebBackForwardListItem&)>& = nullptr) const;
RefPtr<API::Navigation> restoreFromSessionState(SessionState, bool navigate);
@@ -1575,7 +1574,6 @@
void dispatchActivityStateChange();
void viewDidLeaveWindow();
void viewDidEnterWindow();
- void reloadAfterBeingKilledInBackground();
#if PLATFORM(MAC)
void didPerformImmediateActionHitTest(const WebHitTestResultData&, bool contentPreventsDefault, const UserData&);
@@ -1950,7 +1948,6 @@
bool m_hasHadSelectionChangesFromUserInteraction { false };
bool m_needsHiddenContentEditableQuirk { false };
bool m_needsPlainTextQuirk { false };
- bool m_hasEverBeenVisible { false };
#if ENABLE(MEDIA_SESSION)
bool m_hasMediaSessionWithActiveMediaElements { false };
@@ -1976,7 +1973,6 @@
#endif
bool m_isUsingHighPerformanceWebGL { false };
- bool m_wasKilledForBeingUnresponsiveWhileInBackground { false };
WeakPtrFactory<WebPageProxy> m_weakPtrFactory;
};
Modified: trunk/Source/WebKit2/UIProcess/WebProcessProxy.cpp (212831 => 212832)
--- trunk/Source/WebKit2/UIProcess/WebProcessProxy.cpp 2017-02-22 17:05:22 UTC (rev 212831)
+++ trunk/Source/WebKit2/UIProcess/WebProcessProxy.cpp 2017-02-22 17:15:45 UTC (rev 212832)
@@ -29,6 +29,7 @@
#include "APIFrameHandle.h"
#include "APIPageGroupHandle.h"
#include "APIPageHandle.h"
+#include "BackgroundProcessResponsivenessTimer.h"
#include "DataReference.h"
#include "DownloadProxyMap.h"
#include "Logging.h"
@@ -36,7 +37,6 @@
#include "PluginProcessManager.h"
#include "TextChecker.h"
#include "TextCheckerState.h"
-#include "UnresponsiveWebProcessTerminator.h"
#include "UserData.h"
#include "WebBackForwardListItem.h"
#include "WebIconDatabase.h"
@@ -103,7 +103,7 @@
, m_throttler(*this)
, m_isResponsive(NoOrMaybe::Maybe)
, m_visiblePageCounter([this](RefCounterEvent) { updateBackgroundResponsivenessTimer(); })
- , m_backgroundResponsivenessTimer(processPool.configuration().unresponsiveBackgroundProcessesTerminationEnabled() ? std::make_unique<UnresponsiveWebProcessTerminator>(*this) : nullptr)
+ , m_backgroundResponsivenessTimer(std::make_unique<BackgroundProcessResponsivenessTimer>(*this))
{
WebPasteboardProxy::singleton().addWebProcessProxy(*this);
Modified: trunk/Source/WebKit2/UIProcess/WebProcessProxy.h (212831 => 212832)
--- trunk/Source/WebKit2/UIProcess/WebProcessProxy.h 2017-02-22 17:05:22 UTC (rev 212831)
+++ trunk/Source/WebKit2/UIProcess/WebProcessProxy.h 2017-02-22 17:15:45 UTC (rev 212832)
@@ -54,8 +54,8 @@
namespace WebKit {
+class BackgroundProcessResponsivenessTimer;
class NetworkProcessProxy;
-class UnresponsiveWebProcessTerminator;
class WebBackForwardListItem;
class WebPageGroup;
class WebProcessPool;
@@ -255,7 +255,7 @@
Vector<std::function<void(bool webProcessIsResponsive)>> m_isResponsiveCallbacks;
VisibleWebPageCounter m_visiblePageCounter;
- std::unique_ptr<UnresponsiveWebProcessTerminator> m_backgroundResponsivenessTimer;
+ std::unique_ptr<BackgroundProcessResponsivenessTimer> m_backgroundResponsivenessTimer;
};
} // namespace WebKit
Modified: trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj (212831 => 212832)
--- trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj 2017-02-22 17:05:22 UTC (rev 212831)
+++ trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj 2017-02-22 17:15:45 UTC (rev 212832)
@@ -898,8 +898,8 @@
41FAF5F81E3C1021001AE678 /* LibWebRTCResolver.h in Headers */ = {isa = PBXBuildFile; fileRef = 41FAF5F61E3C0B47001AE678 /* LibWebRTCResolver.h */; };
41FAF5F91E3C1025001AE678 /* LibWebRTCResolver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 41FAF5F71E3C0B47001AE678 /* LibWebRTCResolver.cpp */; };
4450AEC01DC3FAE5009943F2 /* SharedMemoryCocoa.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4450AEBF1DC3FAE5009943F2 /* SharedMemoryCocoa.cpp */; };
- 46A2B6081E5676A600C3DEDA /* UnresponsiveWebProcessTerminator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A2B6061E5675A200C3DEDA /* UnresponsiveWebProcessTerminator.cpp */; };
- 46A2B6091E5676A600C3DEDA /* UnresponsiveWebProcessTerminator.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A2B6071E5675A200C3DEDA /* UnresponsiveWebProcessTerminator.h */; };
+ 46A2B6081E5676A600C3DEDA /* BackgroundProcessResponsivenessTimer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A2B6061E5675A200C3DEDA /* BackgroundProcessResponsivenessTimer.cpp */; };
+ 46A2B6091E5676A600C3DEDA /* BackgroundProcessResponsivenessTimer.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A2B6071E5675A200C3DEDA /* BackgroundProcessResponsivenessTimer.h */; };
4A3CC18A19B063E700D14AEF /* UserMediaPermissionRequestManagerProxy.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4A410F3919AF7B04002EBAB5 /* UserMediaPermissionRequestManagerProxy.cpp */; };
4A3CC18B19B0640F00D14AEF /* UserMediaPermissionRequestManagerProxy.h in Headers */ = {isa = PBXBuildFile; fileRef = 4A410F3A19AF7B04002EBAB5 /* UserMediaPermissionRequestManagerProxy.h */; };
4A3CC18C19B0641500D14AEF /* UserMediaPermissionRequestProxy.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4A410F3B19AF7B04002EBAB5 /* UserMediaPermissionRequestProxy.cpp */; };
@@ -3061,8 +3061,8 @@
41FAF5F61E3C0B47001AE678 /* LibWebRTCResolver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = LibWebRTCResolver.h; path = Network/webrtc/LibWebRTCResolver.h; sourceTree = "<group>"; };
41FAF5F71E3C0B47001AE678 /* LibWebRTCResolver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LibWebRTCResolver.cpp; path = Network/webrtc/LibWebRTCResolver.cpp; sourceTree = "<group>"; };
4450AEBF1DC3FAE5009943F2 /* SharedMemoryCocoa.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SharedMemoryCocoa.cpp; path = cocoa/SharedMemoryCocoa.cpp; sourceTree = "<group>"; };
- 46A2B6061E5675A200C3DEDA /* UnresponsiveWebProcessTerminator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UnresponsiveWebProcessTerminator.cpp; sourceTree = "<group>"; };
- 46A2B6071E5675A200C3DEDA /* UnresponsiveWebProcessTerminator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UnresponsiveWebProcessTerminator.h; sourceTree = "<group>"; };
+ 46A2B6061E5675A200C3DEDA /* BackgroundProcessResponsivenessTimer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = BackgroundProcessResponsivenessTimer.cpp; sourceTree = "<group>"; };
+ 46A2B6071E5675A200C3DEDA /* BackgroundProcessResponsivenessTimer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BackgroundProcessResponsivenessTimer.h; sourceTree = "<group>"; };
4A410F3519AF7AC3002EBAB5 /* WKUserMediaPermissionRequest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WKUserMediaPermissionRequest.cpp; sourceTree = "<group>"; };
4A410F3619AF7AC3002EBAB5 /* WKUserMediaPermissionRequest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKUserMediaPermissionRequest.h; sourceTree = "<group>"; };
4A410F3919AF7B04002EBAB5 /* UserMediaPermissionRequestManagerProxy.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UserMediaPermissionRequestManagerProxy.cpp; sourceTree = "<group>"; };
@@ -6479,6 +6479,8 @@
1AAF089E192681AC00B6390C /* UserContent */,
1A53C2A31A325691004E8C70 /* WebsiteData */,
7CD102D91866770600ED429D /* AutoCorrectionCallback.h */,
+ 46A2B6061E5675A200C3DEDA /* BackgroundProcessResponsivenessTimer.cpp */,
+ 46A2B6071E5675A200C3DEDA /* BackgroundProcessResponsivenessTimer.h */,
E1513C64166EABB200149FCB /* ChildProcessProxy.cpp */,
E1513C65166EABB200149FCB /* ChildProcessProxy.h */,
BC2652121182608100243E12 /* DrawingAreaProxy.cpp */,
@@ -6514,8 +6516,6 @@
1AA417C912C00CCA002BE67B /* TextChecker.h */,
1BB417C912C00CCA002BE67B /* TextCheckerCompletion.cpp */,
1CC417C912C00CCA002BE67B /* TextCheckerCompletion.h */,
- 46A2B6061E5675A200C3DEDA /* UnresponsiveWebProcessTerminator.cpp */,
- 46A2B6071E5675A200C3DEDA /* UnresponsiveWebProcessTerminator.h */,
07297F9C1C17BBEA003F0735 /* UserMediaPermissionCheckProxy.cpp */,
07297F9D1C17BBEA003F0735 /* UserMediaPermissionCheckProxy.h */,
4A410F3919AF7B04002EBAB5 /* UserMediaPermissionRequestManagerProxy.cpp */,
@@ -8027,7 +8027,7 @@
4F601432155C5AA2001FBDE0 /* BlockingResponseMap.h in Headers */,
1A5705111BE410E600874AF1 /* BlockSPI.h in Headers */,
BC3065FA1259344E00E71278 /* CacheModel.h in Headers */,
- 46A2B6091E5676A600C3DEDA /* UnresponsiveWebProcessTerminator.h in Headers */,
+ 46A2B6091E5676A600C3DEDA /* BackgroundProcessResponsivenessTimer.h in Headers */,
1AA2E51D12E4C05E00BC4966 /* CGUtilities.h in Headers */,
1A2D956F12848564001EB962 /* ChildProcess.h in Headers */,
51FAEC3A1B0657630009C4E7 /* ChildProcessMessages.h in Headers */,
@@ -9714,7 +9714,7 @@
532159531DBAE7180054AA3C /* NetworkSession.cpp in Sources */,
5C20CB9D1BB0DCFA00895BB1 /* NetworkSessionCocoa.mm in Sources */,
31A2EC551489982E00810D71 /* NotificationPermissionRequest.cpp in Sources */,
- 46A2B6081E5676A600C3DEDA /* UnresponsiveWebProcessTerminator.cpp in Sources */,
+ 46A2B6081E5676A600C3DEDA /* BackgroundProcessResponsivenessTimer.cpp in Sources */,
3131261E148FF82C00BA2A39 /* NotificationPermissionRequestManager.cpp in Sources */,
31A2EC501489980500810D71 /* NotificationPermissionRequestManagerProxy.cpp in Sources */,
1A2D848C127F6A49001EB962 /* NPIdentifierData.cpp in Sources */,