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 CONTENT_BROWSER_SERVICE_WORKER_CACHE_STORAGE_DISPATCHER_HOST_H_ | 5 #ifndef CONTENT_BROWSER_CACHE_STORAGE_CACHE_STORAGE_DISPATCHER_HOST_H_ |
6 #define CONTENT_BROWSER_SERVICE_WORKER_CACHE_STORAGE_DISPATCHER_HOST_H_ | 6 #define CONTENT_BROWSER_CACHE_STORAGE_CACHE_STORAGE_DISPATCHER_HOST_H_ |
7 | 7 |
8 #include "content/public/browser/browser_message_filter.h" | 8 #include "content/public/browser/browser_message_filter.h" |
9 | 9 |
10 namespace content { | 10 namespace content { |
11 | 11 |
12 class CacheStorageContextImpl; | 12 class CacheStorageContextImpl; |
13 class ServiceWorkerCacheListener; | 13 class CacheStorageListener; |
14 | 14 |
15 // Handles Cache Storage related messages sent to the browser process from | 15 // Handles Cache Storage related messages sent to the browser process from |
16 // child processes. One host instance exists per child process. All | 16 // child processes. One host instance exists per child process. All |
17 // messages are processed on the IO thread. Currently, all messages are | 17 // messages are processed on the IO thread. Currently, all messages are |
18 // passed directly to the owned ServiceWorkerCacheListener instance, which | 18 // passed directly to the owned CacheStorageListener instance, which |
19 // in turn dispatches calls to the ServiceWorkerCacheStorageManager owned | 19 // in turn dispatches calls to the CacheStorageManager owned |
20 // by the CacheStorageContextImpl for the entire browsing context. | 20 // by the CacheStorageContextImpl for the entire browsing context. |
21 // TODO(jsbell): Merge this with ServiceWorkerCacheListener crbug.com/439389 | 21 // TODO(jsbell): Merge this with CacheStorageListener crbug.com/439389 |
22 class CONTENT_EXPORT CacheStorageDispatcherHost : public BrowserMessageFilter { | 22 class CONTENT_EXPORT CacheStorageDispatcherHost : public BrowserMessageFilter { |
23 public: | 23 public: |
24 CacheStorageDispatcherHost(); | 24 CacheStorageDispatcherHost(); |
25 | 25 |
26 // Runs on UI thread. | 26 // Runs on UI thread. |
27 void Init(CacheStorageContextImpl* context); | 27 void Init(CacheStorageContextImpl* context); |
28 | 28 |
29 // BrowserMessageFilter implementation | 29 // BrowserMessageFilter implementation |
30 void OnDestruct() const override; | 30 void OnDestruct() const override; |
31 bool OnMessageReceived(const IPC::Message& message) override; | 31 bool OnMessageReceived(const IPC::Message& message) override; |
32 | 32 |
33 private: | 33 private: |
34 // Friends to allow OnDestruct() delegation | 34 // Friends to allow OnDestruct() delegation |
35 friend class BrowserThread; | 35 friend class BrowserThread; |
36 friend class base::DeleteHelper<CacheStorageDispatcherHost>; | 36 friend class base::DeleteHelper<CacheStorageDispatcherHost>; |
37 | 37 |
38 ~CacheStorageDispatcherHost() override; | 38 ~CacheStorageDispatcherHost() override; |
39 | 39 |
40 // Called by Init() on IO thread. | 40 // Called by Init() on IO thread. |
41 void CreateCacheListener(CacheStorageContextImpl* context); | 41 void CreateCacheListener(CacheStorageContextImpl* context); |
42 | 42 |
43 scoped_ptr<ServiceWorkerCacheListener> cache_listener_; | 43 scoped_ptr<CacheStorageListener> cache_listener_; |
44 | 44 |
45 DISALLOW_COPY_AND_ASSIGN(CacheStorageDispatcherHost); | 45 DISALLOW_COPY_AND_ASSIGN(CacheStorageDispatcherHost); |
46 }; | 46 }; |
47 | 47 |
48 } // namespace content | 48 } // namespace content |
49 | 49 |
50 #endif // CONTENT_BROWSER_SERVICE_WORKER_CACHE_STORAGE_DISPATCHER_HOST_H_ | 50 #endif // CONTENT_BROWSER_CACHE_STORAGE_CACHE_STORAGE_DISPATCHER_HOST_H_ |
OLD | NEW |