| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CONTENT_BROWSER_MOJO_MOJO_CHILD_CONNECTION_H_ | 5 #ifndef CONTENT_COMMON_MOJO_MOJO_CHILD_CONNECTION_H_ |
| 6 #define CONTENT_BROWSER_MOJO_MOJO_CHILD_CONNECTION_H_ | 6 #define CONTENT_COMMON_MOJO_MOJO_CHILD_CONNECTION_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "base/macros.h" | 11 #include "base/macros.h" |
| 12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
| 13 #include "base/memory/weak_ptr.h" | 13 #include "base/memory/weak_ptr.h" |
| 14 #include "base/process/process_handle.h" | 14 #include "base/process/process_handle.h" |
| 15 #include "base/sequenced_task_runner.h" | 15 #include "base/sequenced_task_runner.h" |
| 16 #include "content/common/content_export.h" |
| 16 #include "services/shell/public/cpp/identity.h" | 17 #include "services/shell/public/cpp/identity.h" |
| 17 #include "services/shell/public/cpp/interface_provider.h" | 18 #include "services/shell/public/cpp/interface_provider.h" |
| 18 #include "services/shell/public/interfaces/connector.mojom.h" | 19 #include "services/shell/public/interfaces/connector.mojom.h" |
| 19 | 20 |
| 20 namespace shell { | 21 namespace shell { |
| 21 class Connection; | 22 class Connection; |
| 22 class Connector; | 23 class Connector; |
| 23 } | 24 } |
| 24 | 25 |
| 25 namespace content { | 26 namespace content { |
| 26 | 27 |
| 27 // Helper class to establish a connection between the shell and a single child | 28 // Helper class to establish a connection between the shell and a single child |
| 28 // process. Process hosts can use this when launching new processes which | 29 // process. Process hosts can use this when launching new processes which |
| 29 // should be registered with the shell. | 30 // should be registered with the shell. |
| 30 class MojoChildConnection { | 31 class CONTENT_EXPORT MojoChildConnection { |
| 31 public: | 32 public: |
| 32 // Prepares a new child connection for a child process which will be | 33 // Prepares a new child connection for a child process which will be |
| 33 // identified to the shell as |application_name|. |instance_id| must be | 34 // identified to the shell as |application_name|. |instance_id| must be |
| 34 // unique among all child connections using the same |application_name|. | 35 // unique among all child connections using the same |application_name|. |
| 35 // |connector| is the connector to use to establish the connection. | 36 // |connector| is the connector to use to establish the connection. |
| 36 MojoChildConnection(const std::string& application_name, | 37 MojoChildConnection(const std::string& application_name, |
| 37 const std::string& instance_id, | 38 const std::string& instance_id, |
| 38 const std::string& child_token, | 39 const std::string& child_token, |
| 39 shell::Connector* connector, | 40 shell::Connector* connector, |
| 40 scoped_refptr<base::SequencedTaskRunner> io_task_runner); | 41 scoped_refptr<base::SequencedTaskRunner> io_task_runner); |
| (...skipping 26 matching lines...) Expand all Loading... |
| 67 | 68 |
| 68 shell::InterfaceProvider remote_interfaces_; | 69 shell::InterfaceProvider remote_interfaces_; |
| 69 | 70 |
| 70 base::WeakPtrFactory<MojoChildConnection> weak_factory_; | 71 base::WeakPtrFactory<MojoChildConnection> weak_factory_; |
| 71 | 72 |
| 72 DISALLOW_COPY_AND_ASSIGN(MojoChildConnection); | 73 DISALLOW_COPY_AND_ASSIGN(MojoChildConnection); |
| 73 }; | 74 }; |
| 74 | 75 |
| 75 } // namespace content | 76 } // namespace content |
| 76 | 77 |
| 77 #endif // CONTENT_BROWSER_MOJO_MOJO_CHILD_CONNECTION_H_ | 78 #endif // CONTENT_COMMON_MOJO_MOJO_CHILD_CONNECTION_H_ |
| OLD | NEW |