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

Side by Side Diff: services/shell/public/cpp/interface_provider.h

Issue 2090773003: Add ability to bind a different InterfaceRegistry/InterfaceProvider to an incoming Connection. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 5 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 | « services/shell/public/cpp/connector.h ('k') | services/shell/public/cpp/lib/connection_impl.h » ('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 SERVICES_SHELL_PUBLIC_CPP_INTERFACE_PROVIDER_H_ 5 #ifndef SERVICES_SHELL_PUBLIC_CPP_INTERFACE_PROVIDER_H_
6 #define SERVICES_SHELL_PUBLIC_CPP_INTERFACE_PROVIDER_H_ 6 #define SERVICES_SHELL_PUBLIC_CPP_INTERFACE_PROVIDER_H_
7 7
8 #include "services/shell/public/interfaces/interface_provider.mojom.h" 8 #include "services/shell/public/interfaces/interface_provider.mojom.h"
9 9
10 namespace shell { 10 namespace shell {
(...skipping 20 matching lines...) Expand all
31 31
32 void ClearBinders() { 32 void ClearBinders() {
33 provider_->ClearBinders(); 33 provider_->ClearBinders();
34 } 34 }
35 35
36 private: 36 private:
37 InterfaceProvider* provider_; 37 InterfaceProvider* provider_;
38 DISALLOW_COPY_AND_ASSIGN(TestApi); 38 DISALLOW_COPY_AND_ASSIGN(TestApi);
39 }; 39 };
40 40
41 explicit InterfaceProvider(mojom::InterfaceProviderPtr interface_provider); 41 InterfaceProvider();
42 ~InterfaceProvider(); 42 ~InterfaceProvider();
43 43
44 void Bind(mojom::InterfaceProviderPtr interface_provider);
45
44 // Returns a raw pointer to the remote InterfaceProvider. 46 // Returns a raw pointer to the remote InterfaceProvider.
45 mojom::InterfaceProvider* get() { return interface_provider_.get(); } 47 mojom::InterfaceProvider* get() { return interface_provider_.get(); }
46 48
47 // Sets a closure to be run when the remote InterfaceProvider pipe is closed. 49 // Sets a closure to be run when the remote InterfaceProvider pipe is closed.
48 void SetConnectionLostClosure(const base::Closure& connection_lost_closure); 50 void SetConnectionLostClosure(const base::Closure& connection_lost_closure);
49 51
50 base::WeakPtr<InterfaceProvider> GetWeakPtr(); 52 base::WeakPtr<InterfaceProvider> GetWeakPtr();
51 53
52 // Binds |ptr| to an implementation of Interface in the remote application. 54 // Binds |ptr| to an implementation of Interface in the remote application.
53 // |ptr| can immediately be used to start sending requests to the remote 55 // |ptr| can immediately be used to start sending requests to the remote
(...skipping 27 matching lines...) Expand all
81 mojom::InterfaceProviderPtr interface_provider_; 83 mojom::InterfaceProviderPtr interface_provider_;
82 84
83 base::WeakPtrFactory<InterfaceProvider> weak_factory_; 85 base::WeakPtrFactory<InterfaceProvider> weak_factory_;
84 86
85 DISALLOW_COPY_AND_ASSIGN(InterfaceProvider); 87 DISALLOW_COPY_AND_ASSIGN(InterfaceProvider);
86 }; 88 };
87 89
88 } // namespace shell 90 } // namespace shell
89 91
90 #endif // SERVICES_SHELL_PUBLIC_CPP_INTERFACE_PROVIDER_H_ 92 #endif // SERVICES_SHELL_PUBLIC_CPP_INTERFACE_PROVIDER_H_
OLDNEW
« no previous file with comments | « services/shell/public/cpp/connector.h ('k') | services/shell/public/cpp/lib/connection_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698