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 CHROME_BROWSER_PRERENDER_PRERENDER_MANAGER_FACTORY_H_ | 5 #ifndef CHROME_BROWSER_PRERENDER_PRERENDER_MANAGER_FACTORY_H_ |
| 6 #define CHROME_BROWSER_PRERENDER_PRERENDER_MANAGER_FACTORY_H_ | 6 #define CHROME_BROWSER_PRERENDER_PRERENDER_MANAGER_FACTORY_H_ |
| 7 | 7 |
| 8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
| 9 #include "base/memory/singleton.h" | 9 #include "base/memory/singleton.h" |
| 10 #include "components/keyed_service/content/browser_context_keyed_service_factory .h" | 10 #include "components/keyed_service/content/browser_context_keyed_service_factory .h" |
| 11 | 11 |
| 12 namespace content { | |
| 13 class BrowserContext; | |
| 14 } | |
| 15 | |
| 12 class Profile; | 16 class Profile; |
| 13 | 17 |
| 14 namespace prerender { | 18 namespace prerender { |
| 15 | 19 |
| 16 class PrerenderManager; | 20 class PrerenderManager; |
| 17 | 21 |
| 18 // Singleton that owns all PrerenderManagers and associates them with Profiles. | 22 // Singleton that owns all PrerenderManagers and associates them with Profiles. |
| 19 // Listens for the Profile's destruction notification and cleans up the | 23 // Listens for the Profile's destruction notification and cleans up the |
| 20 // associated PrerenderManager. | 24 // associated PrerenderManager. |
| 21 class PrerenderManagerFactory : public BrowserContextKeyedServiceFactory { | 25 class PrerenderManagerFactory : public BrowserContextKeyedServiceFactory { |
| 22 public: | 26 public: |
| 23 // Returns the PrerenderManager for |profile|. | 27 // Returns the PrerenderManager for |profile|. |
| 24 static PrerenderManager* GetForProfile(Profile* profile); | 28 static PrerenderManager* GetForBrowserContext( |
|
mattcary
2016/09/14 12:33:21
Why change this? Is it just cleanup or is there a
droger
2016/09/14 14:15:42
It's mainly a cleanup. I can do this a separate CL
mattcary
2016/09/14 14:19:39
Ok, thanks for the context.
No need to put that i
| |
| 29 content::BrowserContext* context); | |
| 25 | 30 |
| 26 static PrerenderManagerFactory* GetInstance(); | 31 static PrerenderManagerFactory* GetInstance(); |
| 27 | 32 |
| 28 private: | 33 private: |
| 29 friend struct base::DefaultSingletonTraits<PrerenderManagerFactory>; | 34 friend struct base::DefaultSingletonTraits<PrerenderManagerFactory>; |
| 30 | 35 |
| 31 PrerenderManagerFactory(); | 36 PrerenderManagerFactory(); |
| 32 ~PrerenderManagerFactory() override; | 37 ~PrerenderManagerFactory() override; |
| 33 | 38 |
| 34 // BrowserContextKeyedServiceFactory: | 39 // BrowserContextKeyedServiceFactory: |
| 35 KeyedService* BuildServiceInstanceFor( | 40 KeyedService* BuildServiceInstanceFor( |
| 36 content::BrowserContext* profile) const override; | 41 content::BrowserContext* profile) const override; |
| 37 content::BrowserContext* GetBrowserContextToUse( | 42 content::BrowserContext* GetBrowserContextToUse( |
| 38 content::BrowserContext* context) const override; | 43 content::BrowserContext* context) const override; |
| 39 }; | 44 }; |
| 40 | 45 |
| 41 } // namespace prerender | 46 } // namespace prerender |
| 42 | 47 |
| 43 #endif // CHROME_BROWSER_PRERENDER_PRERENDER_MANAGER_FACTORY_H_ | 48 #endif // CHROME_BROWSER_PRERENDER_PRERENDER_MANAGER_FACTORY_H_ |
| OLD | NEW |