OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 COMPONENTS_RESOURCE_PROVIDER_RESOURCE_PROVIDER_APP_H_ | 5 #ifndef COMPONENTS_RESOURCE_PROVIDER_RESOURCE_PROVIDER_APP_H_ |
6 #define COMPONENTS_RESOURCE_PROVIDER_RESOURCE_PROVIDER_APP_H_ | 6 #define COMPONENTS_RESOURCE_PROVIDER_RESOURCE_PROVIDER_APP_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 | 9 |
10 #include "components/resource_provider/public/interfaces/resource_provider.mojom
.h" | 10 #include "components/resource_provider/public/interfaces/resource_provider.mojom
.h" |
11 #include "mojo/application/public/cpp/application_delegate.h" | 11 #include "mojo/application/public/cpp/application_delegate.h" |
12 #include "mojo/application/public/cpp/interface_factory.h" | 12 #include "mojo/application/public/cpp/interface_factory.h" |
13 #include "mojo/common/weak_binding_set.h" | 13 #include "mojo/common/weak_binding_set.h" |
14 #include "mojo/public/cpp/bindings/binding.h" | 14 #include "mojo/public/cpp/bindings/binding.h" |
| 15 #include "mojo/services/tracing/public/cpp/tracing_impl.h" |
15 | 16 |
16 namespace mojo { | 17 namespace mojo { |
17 class ApplicationImpl; | 18 class ApplicationImpl; |
18 } | 19 } |
19 | 20 |
20 namespace resource_provider { | 21 namespace resource_provider { |
21 | 22 |
22 class ResourceProviderApp : public mojo::ApplicationDelegate, | 23 class ResourceProviderApp : public mojo::ApplicationDelegate, |
23 public mojo::InterfaceFactory<ResourceProvider> { | 24 public mojo::InterfaceFactory<ResourceProvider> { |
24 public: | 25 public: |
25 explicit ResourceProviderApp(const std::string& resource_provider_app_url); | 26 explicit ResourceProviderApp(const std::string& resource_provider_app_url); |
26 ~ResourceProviderApp() override; | 27 ~ResourceProviderApp() override; |
27 | 28 |
28 private: | 29 private: |
29 // ApplicationDelegate: | 30 // ApplicationDelegate: |
30 void Initialize(mojo::ApplicationImpl* app) override; | 31 void Initialize(mojo::ApplicationImpl* app) override; |
31 bool ConfigureIncomingConnection( | 32 bool ConfigureIncomingConnection( |
32 mojo::ApplicationConnection* connection) override; | 33 mojo::ApplicationConnection* connection) override; |
33 | 34 |
34 // mojo::InterfaceFactory<ResourceProvider>: | 35 // mojo::InterfaceFactory<ResourceProvider>: |
35 void Create(mojo::ApplicationConnection* connection, | 36 void Create(mojo::ApplicationConnection* connection, |
36 mojo::InterfaceRequest<ResourceProvider> request) override; | 37 mojo::InterfaceRequest<ResourceProvider> request) override; |
37 | 38 |
| 39 mojo::TracingImpl tracing_; |
| 40 |
38 mojo::WeakBindingSet<ResourceProvider> bindings_; | 41 mojo::WeakBindingSet<ResourceProvider> bindings_; |
39 | 42 |
40 // The name of the app that the resource provider code lives in. When using | 43 // The name of the app that the resource provider code lives in. When using |
41 // core services, it'll be the url of that. Otherwise it'll just be | 44 // core services, it'll be the url of that. Otherwise it'll just be |
42 // mojo:resource_provider. | 45 // mojo:resource_provider. |
43 std::string resource_provider_app_url_; | 46 std::string resource_provider_app_url_; |
44 | 47 |
45 DISALLOW_COPY_AND_ASSIGN(ResourceProviderApp); | 48 DISALLOW_COPY_AND_ASSIGN(ResourceProviderApp); |
46 }; | 49 }; |
47 | 50 |
48 } // namespace resource_provider | 51 } // namespace resource_provider |
49 | 52 |
50 #endif // COMPONENTS_RESOURCE_PROVIDER_RESOURCE_PROVIDER_APP_H_ | 53 #endif // COMPONENTS_RESOURCE_PROVIDER_RESOURCE_PROVIDER_APP_H_ |
OLD | NEW |