Title: [167390] trunk/Source/WebKit2
Revision
167390
Author
simon.fra...@apple.com
Date
2014-04-16 15:04:17 -0700 (Wed, 16 Apr 2014)

Log Message

Failing to decode a layer tree commit message resulted in silent and mysterious failure
https://bugs.webkit.org/show_bug.cgi?id=131766
<rdar://problem/16520894>

Reviewed by Sam Weinig.

If the message decode failed, we should have already marked the message as invalid.
Failing to do so indicates in a decode code coding error.

* Platform/IPC/HandleMessage.h:
(IPC::handleMessage):
(IPC::handleMessageVariadic):
(IPC::handleMessageDelayed):

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (167389 => 167390)


--- trunk/Source/WebKit2/ChangeLog	2014-04-16 21:58:23 UTC (rev 167389)
+++ trunk/Source/WebKit2/ChangeLog	2014-04-16 22:04:17 UTC (rev 167390)
@@ -1,3 +1,19 @@
+2014-04-16  Simon Fraser  <simon.fra...@apple.com>
+
+        Failing to decode a layer tree commit message resulted in silent and mysterious failure
+        https://bugs.webkit.org/show_bug.cgi?id=131766
+        <rdar://problem/16520894>
+
+        Reviewed by Sam Weinig.
+        
+        If the message decode failed, we should have already marked the message as invalid.
+        Failing to do so indicates in a decode code coding error.
+
+        * Platform/IPC/HandleMessage.h:
+        (IPC::handleMessage):
+        (IPC::handleMessageVariadic):
+        (IPC::handleMessageDelayed):
+
 2014-04-16  Tim Horton  <timothy_hor...@apple.com>
 
         Minor include sanity in WebPage.h

Modified: trunk/Source/WebKit2/Platform/IPC/HandleMessage.h (167389 => 167390)


--- trunk/Source/WebKit2/Platform/IPC/HandleMessage.h	2014-04-16 21:58:23 UTC (rev 167389)
+++ trunk/Source/WebKit2/Platform/IPC/HandleMessage.h	2014-04-16 22:04:17 UTC (rev 167390)
@@ -112,8 +112,11 @@
 void handleMessage(MessageDecoder& decoder, C* object, MF function)
 {
     typename T::DecodeType arguments;
-    if (!decoder.decode(arguments))
+    if (!decoder.decode(arguments)) {
+        ASSERT(decoder.isInvalid());
         return;
+    }
+
     callMemberFunction(std::move(arguments), object, function);
 }
 
@@ -121,8 +124,10 @@
 void handleMessage(MessageDecoder& decoder, MessageEncoder& replyEncoder, C* object, MF function)
 {
     typename T::DecodeType arguments;
-    if (!decoder.decode(arguments))
+    if (!decoder.decode(arguments)) {
+        ASSERT(decoder.isInvalid());
         return;
+    }
 
     typename T::Reply::ValueType replyArguments;
     callMemberFunction(std::move(arguments), replyArguments, object, function);
@@ -133,8 +138,10 @@
 void handleMessage(Connection* connection, MessageDecoder& decoder, MessageEncoder& replyEncoder, C* object, MF function)
 {
     typename T::DecodeType arguments;
-    if (!decoder.decode(arguments))
+    if (!decoder.decode(arguments)) {
+        ASSERT(decoder.isInvalid());
         return;
+    }
 
     typename T::Reply::ValueType replyArguments;
     callMemberFunction(connection, std::move(arguments), replyArguments, object, function);
@@ -145,8 +152,10 @@
 void handleMessage(Connection* connection, MessageDecoder& decoder, C* object, MF function)
 {
     typename T::DecodeType arguments;
-    if (!decoder.decode(arguments))
+    if (!decoder.decode(arguments)) {
+        ASSERT(decoder.isInvalid());
         return;
+    }
     callMemberFunction(connection, std::move(arguments), object, function);
 }
 
@@ -154,8 +163,10 @@
 void handleMessageVariadic(MessageDecoder& decoder, C* object, MF function)
 {
     typename T::DecodeType arguments;
-    if (!decoder.decode(arguments))
+    if (!decoder.decode(arguments)) {
+        ASSERT(decoder.isInvalid());
         return;
+    }
     callMemberFunction(std::move(arguments), decoder, object, function);
 }
 
@@ -163,8 +174,10 @@
 void handleMessageVariadic(MessageDecoder& decoder, MessageEncoder& replyEncoder, C* object, MF function)
 {
     typename T::DecodeType arguments;
-    if (!decoder.decode(arguments))
+    if (!decoder.decode(arguments)) {
+        ASSERT(decoder.isInvalid());
         return;
+    }
 
     typename T::Reply::ValueType replyArguments;
     callMemberFunction(std::move(arguments), decoder, replyArguments, object, function);
@@ -175,8 +188,10 @@
 void handleMessageDelayed(Connection* connection, MessageDecoder& decoder, std::unique_ptr<MessageEncoder>& replyEncoder, C* object, MF function)
 {
     typename T::DecodeType arguments;
-    if (!decoder.decode(arguments))
+    if (!decoder.decode(arguments)) {
+        ASSERT(decoder.isInvalid());
         return;
+    }
 
     RefPtr<typename T::DelayedReply> delayedReply = adoptRef(new typename T::DelayedReply(connection, std::move(replyEncoder)));
     callMemberFunction(std::move(arguments), delayedReply.release(), object, function);
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to