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

Side by Side Diff: components/cast_channel/cast_socket_service_factory.cc

Issue 2926313002: Revert of [cast_channel] Move cast_channel related files from //extensions to //components (Closed)
Patch Set: Created 3 years, 6 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 #include "components/cast_channel/cast_socket_service_factory.h"
6
7 #include "components/cast_channel/cast_socket_service.h"
8 #include "components/keyed_service/content/browser_context_dependency_manager.h"
9
10 namespace cast_channel {
11
12 using content::BrowserContext;
13
14 namespace {
15
16 base::LazyInstance<CastSocketServiceFactory>::DestructorAtExit service_factory =
17 LAZY_INSTANCE_INITIALIZER;
18 } // namespace
19
20 // static
21 scoped_refptr<CastSocketService> CastSocketServiceFactory::GetForBrowserContext(
22 BrowserContext* context) {
23 DCHECK(context);
24 // GetServiceForBrowserContext returns a KeyedService hence the static_cast<>
25 // to construct a temporary scoped_refptr on the stack for the return value.
26 return static_cast<CastSocketService*>(
27 service_factory.Get().GetServiceForBrowserContext(context, true).get());
28 }
29
30 // static
31 CastSocketServiceFactory* CastSocketServiceFactory::GetInstance() {
32 return &service_factory.Get();
33 }
34
35 CastSocketServiceFactory::CastSocketServiceFactory()
36 : RefcountedBrowserContextKeyedServiceFactory(
37 "CastSocketService",
38 BrowserContextDependencyManager::GetInstance()) {}
39
40 CastSocketServiceFactory::~CastSocketServiceFactory() {}
41
42 content::BrowserContext* CastSocketServiceFactory::GetBrowserContextToUse(
43 content::BrowserContext* context) const {
44 return context;
45 }
46
47 scoped_refptr<RefcountedKeyedService>
48 CastSocketServiceFactory::BuildServiceInstanceFor(
49 BrowserContext* context) const {
50 return make_scoped_refptr(new CastSocketService());
51 }
52
53 } // namespace cast_channel
OLDNEW
« no previous file with comments | « components/cast_channel/cast_socket_service_factory.h ('k') | components/cast_channel/cast_socket_service_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698