[webkit-reviews] review granted: [Bug 46117] Add a way to delay sending replies to sync requests : [Attachment 68129] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Sep 20 14:02:36 PDT 2010


Adam Roben (aroben) <aroben at apple.com> has granted Anders Carlsson
<andersca at apple.com>'s request for review:
Bug 46117: Add a way to delay sending replies to sync requests
https://bugs.webkit.org/show_bug.cgi?id=46117

Attachment 68129: Patch
https://bugs.webkit.org/attachment.cgi?id=68129&action=review

------- Additional Comments from Adam Roben (aroben) <aroben at apple.com>
View in context: https://bugs.webkit.org/attachment.cgi?id=68129&action=review

> WebKit2/Platform/CoreIPC/Connection.cpp:276
> -	       OwnPtr<ArgumentEncoder> replyEncoder(new
ArgumentEncoder(syncRequestID));
> +	       ArgumentEncoder* replyEncoder = new
ArgumentEncoder(syncRequestID);
>	       
>	       // Hand off both the decoder and encoder to the client..
> -	       m_client->didReceiveSyncMessage(this, message.messageID(),
arguments.get(), replyEncoder.get());
> +	       SyncReplyMode syncReplyMode =
m_client->didReceiveSyncMessage(this, message.messageID(), arguments.get(),
replyEncoder);
>	       
>	       // FIXME: If the message was invalid, we should send back a
SyncMessageError.
>	       ASSERT(!arguments->isInvalid());
>  
> -	       // Send the reply.
> -	       sendMessage(MessageID(CoreIPCMessage::SyncMessageReply),
replyEncoder.release());
> +	       if (syncReplyMode == AutomaticReply) {
> +		   // Send the reply.
> +		   sendSyncReply(replyEncoder);
> +	       } else {
> +		   // The client will take ownership of the reply encoder and
send it at some point in the future.
> +		   // We won't do anything here.
> +	       }

Another option is to continue to use OwnPtr, and then call leakPtr in the
ManualReply case. Yet another option is to use a bare pointer, but wrap the
call to new in adoptPtr/leakPtr.


More information about the webkit-reviews mailing list