Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(564)

Side by Side Diff: webkit/browser/appcache/appcache_host.h

Issue 22314003: NavigationController prototype Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: NavController prototype - chrome side Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « webkit/browser/appcache/appcache_group.cc ('k') | webkit/browser/appcache/appcache_host.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_HOST_H_ 5 #ifndef WEBKIT_BROWSER_APPCACHE_APPCACHE_HOST_H_
6 #define WEBKIT_BROWSER_APPCACHE_APPCACHE_HOST_H_ 6 #define WEBKIT_BROWSER_APPCACHE_APPCACHE_HOST_H_
7 7
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/gtest_prod_util.h" 9 #include "base/gtest_prod_util.h"
10 #include "base/memory/ref_counted.h" 10 #include "base/memory/ref_counted.h"
11 #include "base/observer_list.h" 11 #include "base/observer_list.h"
12 #include "url/gurl.h" 12 #include "url/gurl.h"
13 #include "webkit/browser/appcache/appcache_group.h" 13 #include "webkit/browser/appcache/appcache_group.h"
14 #include "webkit/browser/appcache/appcache_service.h" 14 #include "webkit/browser/appcache/appcache_service.h"
15 #include "webkit/browser/appcache/appcache_storage.h" 15 #include "webkit/browser/appcache/appcache_storage.h"
16 #include "webkit/browser/webkit_storage_browser_export.h" 16 #include "webkit/browser/webkit_storage_browser_export.h"
17 #include "webkit/common/appcache/appcache_interfaces.h" 17 #include "webkit/common/appcache/appcache_interfaces.h"
18 #include "webkit/common/resource_type.h" 18 #include "webkit/common/resource_type.h"
19 19
20 namespace net { 20 namespace net {
21 class URLRequest; 21 class URLRequest;
22 } // namespace net 22 } // namespace net
23 23
24 namespace appcache { 24 namespace appcache {
25 25
26 class AppCache; 26 class AppCache;
27 class AppCacheFrontend; 27 class AppCacheFrontend;
28 class AppCacheRequestHandler; 28 class AppCacheRequestHandler;
29 struct Manifest;
29 30
30 typedef base::Callback<void(Status, void*)> GetStatusCallback; 31 typedef base::Callback<void(Status, void*)> GetStatusCallback;
31 typedef base::Callback<void(bool, void*)> StartUpdateCallback; 32 typedef base::Callback<void(bool, void*)> StartUpdateCallback;
32 typedef base::Callback<void(bool, void*)> SwapCacheCallback; 33 typedef base::Callback<void(bool, void*)> SwapCacheCallback;
33 34
34 // Server-side representation of an application cache host. 35 // Server-side representation of an application cache host.
35 class WEBKIT_STORAGE_BROWSER_EXPORT AppCacheHost 36 class WEBKIT_STORAGE_BROWSER_EXPORT AppCacheHost
36 : public AppCacheStorage::Delegate, 37 : public AppCacheStorage::Delegate,
37 public AppCacheGroup::UpdateObserver { 38 public AppCacheGroup::UpdateObserver {
38 public: 39 public:
(...skipping 26 matching lines...) Expand all
65 int parent_host_id); 66 int parent_host_id);
66 void SelectCacheForSharedWorker(int64 appcache_id); 67 void SelectCacheForSharedWorker(int64 appcache_id);
67 void MarkAsForeignEntry(const GURL& document_url, 68 void MarkAsForeignEntry(const GURL& document_url,
68 int64 cache_document_was_loaded_from); 69 int64 cache_document_was_loaded_from);
69 void GetStatusWithCallback(const GetStatusCallback& callback, 70 void GetStatusWithCallback(const GetStatusCallback& callback,
70 void* callback_param); 71 void* callback_param);
71 void StartUpdateWithCallback(const StartUpdateCallback& callback, 72 void StartUpdateWithCallback(const StartUpdateCallback& callback,
72 void* callback_param); 73 void* callback_param);
73 void SwapCacheWithCallback(const SwapCacheCallback& callback, 74 void SwapCacheWithCallback(const SwapCacheCallback& callback,
74 void* callback_param); 75 void* callback_param);
76 void RegisterController(const GURL& document_url,
77 const string16& pattern,
78 const GURL& script_url);
79 void UnregisterController(const GURL& document_url,
80 const string16& pattern);
75 81
76 // Called prior to the main resource load. When the system contains multiple 82 // Called prior to the main resource load. When the system contains multiple
77 // candidates for a main resource load, the appcache preferred by the host 83 // candidates for a main resource load, the appcache preferred by the host
78 // that created this host is used to break ties. 84 // that created this host is used to break ties.
79 void SetSpawningHostId(int spawning_process_id, int spawning_host_id); 85 void SetSpawningHostId(int spawning_process_id, int spawning_host_id);
80 86
81 // May return NULL if the spawning host context has been closed, or if a 87 // May return NULL if the spawning host context has been closed, or if a
82 // spawning host context was never identified. 88 // spawning host context was never identified.
83 const AppCacheHost* GetSpawningHost() const; 89 const AppCacheHost* GetSpawningHost() const;
84 90
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 virtual void OnGroupLoaded(AppCacheGroup* group, 169 virtual void OnGroupLoaded(AppCacheGroup* group,
164 const GURL& manifest_url) OVERRIDE; 170 const GURL& manifest_url) OVERRIDE;
165 171
166 void FinishCacheSelection(AppCache* cache, AppCacheGroup* group); 172 void FinishCacheSelection(AppCache* cache, AppCacheGroup* group);
167 void DoPendingGetStatus(); 173 void DoPendingGetStatus();
168 void DoPendingStartUpdate(); 174 void DoPendingStartUpdate();
169 void DoPendingSwapCache(); 175 void DoPendingSwapCache();
170 176
171 void ObserveGroupBeingUpdated(AppCacheGroup* group); 177 void ObserveGroupBeingUpdated(AppCacheGroup* group);
172 178
179 void OnControllerGroupLoaded(AppCacheGroup* group);
180 void OnControllerUpdateComplete(AppCacheGroup* group);
181
173 // AppCacheGroup::UpdateObserver methods. 182 // AppCacheGroup::UpdateObserver methods.
174 virtual void OnUpdateComplete(AppCacheGroup* group) OVERRIDE; 183 virtual void OnUpdateComplete(AppCacheGroup* group) OVERRIDE;
175 184
176 // Returns true if this host is for a dedicated worker context. 185 // Returns true if this host is for a dedicated worker context.
177 bool is_for_dedicated_worker() const { 186 bool is_for_dedicated_worker() const {
178 return parent_host_id_ != kNoHostId; 187 return parent_host_id_ != kNoHostId;
179 } 188 }
180 189
181 // Returns the parent context's host instance. This is only valid 190 // Returns the parent context's host instance. This is only valid
182 // to call when this instance is_for_dedicated_worker. 191 // to call when this instance is_for_dedicated_worker.
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
261 270
262 // List of objects observing us. 271 // List of objects observing us.
263 ObserverList<Observer> observers_; 272 ObserverList<Observer> observers_;
264 273
265 // Used to inform the QuotaManager of what origins are currently in use. 274 // Used to inform the QuotaManager of what origins are currently in use.
266 GURL origin_in_use_; 275 GURL origin_in_use_;
267 276
268 // First party url to be used in policy checks. 277 // First party url to be used in policy checks.
269 GURL first_party_url_; 278 GURL first_party_url_;
270 279
280 // Controller support
281 string16 controller_pattern_;
282 GURL controller_script_url_;
283 GURL controller_manifest_url_; // constructed
284 scoped_refptr<AppCacheGroup> controller_group_;
285 scoped_refptr<AppCache> controller_cache_;
286
271 friend class AppCacheRequestHandlerTest; 287 friend class AppCacheRequestHandlerTest;
272 friend class AppCacheUpdateJobTest; 288 friend class AppCacheUpdateJobTest;
273 FRIEND_TEST_ALL_PREFIXES(AppCacheTest, CleanupUnusedCache); 289 FRIEND_TEST_ALL_PREFIXES(AppCacheTest, CleanupUnusedCache);
274 FRIEND_TEST_ALL_PREFIXES(AppCacheGroupTest, CleanupUnusedGroup); 290 FRIEND_TEST_ALL_PREFIXES(AppCacheGroupTest, CleanupUnusedGroup);
275 FRIEND_TEST_ALL_PREFIXES(AppCacheHostTest, Basic); 291 FRIEND_TEST_ALL_PREFIXES(AppCacheHostTest, Basic);
276 FRIEND_TEST_ALL_PREFIXES(AppCacheHostTest, SelectNoCache); 292 FRIEND_TEST_ALL_PREFIXES(AppCacheHostTest, SelectNoCache);
277 FRIEND_TEST_ALL_PREFIXES(AppCacheHostTest, ForeignEntry); 293 FRIEND_TEST_ALL_PREFIXES(AppCacheHostTest, ForeignEntry);
278 FRIEND_TEST_ALL_PREFIXES(AppCacheHostTest, FailedCacheLoad); 294 FRIEND_TEST_ALL_PREFIXES(AppCacheHostTest, FailedCacheLoad);
279 FRIEND_TEST_ALL_PREFIXES(AppCacheHostTest, FailedGroupLoad); 295 FRIEND_TEST_ALL_PREFIXES(AppCacheHostTest, FailedGroupLoad);
280 FRIEND_TEST_ALL_PREFIXES(AppCacheHostTest, SetSwappableCache); 296 FRIEND_TEST_ALL_PREFIXES(AppCacheHostTest, SetSwappableCache);
281 FRIEND_TEST_ALL_PREFIXES(AppCacheHostTest, ForDedicatedWorker); 297 FRIEND_TEST_ALL_PREFIXES(AppCacheHostTest, ForDedicatedWorker);
282 FRIEND_TEST_ALL_PREFIXES(AppCacheHostTest, SelectCacheAllowed); 298 FRIEND_TEST_ALL_PREFIXES(AppCacheHostTest, SelectCacheAllowed);
283 FRIEND_TEST_ALL_PREFIXES(AppCacheHostTest, SelectCacheBlocked); 299 FRIEND_TEST_ALL_PREFIXES(AppCacheHostTest, SelectCacheBlocked);
284 FRIEND_TEST_ALL_PREFIXES(AppCacheGroupTest, QueueUpdate); 300 FRIEND_TEST_ALL_PREFIXES(AppCacheGroupTest, QueueUpdate);
285 301
286 DISALLOW_COPY_AND_ASSIGN(AppCacheHost); 302 DISALLOW_COPY_AND_ASSIGN(AppCacheHost);
287 }; 303 };
288 304
289 } // namespace appcache 305 } // namespace appcache
290 306
291 #endif // WEBKIT_BROWSER_APPCACHE_APPCACHE_HOST_H_ 307 #endif // WEBKIT_BROWSER_APPCACHE_APPCACHE_HOST_H_
OLDNEW
« no previous file with comments | « webkit/browser/appcache/appcache_group.cc ('k') | webkit/browser/appcache/appcache_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698