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

Side by Side Diff: extensions/browser/api/cast_channel/cast_socket_service_factory.h

Issue 2891023002: [cast_channel] Make CastSocket not inherit from ApiResource (Closed)
Patch Set: resolve code review comments from Derek Created 3 years, 7 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 EXTENSIONS_BROWSER_API_CAST_CHANNEL_CAST_CHANNEL_SERVICE_FACTORY_H_
6 #define EXTENSIONS_BROWSER_API_CAST_CHANNEL_CAST_CHANNEL_SERVICE_FACTORY_H_
7
8 #include "base/lazy_instance.h"
9 #include "base/macros.h"
10 #include "components/keyed_service/content/browser_context_keyed_service_factory .h"
11
12 namespace extensions {
13 namespace api {
14 namespace cast_channel {
15
16 class CastSocketService;
17
18 // TODO(crbug.com/725717): CastSocket created by one profile (browser context)
19 // could be shared with other profiles.
20 class CastSocketServiceFactory : public BrowserContextKeyedServiceFactory {
21 public:
22 // Caller needs to make sure that it passes in the same |context| instance to
23 // this function for both normal profile and incognito profile.
24 static CastSocketService* GetForBrowserContext(
25 content::BrowserContext* context);
26
27 static CastSocketServiceFactory* GetInstance();
28
29 private:
30 friend struct base::LazyInstanceTraitsBase<CastSocketServiceFactory>;
31
32 CastSocketServiceFactory();
33 ~CastSocketServiceFactory() override;
34
35 // BrowserContextKeyedServiceFactory interface.
36 content::BrowserContext* GetBrowserContextToUse(
37 content::BrowserContext* context) const override;
38
39 KeyedService* BuildServiceInstanceFor(
40 content::BrowserContext* context) const override;
41
42 DISALLOW_COPY_AND_ASSIGN(CastSocketServiceFactory);
43 };
44
45 } // namespace cast_channel
46 } // namespace api
47 } // namespace extensions
48
49 #endif // EXTENSIONS_BROWSER_API_CAST_CHANNEL_CAST_CHANNEL_SERVICE_FACTORY_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698