OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 COMPONENTS_PRECACHE_CONTENT_PRECACHE_MANAGER_H_ | 5 #ifndef COMPONENTS_PRECACHE_CONTENT_PRECACHE_MANAGER_H_ |
6 #define COMPONENTS_PRECACHE_CONTENT_PRECACHE_MANAGER_H_ | 6 #define COMPONENTS_PRECACHE_CONTENT_PRECACHE_MANAGER_H_ |
7 | 7 |
8 #include <list> | 8 #include <list> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 public: | 42 public: |
43 typedef base::Closure PrecacheCompletionCallback; | 43 typedef base::Closure PrecacheCompletionCallback; |
44 | 44 |
45 explicit PrecacheManager(content::BrowserContext* browser_context); | 45 explicit PrecacheManager(content::BrowserContext* browser_context); |
46 virtual ~PrecacheManager(); | 46 virtual ~PrecacheManager(); |
47 | 47 |
48 // Returns true if precaching is enabled as part of a field trial or by the | 48 // Returns true if precaching is enabled as part of a field trial or by the |
49 // command line flag. This method can be called on any thread. | 49 // command line flag. This method can be called on any thread. |
50 static bool IsPrecachingEnabled(); | 50 static bool IsPrecachingEnabled(); |
51 | 51 |
| 52 // Returns true if precaching is allowed for the browser context. |
| 53 bool IsPrecachingAllowed(); |
| 54 |
52 // Starts precaching resources that the user is predicted to fetch in the | 55 // Starts precaching resources that the user is predicted to fetch in the |
53 // future. If precaching is already currently in progress, then this method | 56 // future. If precaching is already currently in progress, then this method |
54 // does nothing. The |precache_completion_callback| will be run when | 57 // does nothing. The |precache_completion_callback| will be run when |
55 // precaching finishes, but will not be run if precaching is canceled. | 58 // precaching finishes, but will not be run if precaching is canceled. |
56 void StartPrecaching( | 59 void StartPrecaching( |
57 const PrecacheCompletionCallback& precache_completion_callback, | 60 const PrecacheCompletionCallback& precache_completion_callback, |
58 URLListProvider* url_list_provider); | 61 URLListProvider* url_list_provider); |
59 | 62 |
60 // Cancels precaching if it is in progress. | 63 // Cancels precaching if it is in progress. |
61 void CancelPrecaching(); | 64 void CancelPrecaching(); |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 | 98 |
96 // Flag indicating whether or not precaching is currently in progress. | 99 // Flag indicating whether or not precaching is currently in progress. |
97 bool is_precaching_; | 100 bool is_precaching_; |
98 | 101 |
99 DISALLOW_COPY_AND_ASSIGN(PrecacheManager); | 102 DISALLOW_COPY_AND_ASSIGN(PrecacheManager); |
100 }; | 103 }; |
101 | 104 |
102 } // namespace precache | 105 } // namespace precache |
103 | 106 |
104 #endif // COMPONENTS_PRECACHE_CONTENT_PRECACHE_MANAGER_H_ | 107 #endif // COMPONENTS_PRECACHE_CONTENT_PRECACHE_MANAGER_H_ |
OLD | NEW |