Diff
Modified: trunk/Source/WebKit/ChangeLog (278771 => 278772)
--- trunk/Source/WebKit/ChangeLog 2021-06-11 18:37:27 UTC (rev 278771)
+++ trunk/Source/WebKit/ChangeLog 2021-06-11 18:41:03 UTC (rev 278772)
@@ -1,3 +1,33 @@
+2021-06-11 Chris Dumez <cdu...@apple.com>
+
+ Enable WebProcess' release logging in ephemeral sessions
+ https://bugs.webkit.org/show_bug.cgi?id=226927
+
+ Reviewed by Geoffrey Garen.
+
+ Enable WebProcess' release logging in ephemeral sessions, to faciliate debugging.
+
+ * WebProcess/WebProcess.cpp:
+ (WebKit::WebProcess::initializeWebProcess):
+ (WebKit::WebProcess::networkProcessConnectionClosed):
+ (WebKit::WebProcess::prepareToSuspend):
+ (WebKit::WebProcess::markAllLayersVolatile):
+ (WebKit::WebProcess::cancelMarkAllLayersVolatile):
+ (WebKit::WebProcess::freezeAllLayerTrees):
+ (WebKit::WebProcess::unfreezeAllLayerTrees):
+ (WebKit::WebProcess::processDidResume):
+ (WebKit::WebProcess::grantUserMediaDeviceSandboxExtensions):
+ (WebKit::WebProcess::revokeUserMediaDeviceSandboxExtensions):
+ * WebProcess/WebProcess.h:
+ (WebKit::WebProcess::isAlwaysOnLoggingAllowed): Deleted.
+ * WebProcess/cocoa/WebProcessCocoa.mm:
+ (WebKit::WebProcess::updateProcessName):
+ (WebKit::WebProcess::updateActivePages):
+ (WebKit::WebProcess::updateCPUMonitorState):
+ (WebKit::WebProcess::destroyRenderingResources):
+ (WebKit::WebProcess::updateFreezerStatus):
+ (WebKit::WebProcess::consumeAudioComponentRegistrations):
+
2021-06-11 Megan Gardner <megan_gard...@apple.com>
Rename AppHighlight group to QuickNote to correctly reflect feature.
Modified: trunk/Source/WebKit/WebProcess/WebProcess.cpp (278771 => 278772)
--- trunk/Source/WebKit/WebProcess/WebProcess.cpp 2021-06-11 18:37:27 UTC (rev 278771)
+++ trunk/Source/WebKit/WebProcess/WebProcess.cpp 2021-06-11 18:41:03 UTC (rev 278772)
@@ -216,14 +216,14 @@
#include <WebCore/VP9UtilitiesCocoa.h>
#endif
-#undef RELEASE_LOG_IF_ALLOWED
+#undef WEBPROCESS_RELEASE_LOG
#define RELEASE_LOG_SESSION_ID (m_sessionID ? m_sessionID->toUInt64() : 0)
#if RELEASE_LOG_DISABLED
-#define RELEASE_LOG_IF_ALLOWED(channel, fmt, ...) UNUSED_VARIABLE(this)
-#define RELEASE_LOG_ERROR_IF_ALLOWED(channel, fmt, ...) UNUSED_VARIABLE(this)
+#define WEBPROCESS_RELEASE_LOG(channel, fmt, ...) UNUSED_VARIABLE(this)
+#define WEBPROCESS_RELEASE_LOG_ERROR(channel, fmt, ...) UNUSED_VARIABLE(this)
#else
-#define RELEASE_LOG_IF_ALLOWED(channel, fmt, ...) RELEASE_LOG_IF(isAlwaysOnLoggingAllowed(), channel, "%p - [sessionID=%" PRIu64 "] WebProcess::" fmt, this, RELEASE_LOG_SESSION_ID, ##__VA_ARGS__)
-#define RELEASE_LOG_ERROR_IF_ALLOWED(channel, fmt, ...) RELEASE_LOG_ERROR_IF(isAlwaysOnLoggingAllowed(), channel, "%p - [sessionID=%" PRIu64 "] WebProcess::" fmt, this, RELEASE_LOG_SESSION_ID, ##__VA_ARGS__)
+#define WEBPROCESS_RELEASE_LOG(channel, fmt, ...) RELEASE_LOG(channel, "%p - [sessionID=%" PRIu64 "] WebProcess::" fmt, this, RELEASE_LOG_SESSION_ID, ##__VA_ARGS__)
+#define WEBPROCESS_RELEASE_LOG_ERROR(channel, fmt, ...) RELEASE_LOG_ERROR(channel, "%p - [sessionID=%" PRIu64 "] WebProcess::" fmt, this, RELEASE_LOG_SESSION_ID, ##__VA_ARGS__)
#endif
// This should be less than plugInAutoStartExpirationTimeThreshold in PlugInAutoStartProvider.
@@ -404,11 +404,11 @@
// If this is a process we keep around for performance, kill it on memory pressure instead of trying to free up its memory.
if (m_processType == ProcessType::CachedWebContent || m_processType == ProcessType::PrewarmedWebContent || areAllPagesSuspended()) {
if (m_processType == ProcessType::CachedWebContent)
- RELEASE_LOG_IF_ALLOWED(Process, "initializeWebProcess: Cached WebProcess is exiting due to memory pressure");
+ WEBPROCESS_RELEASE_LOG(Process, "initializeWebProcess: Cached WebProcess is exiting due to memory pressure");
else if (m_processType == ProcessType::PrewarmedWebContent)
- RELEASE_LOG_IF_ALLOWED(Process, "initializeWebProcess: Prewarmed WebProcess is exiting due to memory pressure");
+ WEBPROCESS_RELEASE_LOG(Process, "initializeWebProcess: Prewarmed WebProcess is exiting due to memory pressure");
else
- RELEASE_LOG_IF_ALLOWED(Process, "initializeWebProcess: Suspended WebProcess is exiting due to memory pressure");
+ WEBPROCESS_RELEASE_LOG(Process, "initializeWebProcess: Suspended WebProcess is exiting due to memory pressure");
stopRunLoop();
return;
}
@@ -549,7 +549,7 @@
prewarmGlobally();
#endif
- RELEASE_LOG_IF_ALLOWED(Process, "initializeWebProcess: Presenting processPID=%d", WebCore::presentingApplicationPID());
+ WEBPROCESS_RELEASE_LOG(Process, "initializeWebProcess: Presenting processPID=%d", WebCore::presentingApplicationPID());
}
void WebProcess::setWebsiteDataStoreParameters(WebProcessDataStoreParameters&& parameters)
@@ -1145,9 +1145,9 @@
void WebProcess::networkProcessConnectionClosed(NetworkProcessConnection* connection)
{
#if OS(DARWIN)
- RELEASE_LOG_IF_ALLOWED(Loading, "networkProcessConnectionClosed: NetworkProcess (%d) closed its connection (Crashed)", connection ? connection->connection().remoteProcessID() : 0);
+ WEBPROCESS_RELEASE_LOG(Loading, "networkProcessConnectionClosed: NetworkProcess (%d) closed its connection (Crashed)", connection ? connection->connection().remoteProcessID() : 0);
#else
- RELEASE_LOG_IF_ALLOWED(Loading, "networkProcessConnectionClosed: NetworkProcess closed its connection (Crashed)");
+ WEBPROCESS_RELEASE_LOG(Loading, "networkProcessConnectionClosed: NetworkProcess closed its connection (Crashed)");
#endif
ASSERT(m_networkProcessConnection);
@@ -1469,7 +1469,7 @@
void WebProcess::prepareToSuspend(bool isSuspensionImminent, CompletionHandler<void()>&& completionHandler)
{
- RELEASE_LOG_IF_ALLOWED(ProcessSuspension, "prepareToSuspend: isSuspensionImminent=%d", isSuspensionImminent);
+ WEBPROCESS_RELEASE_LOG(ProcessSuspension, "prepareToSuspend: isSuspensionImminent=%d", isSuspensionImminent);
SetForScope<bool> suspensionScope(m_isSuspending, true);
m_processIsSuspended = true;
@@ -1477,7 +1477,7 @@
#if PLATFORM(COCOA)
if (m_processType == ProcessType::PrewarmedWebContent) {
- RELEASE_LOG_IF_ALLOWED(ProcessSuspension, "prepareToSuspend: Process is ready to suspend");
+ WEBPROCESS_RELEASE_LOG(ProcessSuspension, "prepareToSuspend: Process is ready to suspend");
return completionHandler();
}
#endif
@@ -1510,7 +1510,7 @@
#endif
markAllLayersVolatile([this, completionHandler = WTFMove(completionHandler)]() mutable {
- RELEASE_LOG_IF_ALLOWED(ProcessSuspension, "prepareToSuspend: Process is ready to suspend");
+ WEBPROCESS_RELEASE_LOG(ProcessSuspension, "prepareToSuspend: Process is ready to suspend");
completionHandler();
});
}
@@ -1517,14 +1517,14 @@
void WebProcess::markAllLayersVolatile(CompletionHandler<void()>&& completionHandler)
{
- RELEASE_LOG_IF_ALLOWED(ProcessSuspension, "markAllLayersVolatile:");
+ WEBPROCESS_RELEASE_LOG(ProcessSuspension, "markAllLayersVolatile:");
auto callbackAggregator = CallbackAggregator::create(WTFMove(completionHandler));
for (auto& page : m_pageMap.values()) {
page->markLayersVolatile([this, callbackAggregator, pageID = page->identifier()] (bool succeeded) {
if (succeeded)
- RELEASE_LOG_IF_ALLOWED(ProcessSuspension, "markAllLayersVolatile: Successfuly marked layers as volatile for webPageID=%" PRIu64, pageID.toUInt64());
+ WEBPROCESS_RELEASE_LOG(ProcessSuspension, "markAllLayersVolatile: Successfuly marked layers as volatile for webPageID=%" PRIu64, pageID.toUInt64());
else
- RELEASE_LOG_ERROR_IF_ALLOWED(ProcessSuspension, "markAllLayersVolatile: Failed to mark layers as volatile for webPageID=%" PRIu64, pageID.toUInt64());
+ WEBPROCESS_RELEASE_LOG_ERROR(ProcessSuspension, "markAllLayersVolatile: Failed to mark layers as volatile for webPageID=%" PRIu64, pageID.toUInt64());
});
}
}
@@ -1531,7 +1531,7 @@
void WebProcess::cancelMarkAllLayersVolatile()
{
- RELEASE_LOG_IF_ALLOWED(ProcessSuspension, "cancelMarkAllLayersVolatile:");
+ WEBPROCESS_RELEASE_LOG(ProcessSuspension, "cancelMarkAllLayersVolatile:");
for (auto& page : m_pageMap.values())
page->cancelMarkLayersVolatile();
}
@@ -1538,7 +1538,7 @@
void WebProcess::freezeAllLayerTrees()
{
- RELEASE_LOG_IF_ALLOWED(ProcessSuspension, "freezeAllLayerTrees: WebProcess is freezing all layer trees");
+ WEBPROCESS_RELEASE_LOG(ProcessSuspension, "freezeAllLayerTrees: WebProcess is freezing all layer trees");
for (auto& page : m_pageMap.values())
page->freezeLayerTree(WebPage::LayerTreeFreezeReason::ProcessSuspended);
}
@@ -1545,7 +1545,7 @@
void WebProcess::unfreezeAllLayerTrees()
{
- RELEASE_LOG_IF_ALLOWED(ProcessSuspension, "unfreezeAllLayerTrees: WebProcess is unfreezing all layer trees");
+ WEBPROCESS_RELEASE_LOG(ProcessSuspension, "unfreezeAllLayerTrees: WebProcess is unfreezing all layer trees");
for (auto& page : m_pageMap.values())
page->unfreezeLayerTree(WebPage::LayerTreeFreezeReason::ProcessSuspended);
}
@@ -1552,7 +1552,7 @@
void WebProcess::processDidResume()
{
- RELEASE_LOG_IF_ALLOWED(ProcessSuspension, "processDidResume:");
+ WEBPROCESS_RELEASE_LOG(ProcessSuspension, "processDidResume:");
m_processIsSuspended = false;
@@ -1920,7 +1920,7 @@
for (size_t i = 0; i < extensions.size(); i++) {
const auto& extension = extensions[i];
extension.second->consume();
- RELEASE_LOG_IF_ALLOWED(WebRTC, "grantUserMediaDeviceSandboxExtensions: granted extension %s", extension.first.utf8().data());
+ WEBPROCESS_RELEASE_LOG(WebRTC, "grantUserMediaDeviceSandboxExtensions: granted extension %s", extension.first.utf8().data());
m_mediaCaptureSandboxExtensions.add(extension.first, extension.second.copyRef());
}
}
@@ -1951,7 +1951,7 @@
ASSERT(extension || MockRealtimeMediaSourceCenter::mockRealtimeMediaSourceCenterEnabled());
if (extension) {
extension->revoke();
- RELEASE_LOG_IF_ALLOWED(WebRTC, "revokeUserMediaDeviceSandboxExtensions: revoked extension %s", extensionID.utf8().data());
+ WEBPROCESS_RELEASE_LOG(WebRTC, "revokeUserMediaDeviceSandboxExtensions: revoked extension %s", extensionID.utf8().data());
}
}
}
@@ -2166,5 +2166,5 @@
} // namespace WebKit
#undef RELEASE_LOG_SESSION_ID
-#undef RELEASE_LOG_IF_ALLOWED
-#undef RELEASE_LOG_ERROR_IF_ALLOWED
+#undef WEBPROCESS_RELEASE_LOG
+#undef WEBPROCESS_RELEASE_LOG_ERROR
Modified: trunk/Source/WebKit/WebProcess/WebProcess.h (278771 => 278772)
--- trunk/Source/WebKit/WebProcess/WebProcess.h 2021-06-11 18:37:27 UTC (rev 278771)
+++ trunk/Source/WebKit/WebProcess/WebProcess.h 2021-06-11 18:41:03 UTC (rev 278772)
@@ -600,8 +600,6 @@
void setUseSystemAppearanceForScrollbars(bool);
#endif
- bool isAlwaysOnLoggingAllowed() { return m_sessionID ? m_sessionID->isAlwaysOnLoggingAllowed() : true; }
-
RefPtr<WebConnectionToUIProcess> m_webConnection;
HashMap<WebCore::PageIdentifier, RefPtr<WebPage>> m_pageMap;
Modified: trunk/Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm (278771 => 278772)
--- trunk/Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm 2021-06-11 18:37:27 UTC (rev 278771)
+++ trunk/Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm 2021-06-11 18:41:03 UTC (rev 278772)
@@ -167,8 +167,8 @@
SOFT_LINK_CLASS(CoreServices, _LSDOpenService)
#define RELEASE_LOG_SESSION_ID (m_sessionID ? m_sessionID->toUInt64() : 0)
-#define RELEASE_LOG_IF_ALLOWED(channel, fmt, ...) RELEASE_LOG_IF(isAlwaysOnLoggingAllowed(), channel, "%p - [sessionID=%" PRIu64 "] WebProcess::" fmt, this, RELEASE_LOG_SESSION_ID, ##__VA_ARGS__)
-#define RELEASE_LOG_ERROR_IF_ALLOWED(channel, fmt, ...) RELEASE_LOG_ERROR_IF(isAlwaysOnLoggingAllowed(), channel, "%p - [sessionID=%" PRIu64 "] WebProcess::" fmt, this, RELEASE_LOG_SESSION_ID, ##__VA_ARGS__)
+#define WEBPROCESS_RELEASE_LOG(channel, fmt, ...) RELEASE_LOG(channel, "%p - [sessionID=%" PRIu64 "] WebProcess::" fmt, this, RELEASE_LOG_SESSION_ID, ##__VA_ARGS__)
+#define WEBPROCESS_RELEASE_LOG_ERROR(channel, fmt, ...) RELEASE_LOG_ERROR(channel, "%p - [sessionID=%" PRIu64 "] WebProcess::" fmt, this, RELEASE_LOG_SESSION_ID, ##__VA_ARGS__)
#if PLATFORM(MAC)
SOFT_LINK_FRAMEWORK_IN_UMBRELLA(ApplicationServices, HIServices)
@@ -508,7 +508,7 @@
mach_msg_type_number_t info_size = TASK_AUDIT_TOKEN_COUNT;
kern_return_t kr = task_info(mach_task_self(), TASK_AUDIT_TOKEN, reinterpret_cast<integer_t *>(&auditToken), &info_size);
if (kr != KERN_SUCCESS) {
- RELEASE_LOG_ERROR_IF_ALLOWED(Process, "updateProcessName: Unable to get audit token for self. Error: %{public}s (%x)", mach_error_string(kr), kr);
+ WEBPROCESS_RELEASE_LOG_ERROR(Process, "updateProcessName: Unable to get audit token for self. Error: %{public}s (%x)", mach_error_string(kr), kr);
return;
}
String displayName = applicationName.get();
@@ -521,7 +521,7 @@
auto error = _LSSetApplicationInformationItem(kLSDefaultSessionID, _LSGetCurrentApplicationASN(), _kLSDisplayNameKey, (CFStringRef)applicationName.get(), nullptr);
ASSERT(!error);
if (error) {
- RELEASE_LOG_ERROR_IF_ALLOWED(Process, "updateProcessName: Failed to set the display name of the WebContent process, error code=%ld", static_cast<long>(error));
+ WEBPROCESS_RELEASE_LOG_ERROR(Process, "updateProcessName: Failed to set the display name of the WebContent process, error code=%ld", static_cast<long>(error));
return;
}
#if ASSERT_ENABLED
@@ -787,7 +787,7 @@
mach_msg_type_number_t info_size = TASK_AUDIT_TOKEN_COUNT;
kern_return_t kr = task_info(mach_task_self(), TASK_AUDIT_TOKEN, reinterpret_cast<integer_t *>(&auditToken), &info_size);
if (kr != KERN_SUCCESS) {
- RELEASE_LOG_ERROR_IF_ALLOWED(Process, "updateActivePages: Unable to get audit token for self. Error: %{public}s (%x)", mach_error_string(kr), kr);
+ WEBPROCESS_RELEASE_LOG_ERROR(Process, "updateActivePages: Unable to get audit token for self. Error: %{public}s (%x)", mach_error_string(kr), kr);
return;
}
@@ -854,9 +854,9 @@
if (!m_cpuMonitor) {
m_cpuMonitor = makeUnique<CPUMonitor>(cpuMonitoringInterval, [this](double cpuUsage) {
if (m_processType == ProcessType::ServiceWorker)
- RELEASE_LOG_ERROR_IF_ALLOWED(ProcessSuspension, "updateCPUMonitorState: Service worker process exceeded CPU limit of %.1f%% (was using %.1f%%)", m_cpuLimit.value() * 100, cpuUsage * 100);
+ WEBPROCESS_RELEASE_LOG_ERROR(ProcessSuspension, "updateCPUMonitorState: Service worker process exceeded CPU limit of %.1f%% (was using %.1f%%)", m_cpuLimit.value() * 100, cpuUsage * 100);
else
- RELEASE_LOG_ERROR_IF_ALLOWED(ProcessSuspension, "updateCPUMonitorState: WebProcess exceeded CPU limit of %.1f%% (was using %.1f%%) hasVisiblePages? %d", m_cpuLimit.value() * 100, cpuUsage * 100, hasVisibleWebPage());
+ WEBPROCESS_RELEASE_LOG_ERROR(ProcessSuspension, "updateCPUMonitorState: WebProcess exceeded CPU limit of %.1f%% (was using %.1f%%) hasVisiblePages? %d", m_cpuLimit.value() * 100, cpuUsage * 100, hasVisibleWebPage());
parentProcessConnection()->send(Messages::WebProcessProxy::DidExceedCPULimit(), 0);
});
} else if (reason == CPUMonitorUpdateReason::VisibilityHasChanged) {
@@ -952,7 +952,7 @@
#if !RELEASE_LOG_DISABLED
MonotonicTime endTime = MonotonicTime::now();
#endif
- RELEASE_LOG_IF_ALLOWED(ProcessSuspension, "destroyRenderingResources: took %.2fms", (endTime - startTime).milliseconds());
+ WEBPROCESS_RELEASE_LOG(ProcessSuspension, "destroyRenderingResources: took %.2fms", (endTime - startTime).milliseconds());
}
#if PLATFORM(IOS_FAMILY)
@@ -992,9 +992,9 @@
bool isFreezable = shouldFreezeOnSuspension();
auto result = memorystatus_control(MEMORYSTATUS_CMD_SET_PROCESS_IS_FREEZABLE, getpid(), isFreezable ? 1 : 0, nullptr, 0);
if (result)
- RELEASE_LOG_ERROR_IF_ALLOWED(ProcessSuspension, "updateFreezerStatus: isFreezable=%d, error=%d", isFreezable, result);
+ WEBPROCESS_RELEASE_LOG_ERROR(ProcessSuspension, "updateFreezerStatus: isFreezable=%d, error=%d", isFreezable, result);
else
- RELEASE_LOG_IF_ALLOWED(ProcessSuspension, "updateFreezerStatus: isFreezable=%d, success", isFreezable);
+ WEBPROCESS_RELEASE_LOG(ProcessSuspension, "updateFreezerStatus: isFreezable=%d, success", isFreezable);
}
#endif
@@ -1339,11 +1339,11 @@
auto err = AudioComponentApplyServerRegistrations(registrations.get());
if (noErr != err)
- RELEASE_LOG_ERROR_IF_ALLOWED(Process, "Could not apply AudioComponent registrations, err(%ld)", static_cast<long>(err));
+ WEBPROCESS_RELEASE_LOG_ERROR(Process, "Could not apply AudioComponent registrations, err(%ld)", static_cast<long>(err));
}
} // namespace WebKit
#undef RELEASE_LOG_SESSION_ID
-#undef RELEASE_LOG_IF_ALLOWED
-#undef RELEASE_LOG_ERROR_IF_ALLOWED
+#undef WEBPROCESS_RELEASE_LOG
+#undef WEBPROCESS_RELEASE_LOG_ERROR