• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2017 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 MOJO_CORE_CONNECTION_PARAMS_H_
6 #define MOJO_CORE_CONNECTION_PARAMS_H_
7 
8 #include "base/macros.h"
9 #include "build/build_config.h"
10 #include "mojo/core/system_impl_export.h"
11 #include "mojo/public/cpp/platform/platform_channel_endpoint.h"
12 #include "mojo/public/cpp/platform/platform_channel_server_endpoint.h"
13 
14 namespace mojo {
15 namespace core {
16 
17 // A set of parameters used when establishing a connection to another process.
18 class MOJO_SYSTEM_IMPL_EXPORT ConnectionParams {
19  public:
20   ConnectionParams();
21   explicit ConnectionParams(PlatformChannelEndpoint endpoint);
22   explicit ConnectionParams(PlatformChannelServerEndpoint server_endpoint);
23   ConnectionParams(ConnectionParams&&);
24   ~ConnectionParams();
25 
26   ConnectionParams& operator=(ConnectionParams&&);
27 
endpoint()28   const PlatformChannelEndpoint& endpoint() const { return endpoint_; }
server_endpoint()29   const PlatformChannelServerEndpoint& server_endpoint() const {
30     return server_endpoint_;
31   }
32 
TakeEndpoint()33   PlatformChannelEndpoint TakeEndpoint() { return std::move(endpoint_); }
34 
TakeServerEndpoint()35   PlatformChannelServerEndpoint TakeServerEndpoint() {
36     return std::move(server_endpoint_);
37   }
38 
39  private:
40   PlatformChannelEndpoint endpoint_;
41   PlatformChannelServerEndpoint server_endpoint_;
42 
43   DISALLOW_COPY_AND_ASSIGN(ConnectionParams);
44 };
45 
46 }  // namespace core
47 }  // namespace mojo
48 
49 #endif  // MOJO_CORE_CONNECTION_PARAMS_H_
50