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 SERVICES_URL_RESPONSE_DISK_CACHE_URL_RESPONSE_DISK_CACHE_APP_H_ | 5 #ifndef SERVICES_URL_RESPONSE_DISK_CACHE_URL_RESPONSE_DISK_CACHE_APP_H_ |
6 #define SERVICES_URL_RESPONSE_DISK_CACHE_URL_RESPONSE_DISK_CACHE_APP_H_ | 6 #define SERVICES_URL_RESPONSE_DISK_CACHE_URL_RESPONSE_DISK_CACHE_APP_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "base/task_runner.h" | 10 #include "base/task_runner.h" |
11 #include "base/threading/sequenced_worker_pool.h" | 11 #include "base/threading/sequenced_worker_pool.h" |
12 #include "mojo/public/cpp/application/application_connection.h" | 12 #include "mojo/public/cpp/application/application_connection.h" |
13 #include "mojo/public/cpp/application/application_delegate.h" | 13 #include "mojo/public/cpp/application/application_delegate.h" |
14 #include "mojo/public/cpp/application/application_impl.h" | 14 #include "mojo/public/cpp/application/application_impl.h" |
15 #include "mojo/public/cpp/application/interface_factory.h" | |
16 #include "mojo/services/url_response_disk_cache/interfaces/url_response_disk_cac
he.mojom.h" | 15 #include "mojo/services/url_response_disk_cache/interfaces/url_response_disk_cac
he.mojom.h" |
17 #include "services/url_response_disk_cache/url_response_disk_cache_db.h" | 16 #include "services/url_response_disk_cache/url_response_disk_cache_db.h" |
18 #include "services/url_response_disk_cache/url_response_disk_cache_delegate.h" | 17 #include "services/url_response_disk_cache/url_response_disk_cache_delegate.h" |
19 | 18 |
20 namespace mojo { | 19 namespace mojo { |
21 | 20 |
22 class URLResponseDiskCacheApp : public ApplicationDelegate, | 21 class URLResponseDiskCacheApp : public ApplicationDelegate { |
23 public InterfaceFactory<URLResponseDiskCache> { | |
24 public: | 22 public: |
25 explicit URLResponseDiskCacheApp(scoped_refptr<base::TaskRunner> task_runner, | 23 explicit URLResponseDiskCacheApp(scoped_refptr<base::TaskRunner> task_runner, |
26 URLResponseDiskCacheDelegate* delegate); | 24 URLResponseDiskCacheDelegate* delegate); |
27 ~URLResponseDiskCacheApp() override; | 25 ~URLResponseDiskCacheApp() override; |
28 | 26 |
29 private: | 27 private: |
30 // ApplicationDelegate: | 28 // ApplicationDelegate: |
31 void Initialize(ApplicationImpl* app) override; | 29 void Initialize(ApplicationImpl* app) override; |
32 bool ConfigureIncomingConnection(ApplicationConnection* connection) override; | 30 bool ConfigureIncomingConnection(ApplicationConnection* connection) override; |
33 | 31 |
34 // InterfaceFactory<URLResponseDiskCache>: | |
35 void Create(const ConnectionContext& connection_context, | |
36 InterfaceRequest<URLResponseDiskCache> request) override; | |
37 | |
38 scoped_refptr<base::TaskRunner> task_runner_; | 32 scoped_refptr<base::TaskRunner> task_runner_; |
39 scoped_refptr<URLResponseDiskCacheDB> db_; | 33 scoped_refptr<URLResponseDiskCacheDB> db_; |
40 URLResponseDiskCacheDelegate* delegate_; | 34 URLResponseDiskCacheDelegate* delegate_; |
41 | 35 |
42 DISALLOW_COPY_AND_ASSIGN(URLResponseDiskCacheApp); | 36 DISALLOW_COPY_AND_ASSIGN(URLResponseDiskCacheApp); |
43 }; | 37 }; |
44 | 38 |
45 } // namespace mojo | 39 } // namespace mojo |
46 | 40 |
47 #endif // SERVICES_URL_RESPONSE_DISK_CACHE_URL_RESPONSE_DISK_CACHE_APP_H_ | 41 #endif // SERVICES_URL_RESPONSE_DISK_CACHE_URL_RESPONSE_DISK_CACHE_APP_H_ |
OLD | NEW |