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_CACHE_STORAGE_CACHE_STORAGE_DISPATCHER_HOST_H_ | 5 #ifndef CONTENT_BROWSER_CACHE_STORAGE_CACHE_STORAGE_DISPATCHER_HOST_H_ |
6 #define CONTENT_BROWSER_CACHE_STORAGE_CACHE_STORAGE_DISPATCHER_HOST_H_ | 6 #define CONTENT_BROWSER_CACHE_STORAGE_CACHE_STORAGE_DISPATCHER_HOST_H_ |
7 | 7 |
8 #include "content/browser/cache_storage/cache_storage.h" | |
9 #include "content/public/browser/browser_message_filter.h" | 8 #include "content/public/browser/browser_message_filter.h" |
10 | 9 |
11 namespace content { | 10 namespace content { |
12 | 11 |
13 class CacheStorageContextImpl; | 12 class CacheStorageContextImpl; |
14 class CacheStorageListener; | 13 class CacheStorageListener; |
15 | 14 |
16 // Handles Cache Storage related messages sent to the browser process from | 15 // Handles Cache Storage related messages sent to the browser process from |
17 // child processes. One host instance exists per child process. All | 16 // child processes. One host instance exists per child process. All |
18 // messages are processed on the IO thread. Currently, all messages are | 17 // messages are processed on the IO thread. Currently, all messages are |
(...skipping 15 matching lines...) Expand all Loading... |
34 private: | 33 private: |
35 // Friends to allow OnDestruct() delegation | 34 // Friends to allow OnDestruct() delegation |
36 friend class BrowserThread; | 35 friend class BrowserThread; |
37 friend class base::DeleteHelper<CacheStorageDispatcherHost>; | 36 friend class base::DeleteHelper<CacheStorageDispatcherHost>; |
38 | 37 |
39 ~CacheStorageDispatcherHost() override; | 38 ~CacheStorageDispatcherHost() override; |
40 | 39 |
41 // Called by Init() on IO thread. | 40 // Called by Init() on IO thread. |
42 void CreateCacheListener(CacheStorageContextImpl* context); | 41 void CreateCacheListener(CacheStorageContextImpl* context); |
43 | 42 |
44 // The message receiver functions for the CacheStorage API: | |
45 void OnCacheStorageHas(int thread_id, | |
46 int request_id, | |
47 const GURL& origin, | |
48 const base::string16& cache_name); | |
49 void OnCacheStorageOpen(int thread_id, | |
50 int request_id, | |
51 const GURL& origin, | |
52 const base::string16& cache_name); | |
53 void OnCacheStorageDelete(int thread_id, | |
54 int request_id, | |
55 const GURL& origin, | |
56 const base::string16& cache_name); | |
57 void OnCacheStorageKeys(int thread_id, int request_id, const GURL& origin); | |
58 void OnCacheStorageMatch(int thread_id, | |
59 int request_id, | |
60 const GURL& origin, | |
61 const ServiceWorkerFetchRequest& request, | |
62 const CacheStorageCacheQueryParams& match_params); | |
63 | |
64 // CacheStorageManager callbacks | |
65 void OnCacheStorageHasCallback(int thread_id, | |
66 int request_id, | |
67 bool has_cache, | |
68 CacheStorage::CacheStorageError error); | |
69 void OnCacheStorageOpenCallback(int thread_id, | |
70 int request_id, | |
71 const scoped_refptr<CacheStorageCache>& cache, | |
72 CacheStorage::CacheStorageError error); | |
73 void OnCacheStorageDeleteCallback(int thread_id, | |
74 int request_id, | |
75 bool deleted, | |
76 CacheStorage::CacheStorageError error); | |
77 void OnCacheStorageKeysCallback(int thread_id, | |
78 int request_id, | |
79 const std::vector<std::string>& strings, | |
80 CacheStorage::CacheStorageError error); | |
81 void OnCacheStorageMatchCallback( | |
82 int thread_id, | |
83 int request_id, | |
84 CacheStorageCache::ErrorType error, | |
85 scoped_ptr<ServiceWorkerResponse> response, | |
86 scoped_ptr<storage::BlobDataHandle> blob_data_handle); | |
87 | |
88 scoped_ptr<CacheStorageListener> cache_listener_; | 43 scoped_ptr<CacheStorageListener> cache_listener_; |
89 scoped_refptr<CacheStorageContextImpl> context_; | |
90 | 44 |
91 DISALLOW_COPY_AND_ASSIGN(CacheStorageDispatcherHost); | 45 DISALLOW_COPY_AND_ASSIGN(CacheStorageDispatcherHost); |
92 }; | 46 }; |
93 | 47 |
94 } // namespace content | 48 } // namespace content |
95 | 49 |
96 #endif // CONTENT_BROWSER_CACHE_STORAGE_CACHE_STORAGE_DISPATCHER_HOST_H_ | 50 #endif // CONTENT_BROWSER_CACHE_STORAGE_CACHE_STORAGE_DISPATCHER_HOST_H_ |
OLD | NEW |