ExtensionInstallDialogView: fix scrolling behavior on Views (Win,Linux)
[chromium-blink-merge.git] / ipc / brokerable_attachment.h
blob624ff13619e6ee58765281829687878e15fb3b4a
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 #ifndef IPC_BROKERABLE_ATTACHMENT_H_
6 #define IPC_BROKERABLE_ATTACHMENT_H_
8 #include <stdint.h>
10 #include "base/macros.h"
11 #include "ipc/ipc_export.h"
12 #include "ipc/ipc_message_attachment.h"
14 namespace IPC {
16 // This subclass of MessageAttachment requires an AttachmentBroker to be
17 // attached to a Chrome IPC message.
18 class IPC_EXPORT BrokerableAttachment : public MessageAttachment {
19 public:
20 static const size_t kNonceSize = 16;
21 // An id uniquely identifies an attachment sent via a broker.
22 struct IPC_EXPORT AttachmentId {
23 uint8_t nonce[kNonceSize];
26 enum BrokerableType {
27 WIN_HANDLE,
30 // The identifier is unique across all Chrome processes.
31 AttachmentId GetIdentifier() const;
33 // Returns TYPE_BROKERABLE_ATTACHMENT
34 Type GetType() const override;
36 virtual BrokerableType GetBrokerableType() const = 0;
38 protected:
39 BrokerableAttachment();
40 explicit BrokerableAttachment(const AttachmentId& id);
41 ~BrokerableAttachment() override;
43 private:
44 // This member uniquely identifies a BrokerableAttachment across all Chrome
45 // processes.
46 const AttachmentId id_;
47 DISALLOW_COPY_AND_ASSIGN(BrokerableAttachment);
50 } // namespace IPC
52 #endif // IPC_BROKERABLE_ATTACHMENT_H_