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

Unified Diff: ipc/attachment_broker_unprivileged_win.cc

Issue 2473993003: Delete IPC::ChannelPosix, IPC::ChannelWin and IPC::AttachmentBroker. (Closed)
Patch Set: Created 4 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
« no previous file with comments | « ipc/attachment_broker_unprivileged_win.h ('k') | ipc/brokerable_attachment.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ipc/attachment_broker_unprivileged_win.cc
diff --git a/ipc/attachment_broker_unprivileged_win.cc b/ipc/attachment_broker_unprivileged_win.cc
deleted file mode 100644
index 9e01d89fec1b7b019d1d0151e4986e63a8c66693..0000000000000000000000000000000000000000
--- a/ipc/attachment_broker_unprivileged_win.cc
+++ /dev/null
@@ -1,66 +0,0 @@
-// Copyright 2015 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/attachment_broker_unprivileged_win.h"
-
-#include "base/process/process.h"
-#include "ipc/attachment_broker_messages.h"
-#include "ipc/brokerable_attachment.h"
-#include "ipc/handle_attachment_win.h"
-#include "ipc/ipc_sender.h"
-
-namespace IPC {
-
-AttachmentBrokerUnprivilegedWin::AttachmentBrokerUnprivilegedWin() {}
-
-AttachmentBrokerUnprivilegedWin::~AttachmentBrokerUnprivilegedWin() {}
-
-bool AttachmentBrokerUnprivilegedWin::SendAttachmentToProcess(
- const scoped_refptr<BrokerableAttachment>& attachment,
- base::ProcessId destination_process) {
- switch (attachment->GetBrokerableType()) {
- case BrokerableAttachment::WIN_HANDLE: {
- internal::HandleAttachmentWin* handle_attachment =
- static_cast<internal::HandleAttachmentWin*>(attachment.get());
- internal::HandleAttachmentWin::WireFormat format =
- handle_attachment->GetWireFormat(destination_process);
- bool success = get_sender()->Send(
- new AttachmentBrokerMsg_DuplicateWinHandle(format));
- if (success)
- handle_attachment->reset_handle_ownership();
- return success;
- }
- case BrokerableAttachment::MACH_PORT:
- case BrokerableAttachment::PLACEHOLDER:
- NOTREACHED();
- return false;
- }
- return false;
-}
-
-bool AttachmentBrokerUnprivilegedWin::OnMessageReceived(const Message& msg) {
- bool handled = true;
- IPC_BEGIN_MESSAGE_MAP(AttachmentBrokerUnprivilegedWin, msg)
- IPC_MESSAGE_HANDLER(AttachmentBrokerMsg_WinHandleHasBeenDuplicated,
- OnWinHandleHasBeenDuplicated)
- IPC_MESSAGE_UNHANDLED(handled = false)
- IPC_END_MESSAGE_MAP()
- return handled;
-}
-
-void AttachmentBrokerUnprivilegedWin::OnWinHandleHasBeenDuplicated(
- const IPC::internal::HandleAttachmentWin::WireFormat& wire_format) {
- // The IPC message was intended for a different process. Ignore it.
- if (wire_format.destination_process != base::Process::Current().Pid()) {
- LogError(WRONG_DESTINATION);
- return;
- }
-
- scoped_refptr<BrokerableAttachment> attachment(
- new IPC::internal::HandleAttachmentWin(wire_format));
- HandleReceivedAttachment(attachment);
- LogError(SUCCESS);
-}
-
-} // namespace IPC
« no previous file with comments | « ipc/attachment_broker_unprivileged_win.h ('k') | ipc/brokerable_attachment.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698