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 CONTENT_PUBLIC_BROWSER_APPCACHE_SERVICE_H_ | 5 #ifndef CONTENT_PUBLIC_BROWSER_APPCACHE_SERVICE_H_ |
6 #define CONTENT_PUBLIC_BROWSER_APPCACHE_SERVICE_H_ | 6 #define CONTENT_PUBLIC_BROWSER_APPCACHE_SERVICE_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <set> | 9 #include <set> |
10 | 10 |
(...skipping 16 matching lines...) Expand all Loading... |
27 | 27 |
28 private: | 28 private: |
29 friend class base::RefCountedThreadSafe<AppCacheInfoCollection>; | 29 friend class base::RefCountedThreadSafe<AppCacheInfoCollection>; |
30 virtual ~AppCacheInfoCollection(); | 30 virtual ~AppCacheInfoCollection(); |
31 }; | 31 }; |
32 | 32 |
33 // Exposes a limited interface to the AppCacheService. | 33 // Exposes a limited interface to the AppCacheService. |
34 // Call these methods only on the IO thread. | 34 // Call these methods only on the IO thread. |
35 class CONTENT_EXPORT AppCacheService { | 35 class CONTENT_EXPORT AppCacheService { |
36 public: | 36 public: |
37 // Determines if a request for 'url' can be satisfied while offline. | |
38 // This method always completes asynchronously. | |
39 virtual void CanHandleMainResourceOffline(const GURL& url, | |
40 const GURL& first_party, | |
41 const net::CompletionCallback& | |
42 callback) = 0; | |
43 | |
44 // Populates 'collection' with info about all of the appcaches stored | 37 // Populates 'collection' with info about all of the appcaches stored |
45 // within the service, 'callback' is invoked upon completion. The service | 38 // within the service, 'callback' is invoked upon completion. The service |
46 // acquires a reference to the 'collection' until completion. | 39 // acquires a reference to the 'collection' until completion. |
47 // This method always completes asynchronously. | 40 // This method always completes asynchronously. |
48 virtual void GetAllAppCacheInfo(AppCacheInfoCollection* collection, | 41 virtual void GetAllAppCacheInfo(AppCacheInfoCollection* collection, |
49 const net::CompletionCallback& callback) = 0; | 42 const net::CompletionCallback& callback) = 0; |
50 | 43 |
51 // Deletes the group identified by 'manifest_url', 'callback' is | 44 // Deletes the group identified by 'manifest_url', 'callback' is |
52 // invoked upon completion. Upon completion, the cache group and | 45 // invoked upon completion. Upon completion, the cache group and |
53 // any resources within the group are no longer loadable and all | 46 // any resources within the group are no longer loadable and all |
54 // subresource loads for pages associated with a deleted group | 47 // subresource loads for pages associated with a deleted group |
55 // will fail. This method always completes asynchronously. | 48 // will fail. This method always completes asynchronously. |
56 virtual void DeleteAppCacheGroup(const GURL& manifest_url, | 49 virtual void DeleteAppCacheGroup(const GURL& manifest_url, |
57 const net::CompletionCallback& callback) = 0; | 50 const net::CompletionCallback& callback) = 0; |
58 | 51 |
59 protected: | 52 protected: |
60 virtual ~AppCacheService() {} | 53 virtual ~AppCacheService() {} |
61 }; | 54 }; |
62 | 55 |
63 } // namespace content | 56 } // namespace content |
64 | 57 |
65 #endif // CONTENT_PUBLIC_BROWSER_APPCACHE_SERVICE_H_ | 58 #endif // CONTENT_PUBLIC_BROWSER_APPCACHE_SERVICE_H_ |
OLD | NEW |