Changeset 275861 in webkit
- Timestamp:
- Apr 12, 2021, 9:57:38 PM (6 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 9 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/ipc/analytics-logger-crash-expected.txt (added)
-
LayoutTests/ipc/analytics-logger-crash.html (added)
-
Source/WebKit/ChangeLog (modified) (1 diff)
-
Source/WebKit/NetworkProcess/NetworkSession.cpp (modified) (1 diff)
-
Source/WebKit/UIProcess/ProvisionalPageProxy.cpp (modified) (4 diffs)
-
Source/WebKit/UIProcess/ProvisionalPageProxy.h (modified) (1 diff)
-
Source/WebKit/UIProcess/WebPageProxy.cpp (modified) (6 diffs)
-
Source/WebKit/UIProcess/WebPageProxy.h (modified) (1 diff)
-
Source/WebKit/UIProcess/WebPageProxy.messages.in (modified) (1 diff)
-
Source/WebKit/WebProcess/WebCoreSupport/WebDiagnosticLoggingClient.cpp (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r275855 r275861 1 2021-04-12 Julian Gonzalez <julian_a_gonzalez@apple.com> 2 3 [CoreIPC] Crash in logDiagnosticMessage code 4 https://bugs.webkit.org/show_bug.cgi?id=224390 5 6 Reviewed by Chris Dumez. 7 8 Add a test for this crasher. 9 10 * ipc/analytics-logger-crash-expected.txt: Added. 11 * ipc/analytics-logger-crash.html: Added. 12 1 13 2021-04-12 Commit Queue <commit-queue@webkit.org> 2 14 -
trunk/Source/WebKit/ChangeLog
r275847 r275861 1 2021-04-12 Julian Gonzalez <julian_a_gonzalez@apple.com> 2 3 [CoreIPC] Crash in logDiagnosticMessage code 4 https://bugs.webkit.org/show_bug.cgi?id=224390 5 6 Reviewed by Chris Dumez. 7 8 Create new WebPageProxy::logDiagnosticMessage APIs designed to be called on messages that 9 need sanity checking, and hook that up to IPC handlers (while leaving existing APIs 10 for all other callers). 11 12 Test: ipc/analytics-logger-crash.html 13 14 * NetworkProcess/NetworkSession.cpp: 15 (WebKit::NetworkSession::logDiagnosticMessageWithValue): 16 * UIProcess/ProvisionalPageProxy.cpp: 17 (WebKit::ProvisionalPageProxy::logDiagnosticMessageFromWebProcess): 18 (WebKit::ProvisionalPageProxy::logDiagnosticMessageWithEnhancedPrivacyFromWebProcess): 19 (WebKit::ProvisionalPageProxy::logDiagnosticMessageWithValueDictionaryFromWebProcess): 20 (WebKit::ProvisionalPageProxy::didReceiveMessage): 21 * UIProcess/ProvisionalPageProxy.h: 22 * UIProcess/WebPageProxy.cpp: 23 (WebKit::WebPageProxy::logDiagnosticMessageFromWebProcess): 24 (WebKit::WebPageProxy::logDiagnosticMessageWithResultFromWebProcess): 25 (WebKit::WebPageProxy::logDiagnosticMessageWithValueFromWebProcess): 26 (WebKit::WebPageProxy::logDiagnosticMessageWithEnhancedPrivacyFromWebProcess): 27 (WebKit::WebPageProxy::logDiagnosticMessageWithValueDictionaryFromWebProcess): 28 (WebKit::WebPageProxy::logDiagnosticMessageWithDomainFromWebProcess): 29 * UIProcess/WebPageProxy.h: 30 * UIProcess/WebPageProxy.messages.in: 31 * WebProcess/WebCoreSupport/WebDiagnosticLoggingClient.cpp: 32 (WebKit::WebDiagnosticLoggingClient::logDiagnosticMessage): 33 (WebKit::WebDiagnosticLoggingClient::logDiagnosticMessageWithResult): 34 (WebKit::WebDiagnosticLoggingClient::logDiagnosticMessageWithValue): 35 (WebKit::WebDiagnosticLoggingClient::logDiagnosticMessageWithEnhancedPrivacy): 36 (WebKit::WebDiagnosticLoggingClient::logDiagnosticMessageWithValueDictionary): 37 (WebKit::WebDiagnosticLoggingClient::logDiagnosticMessageWithDomain): 38 1 39 2021-04-12 Jiewen Tan <jiewen_tan@apple.com> 2 40 -
trunk/Source/WebKit/NetworkProcess/NetworkSession.cpp
r275260 r275861 222 222 void NetworkSession::logDiagnosticMessageWithValue(const String& message, const String& description, unsigned value, unsigned significantFigures, WebCore::ShouldSample shouldSample) 223 223 { 224 m_networkProcess->parentProcessConnection()->send(Messages::WebPageProxy::LogDiagnosticMessageWithValue (message, description, value, significantFigures, shouldSample), 0);224 m_networkProcess->parentProcessConnection()->send(Messages::WebPageProxy::LogDiagnosticMessageWithValueFromWebProcess(message, description, value, significantFigures, shouldSample), 0); 225 225 } 226 226 -
trunk/Source/WebKit/UIProcess/ProvisionalPageProxy.cpp
r275768 r275861 50 50 #include <WebCore/ShouldTreatAsContinuingLoad.h> 51 51 52 #define MESSAGE_CHECK(process, assertion) MESSAGE_CHECK_BASE(assertion, process->connection()) 53 52 54 namespace WebKit { 53 55 … … 375 377 } 376 378 379 void ProvisionalPageProxy::logDiagnosticMessageFromWebProcess(const String& message, const String& description, WebCore::ShouldSample shouldSample) 380 { 381 MESSAGE_CHECK(m_process, message.isAllASCII()); 382 383 m_page.logDiagnosticMessage(message, description, shouldSample); 384 } 385 386 void ProvisionalPageProxy::logDiagnosticMessageWithEnhancedPrivacyFromWebProcess(const String& message, const String& description, WebCore::ShouldSample shouldSample) 387 { 388 MESSAGE_CHECK(m_process, message.isAllASCII()); 389 390 m_page.logDiagnosticMessageWithEnhancedPrivacy(message, description, shouldSample); 391 } 392 393 void ProvisionalPageProxy::logDiagnosticMessageWithValueDictionaryFromWebProcess(const String& message, const String& description, const WebCore::DiagnosticLoggingClient::ValueDictionary& valueDictionary, WebCore::ShouldSample shouldSample) 394 { 395 MESSAGE_CHECK(m_process, message.isAllASCII()); 396 397 m_page.logDiagnosticMessageWithValueDictionary(message, description, valueDictionary, shouldSample); 398 } 399 377 400 #if USE(QUICK_LOOK) 378 401 void ProvisionalPageProxy::requestPasswordForQuickLookDocumentInMainFrame(const String& fileName, CompletionHandler<void(const String&)>&& completionHandler) … … 426 449 || decoder.messageName() == Messages::WebPageProxy::DidFinishProgress::name() 427 450 || decoder.messageName() == Messages::WebPageProxy::BackForwardAddItem::name() 428 || decoder.messageName() == Messages::WebPageProxy::LogDiagnosticMessage::name()429 || decoder.messageName() == Messages::WebPageProxy::LogDiagnosticMessageWithEnhancedPrivacy::name()430 || decoder.messageName() == Messages::WebPageProxy::LogDiagnosticMessageWithValueDictionary::name()431 451 || decoder.messageName() == Messages::WebPageProxy::SetNetworkRequestsInProgress::name() 432 452 || decoder.messageName() == Messages::WebPageProxy::WillGoToBackForwardListItem::name() … … 451 471 #endif 452 472 473 if (decoder.messageName() == Messages::WebPageProxy::LogDiagnosticMessageFromWebProcess::name()) { 474 IPC::handleMessage<Messages::WebPageProxy::LogDiagnosticMessageFromWebProcess>(decoder, this, &ProvisionalPageProxy::logDiagnosticMessageFromWebProcess); 475 return; 476 } 477 478 if (decoder.messageName() == Messages::WebPageProxy::LogDiagnosticMessageWithEnhancedPrivacyFromWebProcess::name()) { 479 IPC::handleMessage<Messages::WebPageProxy::LogDiagnosticMessageWithEnhancedPrivacyFromWebProcess>(decoder, this, &ProvisionalPageProxy::logDiagnosticMessageWithEnhancedPrivacyFromWebProcess); 480 return; 481 } 482 483 if (decoder.messageName() == Messages::WebPageProxy::LogDiagnosticMessageWithValueDictionaryFromWebProcess::name()) { 484 IPC::handleMessage<Messages::WebPageProxy::LogDiagnosticMessageWithValueDictionaryFromWebProcess>(decoder, this, &ProvisionalPageProxy::logDiagnosticMessageWithValueDictionaryFromWebProcess); 485 return; 486 } 487 453 488 if (decoder.messageName() == Messages::WebPageProxy::StartURLSchemeTask::name()) { 454 489 IPC::handleMessage<Messages::WebPageProxy::StartURLSchemeTask>(decoder, this, &ProvisionalPageProxy::startURLSchemeTask); -
trunk/Source/WebKit/UIProcess/ProvisionalPageProxy.h
r275768 r275861 132 132 void didCommitLoadForFrame(WebCore::FrameIdentifier, FrameInfoData&&, WebCore::ResourceRequest&&, uint64_t navigationID, const String& mimeType, bool frameHasCustomContentProvider, WebCore::FrameLoadType, const WebCore::CertificateInfo&, bool usedLegacyTLS, bool containsPluginDocument, Optional<WebCore::HasInsecureContent> forcedHasInsecureContent, WebCore::MouseEventPolicy, const UserData&); 133 133 void didFailProvisionalLoadForFrame(WebCore::FrameIdentifier, FrameInfoData&&, WebCore::ResourceRequest&&, uint64_t navigationID, const String& provisionalURL, const WebCore::ResourceError&, WebCore::WillContinueLoading, const UserData&); 134 void logDiagnosticMessageFromWebProcess(const String& message, const String& description, WebCore::ShouldSample); 135 void logDiagnosticMessageWithEnhancedPrivacyFromWebProcess(const String& message, const String& description, WebCore::ShouldSample); 136 void logDiagnosticMessageWithValueDictionaryFromWebProcess(const String& message, const String& description, const WebCore::DiagnosticLoggingClient::ValueDictionary&, WebCore::ShouldSample); 134 137 void startURLSchemeTask(URLSchemeTaskParameters&&); 135 138 void backForwardGoToItem(const WebCore::BackForwardItemIdentifier&, CompletionHandler<void(const WebBackForwardListCounts&)>&&); -
trunk/Source/WebKit/UIProcess/WebPageProxy.cpp
r275835 r275861 7216 7216 } 7217 7217 7218 void WebPageProxy::logDiagnosticMessageFromWebProcess(const String& message, const String& description, WebCore::ShouldSample shouldSample) 7219 { 7220 MESSAGE_CHECK(m_process, message.isAllASCII()); 7221 7222 logDiagnosticMessage(message, description, shouldSample); 7223 } 7224 7218 7225 void WebPageProxy::logDiagnosticMessageWithResult(const String& message, const String& description, uint32_t result, WebCore::ShouldSample shouldSample) 7219 7226 { … … 7225 7232 } 7226 7233 7234 void WebPageProxy::logDiagnosticMessageWithResultFromWebProcess(const String& message, const String& description, uint32_t result, WebCore::ShouldSample shouldSample) 7235 { 7236 MESSAGE_CHECK(m_process, message.isAllASCII()); 7237 7238 logDiagnosticMessageWithResult(message, description, result, shouldSample); 7239 } 7240 7227 7241 void WebPageProxy::logDiagnosticMessageWithValue(const String& message, const String& description, double value, unsigned significantFigures, ShouldSample shouldSample) 7228 7242 { … … 7234 7248 } 7235 7249 7250 void WebPageProxy::logDiagnosticMessageWithValueFromWebProcess(const String& message, const String& description, double value, unsigned significantFigures, ShouldSample shouldSample) 7251 { 7252 MESSAGE_CHECK(m_process, message.isAllASCII()); 7253 7254 logDiagnosticMessageWithValue(message, description, value, significantFigures, shouldSample); 7255 } 7256 7236 7257 void WebPageProxy::logDiagnosticMessageWithEnhancedPrivacy(const String& message, const String& description, ShouldSample shouldSample) 7237 7258 { … … 7241 7262 7242 7263 effectiveClient->logDiagnosticMessageWithEnhancedPrivacy(this, message, description); 7264 } 7265 7266 void WebPageProxy::logDiagnosticMessageWithEnhancedPrivacyFromWebProcess(const String& message, const String& description, WebCore::ShouldSample shouldSample) 7267 { 7268 MESSAGE_CHECK(m_process, message.isAllASCII()); 7269 7270 logDiagnosticMessageWithEnhancedPrivacy(message, description, shouldSample); 7243 7271 } 7244 7272 … … 7264 7292 } 7265 7293 7294 void WebPageProxy::logDiagnosticMessageWithValueDictionaryFromWebProcess(const String& message, const String& description, const WebCore::DiagnosticLoggingClient::ValueDictionary& valueDictionary, WebCore::ShouldSample shouldSample) 7295 { 7296 MESSAGE_CHECK(m_process, message.isAllASCII()); 7297 7298 logDiagnosticMessageWithValueDictionary(message, description, valueDictionary, shouldSample); 7299 } 7300 7266 7301 void WebPageProxy::logDiagnosticMessageWithDomain(const String& message, WebCore::DiagnosticLoggingDomain domain) 7267 7302 { … … 7271 7306 7272 7307 effectiveClient->logDiagnosticMessageWithDomain(this, message, domain); 7308 } 7309 7310 void WebPageProxy::logDiagnosticMessageWithDomainFromWebProcess(const String& message, WebCore::DiagnosticLoggingDomain domain) 7311 { 7312 MESSAGE_CHECK(m_process, message.isAllASCII()); 7313 7314 logDiagnosticMessageWithDomain(message, domain); 7273 7315 } 7274 7316 -
trunk/Source/WebKit/UIProcess/WebPageProxy.h
r275835 r275861 1534 1534 void logDiagnosticMessageWithDomain(const String& message, WebCore::DiagnosticLoggingDomain); 1535 1535 1536 void logDiagnosticMessageFromWebProcess(const String& message, const String& description, WebCore::ShouldSample); 1537 void logDiagnosticMessageWithResultFromWebProcess(const String& message, const String& description, uint32_t result, WebCore::ShouldSample); 1538 void logDiagnosticMessageWithValueFromWebProcess(const String& message, const String& description, double value, unsigned significantFigures, WebCore::ShouldSample); 1539 void logDiagnosticMessageWithEnhancedPrivacyFromWebProcess(const String& message, const String& description, WebCore::ShouldSample); 1540 void logDiagnosticMessageWithValueDictionaryFromWebProcess(const String& message, const String& description, const WebCore::DiagnosticLoggingClient::ValueDictionary&, WebCore::ShouldSample); 1541 void logDiagnosticMessageWithDomainFromWebProcess(const String& message, WebCore::DiagnosticLoggingDomain); 1542 1536 1543 // Performance logging. 1537 1544 void logScrollingEvent(uint32_t eventType, MonotonicTime, uint64_t); -
trunk/Source/WebKit/UIProcess/WebPageProxy.messages.in
r275768 r275861 207 207 208 208 # Diagnostic messages logging 209 LogDiagnosticMessage (String message, String description, enum:bool WebCore::ShouldSample shouldSample)210 LogDiagnosticMessageWithResult (String message, String description, uint32_t result, enum:bool WebCore::ShouldSample shouldSample)211 LogDiagnosticMessageWithValue (String message, String description, double value, unsigned significantFigures, enum:bool WebCore::ShouldSample shouldSample)212 LogDiagnosticMessageWithEnhancedPrivacy (String message, String description, enum:bool WebCore::ShouldSample shouldSample)213 LogDiagnosticMessageWithValueDictionary (String message, String description, WebCore::DiagnosticLoggingClient::ValueDictionary value, enum:bool WebCore::ShouldSample shouldSample)214 LogDiagnosticMessageWithDomain (String message, WebCore::DiagnosticLoggingDomain domain)209 LogDiagnosticMessageFromWebProcess(String message, String description, enum:bool WebCore::ShouldSample shouldSample) 210 LogDiagnosticMessageWithResultFromWebProcess(String message, String description, uint32_t result, enum:bool WebCore::ShouldSample shouldSample) 211 LogDiagnosticMessageWithValueFromWebProcess(String message, String description, double value, unsigned significantFigures, enum:bool WebCore::ShouldSample shouldSample) 212 LogDiagnosticMessageWithEnhancedPrivacyFromWebProcess(String message, String description, enum:bool WebCore::ShouldSample shouldSample) 213 LogDiagnosticMessageWithValueDictionaryFromWebProcess(String message, String description, WebCore::DiagnosticLoggingClient::ValueDictionary value, enum:bool WebCore::ShouldSample shouldSample) 214 LogDiagnosticMessageWithDomainFromWebProcess(String message, WebCore::DiagnosticLoggingDomain domain) 215 215 216 216 # Performance logging -
trunk/Source/WebKit/WebProcess/WebCoreSupport/WebDiagnosticLoggingClient.cpp
r275103 r275861 51 51 return; 52 52 53 m_page.send(Messages::WebPageProxy::LogDiagnosticMessage (message, description, ShouldSample::No));53 m_page.send(Messages::WebPageProxy::LogDiagnosticMessageFromWebProcess(message, description, ShouldSample::No)); 54 54 } 55 55 … … 61 61 return; 62 62 63 m_page.send(Messages::WebPageProxy::LogDiagnosticMessageWithResult (message, description, result, ShouldSample::No));63 m_page.send(Messages::WebPageProxy::LogDiagnosticMessageWithResultFromWebProcess(message, description, result, ShouldSample::No)); 64 64 } 65 65 … … 71 71 return; 72 72 73 m_page.send(Messages::WebPageProxy::LogDiagnosticMessageWithValue (message, description, value, significantFigures, ShouldSample::No));73 m_page.send(Messages::WebPageProxy::LogDiagnosticMessageWithValueFromWebProcess(message, description, value, significantFigures, ShouldSample::No)); 74 74 } 75 75 … … 81 81 return; 82 82 83 m_page.send(Messages::WebPageProxy::LogDiagnosticMessageWithEnhancedPrivacy (message, description, ShouldSample::No));83 m_page.send(Messages::WebPageProxy::LogDiagnosticMessageWithEnhancedPrivacyFromWebProcess(message, description, ShouldSample::No)); 84 84 } 85 85 … … 91 91 return; 92 92 93 m_page.send(Messages::WebPageProxy::LogDiagnosticMessageWithValueDictionary (message, description, value, ShouldSample::No));93 m_page.send(Messages::WebPageProxy::LogDiagnosticMessageWithValueDictionaryFromWebProcess(message, description, value, ShouldSample::No)); 94 94 } 95 95 … … 98 98 ASSERT(!m_page.corePage() || m_page.corePage()->settings().diagnosticLoggingEnabled()); 99 99 100 m_page.send(Messages::WebPageProxy::LogDiagnosticMessageWithDomain (message, domain));100 m_page.send(Messages::WebPageProxy::LogDiagnosticMessageWithDomainFromWebProcess(message, domain)); 101 101 } 102 102
Note:
See TracChangeset
for help on using the changeset viewer.