Add menu trimming experiment.
[chromium-blink-merge.git] / ipc / handle_attachment_win.cc
blobdfce7c232e60087d8ee92a6523c8c50001bb9867
1 // Copyright 2015 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.
5 #include "ipc/handle_attachment_win.h"
7 #include <windows.h>
9 namespace IPC {
10 namespace internal {
12 HandleAttachmentWin::HandleAttachmentWin(const HANDLE& handle)
13 : handle_(handle) {
16 HandleAttachmentWin::HandleAttachmentWin(const WireFormat& wire_format)
17 : BrokerableAttachment(wire_format.attachment_id),
18 handle_(LongToHandle(wire_format.handle)) {
21 HandleAttachmentWin::~HandleAttachmentWin() {
24 HandleAttachmentWin::BrokerableType HandleAttachmentWin::GetBrokerableType()
25 const {
26 return WIN_HANDLE;
29 HandleAttachmentWin::WireFormat HandleAttachmentWin::GetWireFormat(
30 const base::ProcessId& destination) const {
31 WireFormat format;
32 format.handle = HandleToLong(handle_);
33 format.attachment_id = GetIdentifier();
34 format.destination_process = destination;
35 return format;
38 } // namespace internal
39 } // namespace IPC