Chromium Code Reviews| 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 <memory> | 9 #include <memory> |
| 10 #include <set> | 10 #include <set> |
| 11 | 11 |
| 12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
| 13 #include "content/common/content_export.h" | 13 #include "content/common/content_export.h" |
| 14 #include "content/public/common/appcache_info.h" | 14 #include "content/public/common/appcache_info.h" |
| 15 #include "net/base/completion_callback.h" | 15 #include "net/base/completion_callback.h" |
| 16 | 16 |
| 17 namespace net { | |
| 18 class URLRequest; | |
| 19 } // namespace net | |
| 20 | |
| 17 namespace content { | 21 namespace content { |
| 18 | 22 |
| 19 // Refcounted container to avoid copying the collection in callbacks. | 23 // Refcounted container to avoid copying the collection in callbacks. |
| 20 struct CONTENT_EXPORT AppCacheInfoCollection | 24 struct CONTENT_EXPORT AppCacheInfoCollection |
| 21 : public base::RefCountedThreadSafe<AppCacheInfoCollection> { | 25 : public base::RefCountedThreadSafe<AppCacheInfoCollection> { |
| 22 AppCacheInfoCollection(); | 26 AppCacheInfoCollection(); |
| 23 | 27 |
| 24 std::map<GURL, AppCacheInfoVector> infos_by_origin; | 28 std::map<GURL, AppCacheInfoVector> infos_by_origin; |
| 25 | 29 |
| 26 private: | 30 private: |
| (...skipping 13 matching lines...) Expand all Loading... | |
| 40 const net::CompletionCallback& callback) = 0; | 44 const net::CompletionCallback& callback) = 0; |
| 41 | 45 |
| 42 // Deletes the group identified by 'manifest_url', 'callback' is | 46 // Deletes the group identified by 'manifest_url', 'callback' is |
| 43 // invoked upon completion. Upon completion, the cache group and | 47 // invoked upon completion. Upon completion, the cache group and |
| 44 // any resources within the group are no longer loadable and all | 48 // any resources within the group are no longer loadable and all |
| 45 // subresource loads for pages associated with a deleted group | 49 // subresource loads for pages associated with a deleted group |
| 46 // will fail. This method always completes asynchronously. | 50 // will fail. This method always completes asynchronously. |
| 47 virtual void DeleteAppCacheGroup(const GURL& manifest_url, | 51 virtual void DeleteAppCacheGroup(const GURL& manifest_url, |
| 48 const net::CompletionCallback& callback) = 0; | 52 const net::CompletionCallback& callback) = 0; |
| 49 | 53 |
| 54 static bool URLRequestHasActiveAppCache(net::URLRequest* request); | |
|
michaeln
2017/03/27 23:27:45
If we can avoid adding this to the content public
| |
| 55 | |
| 50 protected: | 56 protected: |
| 51 virtual ~AppCacheService() {} | 57 virtual ~AppCacheService() {} |
| 52 }; | 58 }; |
| 53 | 59 |
| 54 } // namespace content | 60 } // namespace content |
| 55 | 61 |
| 56 #endif // CONTENT_PUBLIC_BROWSER_APPCACHE_SERVICE_H_ | 62 #endif // CONTENT_PUBLIC_BROWSER_APPCACHE_SERVICE_H_ |
| OLD | NEW |