WebKit Bugzilla
Attachment 339506 Details for
Bug 177972
: [WK2][iOS] Audio may keep playing for 10 seconds after closing a tab
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-177972-20180503192433.patch (text/plain), 9.95 KB, created by
Chris Dumez
on 2018-05-03 19:24:35 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Chris Dumez
Created:
2018-05-03 19:24:35 PDT
Size:
9.95 KB
patch
obsolete
>Subversion Revision: 231329 >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index dd5597fbb51b590e0185c9784b8478ecde38de7f..e4e3cd3cec643fe8f6e976f06a8d15babcc17c17 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,34 @@ >+2017-10-05 Chris Dumez <cdumez@apple.com> >+ >+ More aggressively terminate child processes when the connection to their parent process is severed >+ https://bugs.webkit.org/show_bug.cgi?id=177972 >+ <rdar://problem/33317607> >+ >+ Reviewed by Geoff Garen. >+ >+ More aggressively terminate child processes when the connection to their parent process is severed. >+ Previously, we would dispatch to the main thread and then exit the process. This would sometimes >+ cause the process to say alive for 10 seconds until our watchdog would forcefully terminate the >+ process. This could happen in particular when the main thread is blocked on a synchronous IPC. >+ >+ * NetworkProcess/NetworkProcess.cpp: >+ (WebKit::NetworkProcess::didClose): Deleted. >+ * NetworkProcess/NetworkProcess.h: >+ * PluginProcess/PluginProcess.cpp: >+ (WebKit::PluginProcess::didClose): Deleted. >+ * PluginProcess/PluginProcess.h: >+ * Shared/ChildProcess.cpp: >+ (WebKit::ChildProcess::didClose): >+ (WebKit::didCloseOnConnectionWorkQueue): >+ (WebKit::ChildProcess::terminationTimerFired): >+ * Shared/ChildProcess.h: >+ * StorageProcess/StorageProcess.cpp: >+ (WebKit::StorageProcess::didClose): Deleted. >+ * StorageProcess/StorageProcess.h: >+ * WebProcess/WebProcess.cpp: >+ (WebKit::WebProcess::didClose): Deleted. >+ * WebProcess/WebProcess.h: >+ > 2018-05-03 Justin Fan <justin_fan@apple.com> > > [WebGL] Add runtime flag for enabling ASTC support in WebGL >diff --git a/Source/WebKit/NetworkProcess/NetworkProcess.cpp b/Source/WebKit/NetworkProcess/NetworkProcess.cpp >index 077bd73b043c80c1146c341be49135a595c828cb..9713f96c88d217678ae4ff11420d97f5dac94ee6 100644 >--- a/Source/WebKit/NetworkProcess/NetworkProcess.cpp >+++ b/Source/WebKit/NetworkProcess/NetworkProcess.cpp >@@ -190,12 +190,6 @@ void NetworkProcess::didReceiveSyncMessage(IPC::Connection& connection, IPC::Dec > didReceiveSyncNetworkProcessMessage(connection, decoder, replyEncoder); > } > >-void NetworkProcess::didClose(IPC::Connection&) >-{ >- // The UIProcess just exited. >- stopRunLoop(); >-} >- > void NetworkProcess::didCreateDownload() > { > disableTermination(); >diff --git a/Source/WebKit/NetworkProcess/NetworkProcess.h b/Source/WebKit/NetworkProcess/NetworkProcess.h >index b961abcb009fd212be159666b3a140a44280f31a..ffa8b78c14ecef307e1ad3b10b4316262fc873b9 100644 >--- a/Source/WebKit/NetworkProcess/NetworkProcess.h >+++ b/Source/WebKit/NetworkProcess/NetworkProcess.h >@@ -188,7 +188,6 @@ private: > // IPC::Connection::Client > void didReceiveMessage(IPC::Connection&, IPC::Decoder&) override; > void didReceiveSyncMessage(IPC::Connection&, IPC::Decoder&, std::unique_ptr<IPC::Encoder>&) override; >- void didClose(IPC::Connection&) override; > > // DownloadManager::Client > void didCreateDownload() override; >diff --git a/Source/WebKit/PluginProcess/PluginProcess.cpp b/Source/WebKit/PluginProcess/PluginProcess.cpp >index 3cb004cfa572d9479218a035cbdf8fd776e3b635..1cd3075b6bc27aa8257b43635a670238d6b8c93c 100644 >--- a/Source/WebKit/PluginProcess/PluginProcess.cpp >+++ b/Source/WebKit/PluginProcess/PluginProcess.cpp >@@ -119,13 +119,6 @@ void PluginProcess::didReceiveMessage(IPC::Connection& connection, IPC::Decoder& > didReceivePluginProcessMessage(connection, decoder); > } > >-void PluginProcess::didClose(IPC::Connection&) >-{ >- // The UI process has crashed, just quit. >- // FIXME: If the plug-in is spinning in the main loop, we'll never get this message. >- stopRunLoop(); >-} >- > void PluginProcess::initializePluginProcess(PluginProcessCreationParameters&& parameters) > { > ASSERT(!m_pluginModule); >diff --git a/Source/WebKit/PluginProcess/PluginProcess.h b/Source/WebKit/PluginProcess/PluginProcess.h >index 40d37e67a4ad6ae0a5e50c5cd87e673b6f5e6db4..d5081b061cdf7936a06c94039dd92623843ccf95 100644 >--- a/Source/WebKit/PluginProcess/PluginProcess.h >+++ b/Source/WebKit/PluginProcess/PluginProcess.h >@@ -87,7 +87,6 @@ private: > > // IPC::Connection::Client > void didReceiveMessage(IPC::Connection&, IPC::Decoder&) override; >- void didClose(IPC::Connection&) override; > > // Message handlers. > void didReceivePluginProcessMessage(IPC::Connection&, IPC::Decoder&); >diff --git a/Source/WebKit/Shared/ChildProcess.cpp b/Source/WebKit/Shared/ChildProcess.cpp >index b55d86fd65da72790d56380a711d4c69f8411f03..0b2cab7976967ab698ab1f9f666283fecdbc9997 100644 >--- a/Source/WebKit/Shared/ChildProcess.cpp >+++ b/Source/WebKit/Shared/ChildProcess.cpp >@@ -50,19 +50,15 @@ ChildProcess::~ChildProcess() > { > } > >-static void didCloseOnConnectionWorkQueue(IPC::Connection*) >-{ >- // If the connection has been closed and we haven't responded in the main thread for 10 seconds >- // the process will exit forcibly. >- auto watchdogDelay = 10_s; >- >- WorkQueue::create("com.apple.WebKit.ChildProcess.WatchDogQueue")->dispatchAfter(watchdogDelay, [] { >- // We use _exit here since the watchdog callback is called from another thread and we don't want >- // global destructors or atexit handlers to be called from this thread while the main thread is busy >- // doing its thing. >- RELEASE_LOG_ERROR(IPC, "Exiting process early due to unacknowledged closed-connection"); >- _exit(EXIT_FAILURE); >- }); >+void ChildProcess::didClose(IPC::Connection&) >+{ >+ // We call _exit() in didCloseOnConnectionWorkQueue. >+ ASSERT_NOT_REACHED(); >+} >+ >+NO_RETURN static void didCloseOnConnectionWorkQueue(IPC::Connection*) >+{ >+ _exit(EXIT_SUCCESS); > } > > void ChildProcess::initialize(const ChildProcessInitializationParameters& parameters) >diff --git a/Source/WebKit/Shared/ChildProcess.h b/Source/WebKit/Shared/ChildProcess.h >index c6e4edf8bf9eaabc48485ab553bdfd37446220df..bfd16ea45eb81fff60f6f23fec0657e37f9ab281 100644 >--- a/Source/WebKit/Shared/ChildProcess.h >+++ b/Source/WebKit/Shared/ChildProcess.h >@@ -115,6 +115,7 @@ private: > > // IPC::Connection::Client. > void didReceiveInvalidMessage(IPC::Connection&, IPC::StringReference messageReceiverName, IPC::StringReference messageName) final; >+ void didClose(IPC::Connection&) final; > > void shutDown(); > >diff --git a/Source/WebKit/StorageProcess/StorageProcess.cpp b/Source/WebKit/StorageProcess/StorageProcess.cpp >index 9bbbbaac55217c49311cffadcc378aa5c3704233..e8409942d715e5f6cc8f75489f7991866cff8902 100644 >--- a/Source/WebKit/StorageProcess/StorageProcess.cpp >+++ b/Source/WebKit/StorageProcess/StorageProcess.cpp >@@ -97,19 +97,6 @@ WebSWServerToContextConnection* StorageProcess::connectionToContextProcessFromIP > } > #endif > >-void StorageProcess::didClose(IPC::Connection& connection) >-{ >-#if ENABLE(SERVICE_WORKER) >- if (RefPtr<WebSWServerToContextConnection> serverToContextConnection = connectionToContextProcessFromIPCConnection(connection)) { >- connectionToContextProcessWasClosed(serverToContextConnection.releaseNonNull()); >- return; >- } >-#else >- UNUSED_PARAM(connection); >-#endif >- stopRunLoop(); >-} >- > #if ENABLE(SERVICE_WORKER) > void StorageProcess::connectionToContextProcessWasClosed(Ref<WebSWServerToContextConnection>&& serverToContextConnection) > { >diff --git a/Source/WebKit/StorageProcess/StorageProcess.h b/Source/WebKit/StorageProcess/StorageProcess.h >index 6010a9ef196b7baf5cb33877585a0d6c4051e019..64a5289fde136c90b8aff386e7e0e106572c6d99 100644 >--- a/Source/WebKit/StorageProcess/StorageProcess.h >+++ b/Source/WebKit/StorageProcess/StorageProcess.h >@@ -122,7 +122,6 @@ private: > > // IPC::Connection::Client > void didReceiveMessage(IPC::Connection&, IPC::Decoder&) override; >- void didClose(IPC::Connection&) override; > > // Message Handlers > void initializeWebsiteDataStore(const StorageProcessCreationParameters&); >diff --git a/Source/WebKit/WebProcess/WebProcess.cpp b/Source/WebKit/WebProcess/WebProcess.cpp >index d0627523f100af4f29a76737a6f1d140121dc9f1..982ddfd2d3211490509a472eb39a4a415b1f3275 100644 >--- a/Source/WebKit/WebProcess/WebProcess.cpp >+++ b/Source/WebKit/WebProcess/WebProcess.cpp >@@ -670,29 +670,6 @@ void WebProcess::didReceiveMessage(IPC::Connection& connection, IPC::Decoder& de > LOG_ERROR("Unhandled web process message '%s:%s'", decoder.messageReceiverName().toString().data(), decoder.messageName().toString().data()); > } > >-void WebProcess::didClose(IPC::Connection&) >-{ >-#if !defined(NDEBUG) || PLATFORM(GTK) || PLATFORM(WPE) >- for (auto& page : copyToVector(m_pageMap.values())) >- page->close(); >-#endif >- >-#ifndef NDEBUG >- GCController::singleton().garbageCollectSoon(); >- FontCache::singleton().invalidate(); >- MemoryCache::singleton().setDisabled(true); >-#endif >- >-#if ENABLE(VIDEO) >- // FIXME(146657): This explicit media stop command should not be necessary >- if (auto* platformMediaSessionManager = PlatformMediaSessionManager::sharedManagerIfExists()) >- platformMediaSessionManager->stopAllMediaPlaybackForProcess(); >-#endif >- >- // The UI process closed this connection, shut down. >- stopRunLoop(); >-} >- > WebFrame* WebProcess::webFrame(uint64_t frameID) const > { > return m_frameMap.get(frameID); >diff --git a/Source/WebKit/WebProcess/WebProcess.h b/Source/WebKit/WebProcess/WebProcess.h >index 4d1131a5f7c85197fe54a4fd72ed8fe1e4e45d76..9928225fb2d6d898037cf76e97fe611faee86fdc 100644 >--- a/Source/WebKit/WebProcess/WebProcess.h >+++ b/Source/WebKit/WebProcess/WebProcess.h >@@ -365,7 +365,6 @@ private: > friend class WebConnectionToUIProcess; > void didReceiveMessage(IPC::Connection&, IPC::Decoder&) override; > void didReceiveSyncMessage(IPC::Connection&, IPC::Decoder&, std::unique_ptr<IPC::Encoder>&) override; >- void didClose(IPC::Connection&) override; > > // Implemented in generated WebProcessMessageReceiver.cpp > void didReceiveWebProcessMessage(IPC::Connection&, IPC::Decoder&);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 177972
:
322923
|
339484
| 339506