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

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

Issue 2096643002: Eliminate MojoApplicationHost (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@mah3
Patch Set: . Created 4 years, 6 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 18 matching lines...) Expand all
72 const base::Callback<void(mojo::ScopedMessagePipeHandle)>& binder) { 74 const base::Callback<void(mojo::ScopedMessagePipeHandle)>& binder) {
73 binders_[name] = binder; 75 binders_[name] = binder;
74 } 76 }
75 void ClearBinders(); 77 void ClearBinders();
76 78
77 using BinderMap = std::map< 79 using BinderMap = std::map<
78 std::string, base::Callback<void(mojo::ScopedMessagePipeHandle)>>; 80 std::string, base::Callback<void(mojo::ScopedMessagePipeHandle)>>;
79 BinderMap binders_; 81 BinderMap binders_;
80 82
81 mojom::InterfaceProviderPtr interface_provider_; 83 mojom::InterfaceProviderPtr interface_provider_;
84 mojom::InterfaceProviderRequest pending_request_;
82 85
83 base::WeakPtrFactory<InterfaceProvider> weak_factory_; 86 base::WeakPtrFactory<InterfaceProvider> weak_factory_;
84 87
85 DISALLOW_COPY_AND_ASSIGN(InterfaceProvider); 88 DISALLOW_COPY_AND_ASSIGN(InterfaceProvider);
86 }; 89 };
87 90
88 } // namespace shell 91 } // namespace shell
89 92
90 #endif // SERVICES_SHELL_PUBLIC_CPP_INTERFACE_PROVIDER_H_ 93 #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