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 WEBKIT_BROWSER_APPCACHE_APPCACHE_BACKEND_IMPL_H_ | 5 #ifndef WEBKIT_BROWSER_APPCACHE_APPCACHE_BACKEND_IMPL_H_ |
6 #define WEBKIT_BROWSER_APPCACHE_APPCACHE_BACKEND_IMPL_H_ | 6 #define WEBKIT_BROWSER_APPCACHE_APPCACHE_BACKEND_IMPL_H_ |
7 | 7 |
8 #include "base/containers/hash_tables.h" | 8 #include "base/containers/hash_tables.h" |
9 #include "webkit/browser/appcache/appcache_host.h" | 9 #include "webkit/browser/appcache/appcache_host.h" |
10 #include "webkit/browser/webkit_storage_browser_export.h" | 10 #include "webkit/browser/webkit_storage_browser_export.h" |
(...skipping 30 matching lines...) Expand all Loading... |
41 bool SelectCacheForSharedWorker(int host_id, int64 appcache_id); | 41 bool SelectCacheForSharedWorker(int host_id, int64 appcache_id); |
42 bool MarkAsForeignEntry(int host_id, const GURL& document_url, | 42 bool MarkAsForeignEntry(int host_id, const GURL& document_url, |
43 int64 cache_document_was_loaded_from); | 43 int64 cache_document_was_loaded_from); |
44 bool GetStatusWithCallback(int host_id, const GetStatusCallback& callback, | 44 bool GetStatusWithCallback(int host_id, const GetStatusCallback& callback, |
45 void* callback_param); | 45 void* callback_param); |
46 bool StartUpdateWithCallback(int host_id, const StartUpdateCallback& callback, | 46 bool StartUpdateWithCallback(int host_id, const StartUpdateCallback& callback, |
47 void* callback_param); | 47 void* callback_param); |
48 bool SwapCacheWithCallback(int host_id, const SwapCacheCallback& callback, | 48 bool SwapCacheWithCallback(int host_id, const SwapCacheCallback& callback, |
49 void* callback_param); | 49 void* callback_param); |
50 | 50 |
| 51 bool RegisterController(int host_id, |
| 52 const GURL& document_url, |
| 53 const string16& pattern, const GURL& script_url); |
| 54 bool UnregisterController(int host_id, |
| 55 const GURL& document_url, |
| 56 const string16& pattern); |
| 57 |
51 // Returns a pointer to a registered host. The backend retains ownership. | 58 // Returns a pointer to a registered host. The backend retains ownership. |
52 AppCacheHost* GetHost(int host_id) { | 59 AppCacheHost* GetHost(int host_id) { |
53 HostMap::iterator it = hosts_.find(host_id); | 60 HostMap::iterator it = hosts_.find(host_id); |
54 return (it != hosts_.end()) ? (it->second) : NULL; | 61 return (it != hosts_.end()) ? (it->second) : NULL; |
55 } | 62 } |
56 | 63 |
57 typedef base::hash_map<int, AppCacheHost*> HostMap; | 64 typedef base::hash_map<int, AppCacheHost*> HostMap; |
58 const HostMap& hosts() { return hosts_; } | 65 const HostMap& hosts() { return hosts_; } |
59 | 66 |
60 private: | 67 private: |
61 AppCacheService* service_; | 68 AppCacheService* service_; |
62 AppCacheFrontend* frontend_; | 69 AppCacheFrontend* frontend_; |
63 int process_id_; | 70 int process_id_; |
64 HostMap hosts_; | 71 HostMap hosts_; |
65 }; | 72 }; |
66 | 73 |
67 } // namespace | 74 } // namespace |
68 | 75 |
69 #endif // WEBKIT_BROWSER_APPCACHE_APPCACHE_BACKEND_IMPL_H_ | 76 #endif // WEBKIT_BROWSER_APPCACHE_APPCACHE_BACKEND_IMPL_H_ |
OLD | NEW |