OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_UPDATE_JOB_H_ | 5 #ifndef WEBKIT_BROWSER_APPCACHE_APPCACHE_UPDATE_JOB_H_ |
6 #define WEBKIT_BROWSER_APPCACHE_APPCACHE_UPDATE_JOB_H_ | 6 #define WEBKIT_BROWSER_APPCACHE_APPCACHE_UPDATE_JOB_H_ |
7 | 7 |
8 #include <deque> | 8 #include <deque> |
9 #include <map> | 9 #include <map> |
10 #include <set> | 10 #include <set> |
(...skipping 22 matching lines...) Expand all Loading... |
33 : public AppCacheStorage::Delegate, | 33 : public AppCacheStorage::Delegate, |
34 public AppCacheHost::Observer { | 34 public AppCacheHost::Observer { |
35 public: | 35 public: |
36 AppCacheUpdateJob(AppCacheService* service, AppCacheGroup* group); | 36 AppCacheUpdateJob(AppCacheService* service, AppCacheGroup* group); |
37 virtual ~AppCacheUpdateJob(); | 37 virtual ~AppCacheUpdateJob(); |
38 | 38 |
39 // Triggers the update process or adds more info if this update is already | 39 // Triggers the update process or adds more info if this update is already |
40 // in progress. | 40 // in progress. |
41 void StartUpdate(AppCacheHost* host, const GURL& new_master_resource); | 41 void StartUpdate(AppCacheHost* host, const GURL& new_master_resource); |
42 | 42 |
| 43 // Hackery for 'registerController' |
| 44 void StartUpdateWithFakeManifest(Manifest* manifest); |
| 45 |
43 private: | 46 private: |
44 friend class AppCacheUpdateJobTest; | 47 friend class AppCacheUpdateJobTest; |
45 class URLFetcher; | 48 class URLFetcher; |
46 | 49 |
47 // Master entries have multiple hosts, for example, the same page is opened | 50 // Master entries have multiple hosts, for example, the same page is opened |
48 // in different tabs. | 51 // in different tabs. |
49 typedef std::vector<AppCacheHost*> PendingHosts; | 52 typedef std::vector<AppCacheHost*> PendingHosts; |
50 typedef std::map<GURL, PendingHosts> PendingMasters; | 53 typedef std::map<GURL, PendingHosts> PendingMasters; |
51 typedef std::map<GURL, URLFetcher*> PendingUrlFetches; | 54 typedef std::map<GURL, URLFetcher*> PendingUrlFetches; |
52 typedef std::map<int64, GURL> LoadingResponses; | 55 typedef std::map<int64, GURL> LoadingResponses; |
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
293 // In some cases we fetch the same resource multiple times, and then | 296 // In some cases we fetch the same resource multiple times, and then |
294 // have to delete the duplicates upon successful update. These ids | 297 // have to delete the duplicates upon successful update. These ids |
295 // are also in the stored_response_ids_ collection so we only schedule | 298 // are also in the stored_response_ids_ collection so we only schedule |
296 // these for deletion on success. | 299 // these for deletion on success. |
297 // TODO(michaeln): Rework when we no longer fetches master entries directly. | 300 // TODO(michaeln): Rework when we no longer fetches master entries directly. |
298 std::vector<int64> duplicate_response_ids_; | 301 std::vector<int64> duplicate_response_ids_; |
299 | 302 |
300 // Whether we've stored the resulting group/cache yet. | 303 // Whether we've stored the resulting group/cache yet. |
301 StoredState stored_state_; | 304 StoredState stored_state_; |
302 | 305 |
| 306 bool using_fake_manifest_; |
| 307 |
303 FRIEND_TEST_ALL_PREFIXES(AppCacheGroupTest, QueueUpdate); | 308 FRIEND_TEST_ALL_PREFIXES(AppCacheGroupTest, QueueUpdate); |
304 | 309 |
305 DISALLOW_COPY_AND_ASSIGN(AppCacheUpdateJob); | 310 DISALLOW_COPY_AND_ASSIGN(AppCacheUpdateJob); |
306 }; | 311 }; |
307 | 312 |
308 } // namespace appcache | 313 } // namespace appcache |
309 | 314 |
310 #endif // WEBKIT_BROWSER_APPCACHE_APPCACHE_UPDATE_JOB_H_ | 315 #endif // WEBKIT_BROWSER_APPCACHE_APPCACHE_UPDATE_JOB_H_ |
OLD | NEW |