Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(72)

Side by Side Diff: content/common/service_manager/child_connection.h

Issue 2420253002: Rename shell namespace to service_manager (Closed)
Patch Set: . Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « content/common/frame.mojom ('k') | content/common/service_manager/child_connection.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_COMMON_SERVICE_MANAGER_CHILD_CONNECTION_H_ 5 #ifndef CONTENT_COMMON_SERVICE_MANAGER_CHILD_CONNECTION_H_
6 #define CONTENT_COMMON_SERVICE_MANAGER_CHILD_CONNECTION_H_ 6 #define CONTENT_COMMON_SERVICE_MANAGER_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 "content/common/content_export.h"
17 #include "services/service_manager/public/cpp/identity.h" 17 #include "services/service_manager/public/cpp/identity.h"
18 #include "services/service_manager/public/cpp/interface_provider.h" 18 #include "services/service_manager/public/cpp/interface_provider.h"
19 #include "services/service_manager/public/interfaces/connector.mojom.h" 19 #include "services/service_manager/public/interfaces/connector.mojom.h"
20 20
21 namespace shell { 21 namespace service_manager {
22 class Connection; 22 class Connection;
23 class Connector; 23 class Connector;
24 } 24 }
25 25
26 namespace content { 26 namespace content {
27 27
28 // 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
29 // process. Process hosts can use this when launching new processes which 29 // process. Process hosts can use this when launching new processes which
30 // should be registered with the service manager. 30 // should be registered with the service manager.
31 class CONTENT_EXPORT ChildConnection { 31 class CONTENT_EXPORT ChildConnection {
32 public: 32 public:
33 // 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
34 // identified to the service manager as |name|. |instance_id| must be unique 34 // identified to the service manager as |name|. |instance_id| must be unique
35 // among all child connections using the same |name|. |connector| is the 35 // among all child connections using the same |name|. |connector| is the
36 // connector to use to establish the connection. 36 // connector to use to establish the connection.
37 ChildConnection(const std::string& name, 37 ChildConnection(const std::string& name,
38 const std::string& instance_id, 38 const std::string& instance_id,
39 const std::string& child_token, 39 const std::string& child_token,
40 shell::Connector* connector, 40 service_manager::Connector* connector,
41 scoped_refptr<base::SequencedTaskRunner> io_task_runner); 41 scoped_refptr<base::SequencedTaskRunner> io_task_runner);
42 ~ChildConnection(); 42 ~ChildConnection();
43 43
44 shell::InterfaceProvider* GetRemoteInterfaces() { 44 service_manager::InterfaceProvider* GetRemoteInterfaces() {
45 return &remote_interfaces_; 45 return &remote_interfaces_;
46 } 46 }
47 47
48 const shell::Identity& child_identity() const { 48 const service_manager::Identity& child_identity() const {
49 return child_identity_; 49 return child_identity_;
50 } 50 }
51 51
52 // A token which must be passed to the child process via 52 // A token which must be passed to the child process via
53 // |switches::kPrimordialPipeToken| in order for the child to initialize its 53 // |switches::kPrimordialPipeToken| in order for the child to initialize its
54 // end of the shell connection pipe. 54 // end of the shell connection pipe.
55 std::string service_token() const { return service_token_; } 55 std::string service_token() const { return service_token_; }
56 56
57 // Sets the child connection's process handle. This should be called as soon 57 // Sets the child connection's process handle. This should be called as soon
58 // as the process has been launched, and the connection will not be fully 58 // as the process has been launched, and the connection will not be fully
59 // functional until this is called. 59 // functional until this is called.
60 void SetProcessHandle(base::ProcessHandle handle); 60 void SetProcessHandle(base::ProcessHandle handle);
61 61
62 private: 62 private:
63 class IOThreadContext; 63 class IOThreadContext;
64 64
65 scoped_refptr<IOThreadContext> context_; 65 scoped_refptr<IOThreadContext> context_;
66 shell::Identity child_identity_; 66 service_manager::Identity child_identity_;
67 const std::string service_token_; 67 const std::string service_token_;
68 68
69 shell::InterfaceProvider remote_interfaces_; 69 service_manager::InterfaceProvider remote_interfaces_;
70 70
71 base::WeakPtrFactory<ChildConnection> weak_factory_; 71 base::WeakPtrFactory<ChildConnection> weak_factory_;
72 72
73 DISALLOW_COPY_AND_ASSIGN(ChildConnection); 73 DISALLOW_COPY_AND_ASSIGN(ChildConnection);
74 }; 74 };
75 75
76 } // namespace content 76 } // namespace content
77 77
78 #endif // CONTENT_COMMON_SERVICE_MANAGER_CHILD_CONNECTION_H_ 78 #endif // CONTENT_COMMON_SERVICE_MANAGER_CHILD_CONNECTION_H_
OLDNEW
« no previous file with comments | « content/common/frame.mojom ('k') | content/common/service_manager/child_connection.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698