Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(222)

Side by Side Diff: content/browser/shared_worker/shared_worker_service_impl_unittest.cc

Issue 292443004: Remove IPC_BEGIN_MESSAGE_MAP_EX macro since r270839 made all bad IPCs kill their child processes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <map> 5 #include <map>
6 #include <set> 6 #include <set>
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/atomic_sequence_num.h" 9 #include "base/atomic_sequence_num.h"
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
180 } 180 }
181 181
182 ~MockRendererProcessHost() { 182 ~MockRendererProcessHost() {
183 SharedWorkerServiceImplTest::UnregisterRunningProcessID(process_id_); 183 SharedWorkerServiceImplTest::UnregisterRunningProcessID(process_id_);
184 message_filter_->Close(); 184 message_filter_->Close();
185 worker_filter_->Close(); 185 worker_filter_->Close();
186 } 186 }
187 187
188 bool OnMessageReceived(IPC::Message* message) { 188 bool OnMessageReceived(IPC::Message* message) {
189 scoped_ptr<IPC::Message> msg(message); 189 scoped_ptr<IPC::Message> msg(message);
190 bool message_was_ok = false; 190 const bool ret = message_filter_->OnMessageReceived(*message) ||
191 const bool ret = 191 worker_filter_->OnMessageReceived(*message);
192 message_filter_->OnMessageReceived(*message, &message_was_ok) ||
193 worker_filter_->OnMessageReceived(*message, &message_was_ok);
194 if (message->is_sync()) { 192 if (message->is_sync()) {
195 CHECK(!queued_messages_.empty()); 193 CHECK(!queued_messages_.empty());
196 const IPC::Message* response_msg = queued_messages_.back(); 194 const IPC::Message* response_msg = queued_messages_.back();
197 IPC::SyncMessage* sync_msg = static_cast<IPC::SyncMessage*>(message); 195 IPC::SyncMessage* sync_msg = static_cast<IPC::SyncMessage*>(message);
198 scoped_ptr<IPC::MessageReplyDeserializer> reply_serializer( 196 scoped_ptr<IPC::MessageReplyDeserializer> reply_serializer(
199 sync_msg->GetReplyDeserializer()); 197 sync_msg->GetReplyDeserializer());
200 bool result = reply_serializer->SerializeOutputParameters(*response_msg); 198 bool result = reply_serializer->SerializeOutputParameters(*response_msg);
201 CHECK(result); 199 CHECK(result);
202 queued_messages_.pop_back(); 200 queued_messages_.pop_back();
203 } 201 }
(...skipping 694 matching lines...) Expand 10 before | Expand all | Expand 10 after
898 kDocumentIDs[2], 896 kDocumentIDs[2],
899 kRenderFrameRouteIDs[2]); 897 kRenderFrameRouteIDs[2]);
900 EXPECT_NE(MSG_ROUTING_NONE, connector2->route_id()); 898 EXPECT_NE(MSG_ROUTING_NONE, connector2->route_id());
901 EXPECT_EQ(0U, renderer_host2->QueuedMessageCount()); 899 EXPECT_EQ(0U, renderer_host2->QueuedMessageCount());
902 RunAllPendingInMessageLoop(); 900 RunAllPendingInMessageLoop();
903 EXPECT_EQ(1U, renderer_host2->QueuedMessageCount()); 901 EXPECT_EQ(1U, renderer_host2->QueuedMessageCount());
904 CheckViewMsgWorkerCreated(renderer_host2.get(), connector2.get()); 902 CheckViewMsgWorkerCreated(renderer_host2.get(), connector2.get());
905 } 903 }
906 904
907 } // namespace content 905 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698