ipc_security_test_util.cc 847 B

12345678910111213141516171819202122232425
  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
  3. // found in the LICENSE file.
  4. #include "ipc/ipc_security_test_util.h"
  5. #include "base/bind.h"
  6. #include "base/callback_helpers.h"
  7. #include "base/run_loop.h"
  8. #include "ipc/ipc_channel_proxy.h"
  9. namespace IPC {
  10. void IpcSecurityTestUtil::PwnMessageReceived(ChannelProxy* channel,
  11. const IPC::Message& message) {
  12. base::RunLoop run_loop;
  13. base::OnceClosure inject_message = base::BindOnce(
  14. base::IgnoreResult(&IPC::ChannelProxy::Context::OnMessageReceived),
  15. channel->context(), message);
  16. channel->context()->ipc_task_runner()->PostTaskAndReply(
  17. FROM_HERE, std::move(inject_message), run_loop.QuitClosure());
  18. run_loop.Run();
  19. }
  20. } // namespace IPC