OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_APPCACHE_APPCACHE_BACKEND_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_APPCACHE_APPCACHE_BACKEND_IMPL_H_ |
6 #define CONTENT_BROWSER_APPCACHE_APPCACHE_BACKEND_IMPL_H_ | 6 #define CONTENT_BROWSER_APPCACHE_APPCACHE_BACKEND_IMPL_H_ |
7 | 7 |
| 8 #include <stdint.h> |
| 9 |
8 #include "base/containers/hash_tables.h" | 10 #include "base/containers/hash_tables.h" |
9 #include "content/browser/appcache/appcache_host.h" | 11 #include "content/browser/appcache/appcache_host.h" |
10 #include "content/common/content_export.h" | 12 #include "content/common/content_export.h" |
11 | 13 |
12 namespace content { | 14 namespace content { |
13 | 15 |
14 class AppCacheServiceImpl; | 16 class AppCacheServiceImpl; |
15 | 17 |
16 class CONTENT_EXPORT AppCacheBackendImpl { | 18 class CONTENT_EXPORT AppCacheBackendImpl { |
17 public: | 19 public: |
18 AppCacheBackendImpl(); | 20 AppCacheBackendImpl(); |
19 ~AppCacheBackendImpl(); | 21 ~AppCacheBackendImpl(); |
20 | 22 |
21 void Initialize(AppCacheServiceImpl* service, | 23 void Initialize(AppCacheServiceImpl* service, |
22 AppCacheFrontend* frontend, | 24 AppCacheFrontend* frontend, |
23 int process_id); | 25 int process_id); |
24 | 26 |
25 int process_id() const { return process_id_; } | 27 int process_id() const { return process_id_; } |
26 | 28 |
27 // Methods to support the AppCacheBackend interface. A false return | 29 // Methods to support the AppCacheBackend interface. A false return |
28 // value indicates an invalid host_id and that no action was taken | 30 // value indicates an invalid host_id and that no action was taken |
29 // by the backend impl. | 31 // by the backend impl. |
30 bool RegisterHost(int host_id); | 32 bool RegisterHost(int host_id); |
31 bool UnregisterHost(int host_id); | 33 bool UnregisterHost(int host_id); |
32 bool SetSpawningHostId(int host_id, int spawning_host_id); | 34 bool SetSpawningHostId(int host_id, int spawning_host_id); |
33 bool SelectCache(int host_id, | 35 bool SelectCache(int host_id, |
34 const GURL& document_url, | 36 const GURL& document_url, |
35 const int64 cache_document_was_loaded_from, | 37 const int64_t cache_document_was_loaded_from, |
36 const GURL& manifest_url); | 38 const GURL& manifest_url); |
37 void GetResourceList( | 39 void GetResourceList( |
38 int host_id, std::vector<AppCacheResourceInfo>* resource_infos); | 40 int host_id, std::vector<AppCacheResourceInfo>* resource_infos); |
39 bool SelectCacheForWorker(int host_id, int parent_process_id, | 41 bool SelectCacheForWorker(int host_id, int parent_process_id, |
40 int parent_host_id); | 42 int parent_host_id); |
41 bool SelectCacheForSharedWorker(int host_id, int64 appcache_id); | 43 bool SelectCacheForSharedWorker(int host_id, int64_t appcache_id); |
42 bool MarkAsForeignEntry(int host_id, const GURL& document_url, | 44 bool MarkAsForeignEntry(int host_id, |
43 int64 cache_document_was_loaded_from); | 45 const GURL& document_url, |
| 46 int64_t cache_document_was_loaded_from); |
44 bool GetStatusWithCallback(int host_id, const GetStatusCallback& callback, | 47 bool GetStatusWithCallback(int host_id, const GetStatusCallback& callback, |
45 void* callback_param); | 48 void* callback_param); |
46 bool StartUpdateWithCallback(int host_id, const StartUpdateCallback& callback, | 49 bool StartUpdateWithCallback(int host_id, const StartUpdateCallback& callback, |
47 void* callback_param); | 50 void* callback_param); |
48 bool SwapCacheWithCallback(int host_id, const SwapCacheCallback& callback, | 51 bool SwapCacheWithCallback(int host_id, const SwapCacheCallback& callback, |
49 void* callback_param); | 52 void* callback_param); |
50 | 53 |
51 // Returns a pointer to a registered host. The backend retains ownership. | 54 // Returns a pointer to a registered host. The backend retains ownership. |
52 AppCacheHost* GetHost(int host_id) { | 55 AppCacheHost* GetHost(int host_id) { |
53 HostMap::iterator it = hosts_.find(host_id); | 56 HostMap::iterator it = hosts_.find(host_id); |
(...skipping 12 matching lines...) Expand all Loading... |
66 private: | 69 private: |
67 AppCacheServiceImpl* service_; | 70 AppCacheServiceImpl* service_; |
68 AppCacheFrontend* frontend_; | 71 AppCacheFrontend* frontend_; |
69 int process_id_; | 72 int process_id_; |
70 HostMap hosts_; | 73 HostMap hosts_; |
71 }; | 74 }; |
72 | 75 |
73 } // namespace | 76 } // namespace |
74 | 77 |
75 #endif // CONTENT_BROWSER_APPCACHE_APPCACHE_BACKEND_IMPL_H_ | 78 #endif // CONTENT_BROWSER_APPCACHE_APPCACHE_BACKEND_IMPL_H_ |
OLD | NEW |