Benjamin Lerman | 5d429aa | 2015-05-07 16:21:00 +0200 | [diff] [blame] | 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 |
| 3 | // found in the LICENSE file. |
| 4 | |
| 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_ |
| 7 | |
| 8 | #include "base/macros.h" |
Benjamin Lerman | d15e3f4 | 2015-09-17 11:26:18 +0200 | [diff] [blame] | 9 | #include "base/memory/ref_counted.h" |
Benjamin Lerman | a9579a9 | 2015-07-28 10:30:26 +0200 | [diff] [blame] | 10 | #include "base/task_runner.h" |
Benjamin Lerman | 5d429aa | 2015-05-07 16:21:00 +0200 | [diff] [blame] | 11 | #include "base/threading/sequenced_worker_pool.h" |
| 12 | #include "mojo/public/cpp/application/application_connection.h" |
| 13 | #include "mojo/public/cpp/application/application_delegate.h" |
Przemyslaw Pietrzkiewicz | 9f2c152 | 2015-09-01 18:40:14 +0200 | [diff] [blame] | 14 | #include "mojo/public/cpp/application/application_impl.h" |
Viet-Trung Luu | 0f4f3ba | 2015-10-10 01:08:40 -0700 | [diff] [blame] | 15 | #include "mojo/services/url_response_disk_cache/interfaces/url_response_disk_cache.mojom.h" |
Benjamin Lerman | d15e3f4 | 2015-09-17 11:26:18 +0200 | [diff] [blame] | 16 | #include "services/url_response_disk_cache/url_response_disk_cache_db.h" |
Benjamin Lerman | c440c74 | 2015-09-28 13:52:53 +0200 | [diff] [blame] | 17 | #include "services/url_response_disk_cache/url_response_disk_cache_delegate.h" |
Benjamin Lerman | 5d429aa | 2015-05-07 16:21:00 +0200 | [diff] [blame] | 18 | |
| 19 | namespace mojo { |
| 20 | |
Viet-Trung Luu | 5e30a07 | 2016-05-13 14:12:59 -0700 | [diff] [blame^] | 21 | class URLResponseDiskCacheApp : public ApplicationDelegate { |
Benjamin Lerman | 5d429aa | 2015-05-07 16:21:00 +0200 | [diff] [blame] | 22 | public: |
Benjamin Lerman | c440c74 | 2015-09-28 13:52:53 +0200 | [diff] [blame] | 23 | explicit URLResponseDiskCacheApp(scoped_refptr<base::TaskRunner> task_runner, |
| 24 | URLResponseDiskCacheDelegate* delegate); |
Benjamin Lerman | 5d429aa | 2015-05-07 16:21:00 +0200 | [diff] [blame] | 25 | ~URLResponseDiskCacheApp() override; |
| 26 | |
| 27 | private: |
Przemyslaw Pietrzkiewicz | 9f2c152 | 2015-09-01 18:40:14 +0200 | [diff] [blame] | 28 | // ApplicationDelegate: |
| 29 | void Initialize(ApplicationImpl* app) override; |
Benjamin Lerman | 5d429aa | 2015-05-07 16:21:00 +0200 | [diff] [blame] | 30 | bool ConfigureIncomingConnection(ApplicationConnection* connection) override; |
| 31 | |
Benjamin Lerman | d15e3f4 | 2015-09-17 11:26:18 +0200 | [diff] [blame] | 32 | scoped_refptr<base::TaskRunner> task_runner_; |
| 33 | scoped_refptr<URLResponseDiskCacheDB> db_; |
Benjamin Lerman | c440c74 | 2015-09-28 13:52:53 +0200 | [diff] [blame] | 34 | URLResponseDiskCacheDelegate* delegate_; |
Benjamin Lerman | 5d429aa | 2015-05-07 16:21:00 +0200 | [diff] [blame] | 35 | |
| 36 | DISALLOW_COPY_AND_ASSIGN(URLResponseDiskCacheApp); |
| 37 | }; |
| 38 | |
| 39 | } // namespace mojo |
| 40 | |
| 41 | #endif // SERVICES_URL_RESPONSE_DISK_CACHE_URL_RESPONSE_DISK_CACHE_APP_H_ |