Title: [136872] branches/safari-536.28-branch/Source/WebKit2
Revision
136872
Author
[email protected]
Date
2012-12-06 12:24:29 -0800 (Thu, 06 Dec 2012)

Log Message

<rdar://problem/12828185> "Invalid message" crash reporter data should also include last sent sync message

Reviewed by Dan Bernstein.

Add a way to get the last sent sync message and pass it along to the invalid message callback.

* Platform/CoreIPC/Connection.cpp:
(CoreIPC::Connection::Connection):
(CoreIPC::Connection::sendSyncMessage):
* Platform/CoreIPC/Connection.h:
(CoreIPC::Connection::lastSentSyncMessageID):
(Connection):
* UIProcess/API/C/WKPagePrivate.h:
* UIProcess/WebProcessProxy.cpp:
(WebKit):
(WebKit::WebProcessProxy::didReceiveInvalidMessage):
(WebKit::WebProcessProxy::setInvalidMessageCallback):
* UIProcess/WebProcessProxy.h:
(WebProcessProxy):

Modified Paths

Diff

Modified: branches/safari-536.28-branch/Source/WebKit2/ChangeLog (136871 => 136872)


--- branches/safari-536.28-branch/Source/WebKit2/ChangeLog	2012-12-06 20:16:22 UTC (rev 136871)
+++ branches/safari-536.28-branch/Source/WebKit2/ChangeLog	2012-12-06 20:24:29 UTC (rev 136872)
@@ -1,3 +1,25 @@
+2012-12-06  Anders Carlsson  <[email protected]>
+
+        <rdar://problem/12828185> "Invalid message" crash reporter data should also include last sent sync message
+
+        Reviewed by Dan Bernstein.
+
+        Add a way to get the last sent sync message and pass it along to the invalid message callback.
+
+        * Platform/CoreIPC/Connection.cpp:
+        (CoreIPC::Connection::Connection):
+        (CoreIPC::Connection::sendSyncMessage):
+        * Platform/CoreIPC/Connection.h:
+        (CoreIPC::Connection::lastSentSyncMessageID):
+        (Connection):
+        * UIProcess/API/C/WKPagePrivate.h:
+        * UIProcess/WebProcessProxy.cpp:
+        (WebKit):
+        (WebKit::WebProcessProxy::didReceiveInvalidMessage):
+        (WebKit::WebProcessProxy::setInvalidMessageCallback):
+        * UIProcess/WebProcessProxy.h:
+        (WebProcessProxy):
+
 2012-11-28  Lucas Forschler  <[email protected]>
 
         Windows build fix.

Modified: branches/safari-536.28-branch/Source/WebKit2/Platform/CoreIPC/Connection.cpp (136871 => 136872)


--- branches/safari-536.28-branch/Source/WebKit2/Platform/CoreIPC/Connection.cpp	2012-12-06 20:16:22 UTC (rev 136871)
+++ branches/safari-536.28-branch/Source/WebKit2/Platform/CoreIPC/Connection.cpp	2012-12-06 20:24:29 UTC (rev 136872)
@@ -195,6 +195,7 @@
     : m_client(client)
     , m_isServer(isServer)
     , m_syncRequestID(0)
+    , m_lastSentSyncMessageID(0)
     , m_onlySendMessagesAsDispatchWhenWaitingForSyncReplyWhenProcessingSuchAMessage(false)
     , m_shouldExitOnSyncMessageSendFailure(false)
     , m_didCloseOnConnectionWorkQueueCallback(0)
@@ -386,6 +387,8 @@
         return nullptr;
     }
 
+    m_lastSentSyncMessageID = messageID.toInt();
+
     // Push the pending sync reply information on our stack.
     {
         MutexLocker locker(m_syncReplyStateMutex);

Modified: branches/safari-536.28-branch/Source/WebKit2/Platform/CoreIPC/Connection.h (136871 => 136872)


--- branches/safari-536.28-branch/Source/WebKit2/Platform/CoreIPC/Connection.h	2012-12-06 20:16:22 UTC (rev 136871)
+++ branches/safari-536.28-branch/Source/WebKit2/Platform/CoreIPC/Connection.h	2012-12-06 20:24:29 UTC (rev 136872)
@@ -169,6 +169,8 @@
     void incrementDispatchMessageMarkedDispatchWhenWaitingForSyncReplyCount() { ++m_inDispatchMessageMarkedDispatchWhenWaitingForSyncReplyCount; }
     void decrementDispatchMessageMarkedDispatchWhenWaitingForSyncReplyCount() { --m_inDispatchMessageMarkedDispatchWhenWaitingForSyncReplyCount; }
 
+    unsigned lastSentSyncMessageID() const { return m_lastSentSyncMessageID; }
+
 private:
     template<typename T> class Message {
     public:
@@ -249,6 +251,7 @@
     Client* m_client;
     bool m_isServer;
     uint64_t m_syncRequestID;
+    unsigned m_lastSentSyncMessageID;
 
     bool m_onlySendMessagesAsDispatchWhenWaitingForSyncReplyWhenProcessingSuchAMessage;
     bool m_shouldExitOnSyncMessageSendFailure;

Modified: branches/safari-536.28-branch/Source/WebKit2/UIProcess/API/C/WKPagePrivate.h (136871 => 136872)


--- branches/safari-536.28-branch/Source/WebKit2/UIProcess/API/C/WKPagePrivate.h	2012-12-06 20:16:22 UTC (rev 136871)
+++ branches/safari-536.28-branch/Source/WebKit2/UIProcess/API/C/WKPagePrivate.h	2012-12-06 20:24:29 UTC (rev 136872)
@@ -92,7 +92,7 @@
 
 WK_EXPORT void WKPageSetMediaVolume(WKPageRef page, float volume);
 
-typedef void (*WKPageInvalidMessageFunction)(uint32_t messageID);
+typedef void (*WKPageInvalidMessageFunction)(uint32_t messageID, uint32_t lastSentSyncMessageID);
 WK_EXPORT void WKPageSetInvalidMessageFunction(WKPageInvalidMessageFunction function);
 
 #ifdef __cplusplus

Modified: branches/safari-536.28-branch/Source/WebKit2/UIProcess/WebProcessProxy.cpp (136871 => 136872)


--- branches/safari-536.28-branch/Source/WebKit2/UIProcess/WebProcessProxy.cpp	2012-12-06 20:16:22 UTC (rev 136871)
+++ branches/safari-536.28-branch/Source/WebKit2/UIProcess/WebProcessProxy.cpp	2012-12-06 20:24:29 UTC (rev 136872)
@@ -374,14 +374,14 @@
         pages[i]->processDidCrash();
 }
 
-void (*s_invalidMessageCallback)(uint32_t messageID);
+void (*s_invalidMessageCallback)(uint32_t messageID, uint32_t lastSentSyncMessageID);
 
-void WebProcessProxy::didReceiveInvalidMessage(CoreIPC::Connection*, CoreIPC::MessageID messageID)
+void WebProcessProxy::didReceiveInvalidMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID)
 {
     WTFLogAlways("Received an invalid message from the web process with message ID %x\n", messageID.toInt());
 
     if (s_invalidMessageCallback)
-        s_invalidMessageCallback(messageID.toInt());
+        s_invalidMessageCallback(messageID.toInt(), connection->lastSentSyncMessageID());
 
     // Terminate the WebProcesses.
     terminate();
@@ -507,7 +507,7 @@
     send(Messages::WebProcess::SetTextCheckerState(TextChecker::state()), 0);
 }
 
-void WebProcessProxy::setInvalidMessageCallback(void (*invalidMessageCallback)(uint32_t))
+void WebProcessProxy::setInvalidMessageCallback(void (*invalidMessageCallback)(uint32_t, uint32_t))
 {
     s_invalidMessageCallback = invalidMessageCallback;
 }

Modified: branches/safari-536.28-branch/Source/WebKit2/UIProcess/WebProcessProxy.h (136871 => 136872)


--- branches/safari-536.28-branch/Source/WebKit2/UIProcess/WebProcessProxy.h	2012-12-06 20:16:22 UTC (rev 136871)
+++ branches/safari-536.28-branch/Source/WebKit2/UIProcess/WebProcessProxy.h	2012-12-06 20:24:29 UTC (rev 136872)
@@ -116,7 +116,7 @@
     // FIXME: This variant of send is deprecated. All clients should move to an overload that take a message type.
     template<typename E, typename T> bool deprecatedSend(E messageID, uint64_t destinationID, const T& arguments);
 
-    static void setInvalidMessageCallback(void (*)(uint32_t));
+    static void setInvalidMessageCallback(void (*)(uint32_t, uint32_t));
 
 private:
     explicit WebProcessProxy(PassRefPtr<WebContext>);
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to