forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbrokerable_attachment.h
54 lines (40 loc) · 1.26 KB
/
brokerable_attachment.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
// 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.
#ifndef IPC_BROKERABLE_ATTACHMENT_H_
#define IPC_BROKERABLE_ATTACHMENT_H_
#include <stddef.h>
#include <stdint.h>
#include <algorithm>
#include "base/macros.h"
#include "build/build_config.h"
#include "ipc/ipc_export.h"
#include "ipc/ipc_message_attachment.h"
namespace IPC {
// This subclass of MessageAttachment requires an AttachmentBroker to be
// attached to a Chrome IPC message.
class IPC_EXPORT BrokerableAttachment : public MessageAttachment {
public:
enum BrokerableType {
PLACEHOLDER,
WIN_HANDLE,
MACH_PORT,
};
// Whether the attachment still needs information from the broker before it
// can be used.
bool NeedsBrokering() const;
// Returns TYPE_BROKERABLE_ATTACHMENT
Type GetType() const override;
virtual BrokerableType GetBrokerableType() const = 0;
// MessageAttachment override.
#if defined(OS_POSIX)
base::PlatformFile TakePlatformFile() override;
#endif // OS_POSIX
protected:
BrokerableAttachment();
~BrokerableAttachment() override;
private:
DISALLOW_COPY_AND_ASSIGN(BrokerableAttachment);
};
} // namespace IPC
#endif // IPC_BROKERABLE_ATTACHMENT_H_