OLD | NEW |
| (Empty) |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef CHROME_BROWSER_ANDROID_OFFLINE_PAGES_PRERENDERING_OFFLINER_FACTORY_H_ | |
6 #define CHROME_BROWSER_ANDROID_OFFLINE_PAGES_PRERENDERING_OFFLINER_FACTORY_H_ | |
7 | |
8 #include "base/macros.h" | |
9 #include "components/offline_pages/core/background/offliner_factory.h" | |
10 | |
11 namespace content { | |
12 class BrowserContext; | |
13 } // namespace content | |
14 | |
15 namespace offline_pages { | |
16 | |
17 class OfflinerPolicy; | |
18 class Offliner; | |
19 class PrerenderingOffliner; | |
20 | |
21 // A factory to create one unique PrerenderingOffliner. Since the | |
22 // PrerenderingOffliner is somewhat heavyweight and can use lots of memory, we | |
23 // normally don't want more than one, and we can reuse the offliner for many | |
24 // offlining sessions. | |
25 class PrerenderingOfflinerFactory : public OfflinerFactory { | |
26 public: | |
27 explicit PrerenderingOfflinerFactory(content::BrowserContext* context); | |
28 ~PrerenderingOfflinerFactory() override; | |
29 | |
30 Offliner* GetOffliner(const OfflinerPolicy* policy) override; | |
31 | |
32 private: | |
33 // The offliner is owned by the factory, since it may be resued. | |
34 PrerenderingOffliner* offliner_; | |
35 | |
36 // This is an unowned pointer, expected to stay valid for the lifetime of the | |
37 // factory. | |
38 content::BrowserContext* context_; | |
39 | |
40 DISALLOW_COPY_AND_ASSIGN(PrerenderingOfflinerFactory); | |
41 }; | |
42 | |
43 } // namespace offline_pages | |
44 | |
45 #endif // CHROME_BROWSER_ANDROID_OFFLINE_PAGES_PRERENDERING_OFFLINER_FACTORY_H_ | |
OLD | NEW |