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

Side by Side Diff: content/public/common/service_manager_connection.h

Issue 2695803004: Make browser process a singleton service (Closed)
Patch Set: . Created 3 years, 10 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
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_PUBLIC_COMMON_SERVICE_MANAGER_CONNECTION_H_ 5 #ifndef CONTENT_PUBLIC_COMMON_SERVICE_MANAGER_CONNECTION_H_
6 #define CONTENT_PUBLIC_COMMON_SERVICE_MANAGER_CONNECTION_H_ 6 #define CONTENT_PUBLIC_COMMON_SERVICE_MANAGER_CONNECTION_H_
7 7
8 #include <memory> 8 #include <memory>
9 9
10 #include "base/callback_forward.h" 10 #include "base/callback_forward.h"
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 // that no incoming connections are accepted until Start() is called. 70 // that no incoming connections are accepted until Start() is called.
71 static std::unique_ptr<ServiceManagerConnection> Create( 71 static std::unique_ptr<ServiceManagerConnection> Create(
72 service_manager::mojom::ServiceRequest request, 72 service_manager::mojom::ServiceRequest request,
73 scoped_refptr<base::SequencedTaskRunner> io_task_runner); 73 scoped_refptr<base::SequencedTaskRunner> io_task_runner);
74 74
75 // Begins accepting incoming connections. Connection filters MUST be added 75 // Begins accepting incoming connections. Connection filters MUST be added
76 // before calling this in order to avoid races. See AddConnectionFilter() 76 // before calling this in order to avoid races. See AddConnectionFilter()
77 // below. 77 // below.
78 virtual void Start() = 0; 78 virtual void Start() = 0;
79 79
80 // Sets a closure to be invoked once the connection receives an Initialize()
81 // request from the shell.
82 virtual void SetInitializeHandler(const base::Closure& handler) = 0;
83
84 // Returns the service_manager::Connector received via this connection's 80 // Returns the service_manager::Connector received via this connection's
85 // Service 81 // Service
86 // implementation. Use this to initiate connections as this object's Identity. 82 // implementation. Use this to initiate connections as this object's Identity.
87 virtual service_manager::Connector* GetConnector() = 0; 83 virtual service_manager::Connector* GetConnector() = 0;
88 84
89 // Returns this connection's identity with the Service Manager. Connections 85 // Returns this connection's identity with the Service Manager. Connections
90 // initiated via the service_manager::Connector returned by GetConnector() 86 // initiated via the service_manager::Connector returned by GetConnector()
91 // will use 87 // will use
92 // this. 88 // this.
93 virtual const service_manager::Identity& GetIdentity() const = 0; 89 virtual const service_manager::Identity& GetIdentity() const = 0;
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 // Registers a callback to be run when the service_manager::Service 147 // Registers a callback to be run when the service_manager::Service
152 // implementation on the IO thread receives OnConnect(). Returns an id that 148 // implementation on the IO thread receives OnConnect(). Returns an id that
153 // can be passed to RemoveOnConnectHandler(), starting at 1. 149 // can be passed to RemoveOnConnectHandler(), starting at 1.
154 virtual int AddOnConnectHandler(const OnConnectHandler& handler) = 0; 150 virtual int AddOnConnectHandler(const OnConnectHandler& handler) = 0;
155 virtual void RemoveOnConnectHandler(int id) = 0; 151 virtual void RemoveOnConnectHandler(int id) = 0;
156 }; 152 };
157 153
158 } // namespace content 154 } // namespace content
159 155
160 #endif // CONTENT_PUBLIC_COMMON_SERVICE_MANAGER_CONNECTION_H_ 156 #endif // CONTENT_PUBLIC_COMMON_SERVICE_MANAGER_CONNECTION_H_
OLDNEW
« no previous file with comments | « content/public/app/mojo/content_packaged_services_manifest.json ('k') | content/public/common/service_names.mojom » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698