1 // Copyright 2018 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 
5 #ifndef CHROMEOS_SERVICES_SECURE_CHANNEL_SECURE_CHANNEL_BASE_H_
6 #define CHROMEOS_SERVICES_SECURE_CHANNEL_SECURE_CHANNEL_BASE_H_
7 
8 #include "base/macros.h"
9 #include "chromeos/services/secure_channel/public/mojom/secure_channel.mojom.h"
10 #include "mojo/public/cpp/bindings/pending_receiver.h"
11 #include "mojo/public/cpp/bindings/receiver_set.h"
12 
13 namespace chromeos {
14 
15 namespace secure_channel {
16 
17 // Base SecureChannel implementation.
18 class SecureChannelBase : public mojom::SecureChannel {
19  public:
20   ~SecureChannelBase() override;
21 
22   // Binds a receiver to this implementation. Should be called each time that
23   // the service receives a receiver.
24   void BindReceiver(mojo::PendingReceiver<mojom::SecureChannel> receiver);
25 
26  protected:
27   SecureChannelBase();
28 
29  private:
30   mojo::ReceiverSet<mojom::SecureChannel> receivers_;
31 
32   DISALLOW_COPY_AND_ASSIGN(SecureChannelBase);
33 };
34 
35 }  // namespace secure_channel
36 
37 }  // namespace chromeos
38 
39 #endif  // CHROMEOS_SERVICES_SECURE_CHANNEL_SECURE_CHANNEL_BASE_H_
40