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

Side by Side Diff: chrome/browser/media/router/discovery/dial/dial_registry_factory.h

Issue 2754703005: [Device Discovery] Make DialRegistry a Singleton (Closed)
Patch Set: Created 3 years, 9 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
(Empty)
1 // Copyright 2017 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_MEDIA_ROUTER_DISCOVERY_DIAL_DIAL_REGISTRY_FACTORY_H_
6 #define CHROME_BROWSER_MEDIA_ROUTER_DISCOVERY_DIAL_DIAL_REGISTRY_FACTORY_H_
7
8 #include "base/macros.h"
9 #include "base/memory/singleton.h"
10 #include "components/keyed_service/content/refcounted_browser_context_keyed_serv ice_factory.h"
11
12 namespace content {
13 class BrowserContext;
14 }
15
16 namespace media_router {
17
18 class DialRegistry;
19
20 // A factory that lazily returns a DialRegistry implementation for a given
21 // BrowserContext.
22 class DialRegistryFactory : public RefcountedBrowserContextKeyedServiceFactory {
23 public:
24 static scoped_refptr<DialRegistry> GetForBrowserContext(
mark a. foltz 2017/03/18 18:04:58 If DialRegistry is not profile-keyed, this could j
zhaobin 2017/03/22 02:48:45 Done.
25 content::BrowserContext* context);
26
27 static DialRegistryFactory* GetInstance();
28
29 private:
30 friend struct base::DefaultSingletonTraits<DialRegistryFactory>;
31
32 DialRegistryFactory();
33 ~DialRegistryFactory() override;
34
35 // BrowserContextKeyedServiceFactory interface.
36 content::BrowserContext* GetBrowserContextToUse(
37 content::BrowserContext* context) const override;
38
39 scoped_refptr<RefcountedKeyedService> BuildServiceInstanceFor(
40 content::BrowserContext* context) const override;
41
42 DISALLOW_COPY_AND_ASSIGN(DialRegistryFactory);
43 };
44
45 } // namespace media_router
46
47 #endif // CHROME_BROWSER_MEDIA_ROUTER_DISCOVERY_DIAL_DIAL_REGISTRY_FACTORY_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698