diff options
Diffstat (limited to 'chrome/renderer')
-rw-r--r-- | chrome/renderer/mock_render_thread.cc | 11 | ||||
-rw-r--r-- | chrome/renderer/mock_render_thread.h | 2 |
2 files changed, 7 insertions, 6 deletions
diff --git a/chrome/renderer/mock_render_thread.cc b/chrome/renderer/mock_render_thread.cc index 050774e..0f9db0d 100644 --- a/chrome/renderer/mock_render_thread.cc +++ b/chrome/renderer/mock_render_thread.cc @@ -43,15 +43,16 @@ bool MockRenderThread::Send(IPC::Message* msg) { // through this function messages, messages with reply and reply messages. // We can only handle one synchronous message at a time. if (msg->is_reply()) { - if (reply_deserializer_) { + if (reply_deserializer_.get()) { reply_deserializer_->SerializeOutputParameters(*msg); - delete reply_deserializer_; - reply_deserializer_ = NULL; + reply_deserializer_.reset(); } } else { if (msg->is_sync()) { - reply_deserializer_ = - static_cast<IPC::SyncMessage*>(msg)->GetReplyDeserializer(); + // We actually need to handle deleting the reply dersializer for sync + // messages. + reply_deserializer_.reset( + static_cast<IPC::SyncMessage*>(msg)->GetReplyDeserializer()); } OnMessageReceived(*msg); } diff --git a/chrome/renderer/mock_render_thread.h b/chrome/renderer/mock_render_thread.h index 950353a..fc28517 100644 --- a/chrome/renderer/mock_render_thread.h +++ b/chrome/renderer/mock_render_thread.h @@ -108,7 +108,7 @@ class MockRenderThread : public RenderThreadBase { IPC::Channel::Listener* widget_; // The last known good deserializer for sync messages. - IPC::MessageReplyDeserializer* reply_deserializer_; + scoped_ptr<IPC::MessageReplyDeserializer> reply_deserializer_; std::vector<MessagePair> messages_; }; |