Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(193)

Side by Side Diff: chrome/browser/prerender/prerender_manager_factory.h

Issue 2321083002: [NoStatePrefetch] Add performance histograms. (Closed)
Patch Set: rename url_ to start_url_ Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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(
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_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698