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

Unified Diff: ipc/ipc_security_test_util.cc

Issue 712713002: IPC: a way for browsertests to simulate the appearance of a malicious IPC. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@interstitial
Patch Set: Created 6 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: ipc/ipc_security_test_util.cc
diff --git a/ipc/ipc_security_test_util.cc b/ipc/ipc_security_test_util.cc
new file mode 100644
index 0000000000000000000000000000000000000000..4ae5a06096de207d4ad31905090f35b0e869c504
--- /dev/null
+++ b/ipc/ipc_security_test_util.cc
@@ -0,0 +1,25 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "ipc/ipc_security_test_util.h"
+
+#include "base/bind.h"
+#include "base/bind_helpers.h"
+#include "base/run_loop.h"
+#include "ipc/ipc_channel_proxy.h"
+
+namespace IPC {
+
+void IpcSecurityTestUtil::PwnMessageReceived(ChannelProxy* channel,
+ const IPC::Message& message) {
+ base::RunLoop run_loop;
+ base::Closure inject_message = base::Bind(
+ base::IgnoreResult(&IPC::ChannelProxy::Context::OnMessageReceived),
+ channel->context(), message);
+ channel->context()->ipc_task_runner()->PostTaskAndReply(
+ FROM_HERE, inject_message, run_loop.QuitClosure());
+ run_loop.Run();
+}
+
+} // namespace IPC
« content/browser/security_exploit_browsertest.cc ('K') | « ipc/ipc_security_test_util.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698