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

Side by Side Diff: components/reporting/content/browser/reporting_service_factory.cc

Issue 2249213002: [OBSOLETE] Reporting: Initial implementation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix ProfileImplIOData Created 4 years, 2 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 2016 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/reporting/content/browser/reporting_service_factory.h"
6
7 #include "base/bind.h"
8 #include "components/reporting/core/browser/reporting_service.h"
9 #include "content/public/browser/browser_context.h"
10 #include "content/public/browser/storage_partition.h"
11 #include "content/public/common/origin_util.h"
12
13 namespace reporting {
14
15 // static
16 ReportingService* ReportingServiceFactory::GetForBrowserContext(
17 content::BrowserContext* context,
18 bool create) {
19 return static_cast<ReportingService*>(
20 GetInstance()->GetServiceForBrowserContext(context, create));
21 }
22
23 // static
24 ReportingServiceFactory* ReportingServiceFactory::GetInstance() {
25 return base::Singleton<ReportingServiceFactory>::get();
26 }
27
28 ReportingServiceFactory::ReportingServiceFactory()
29 : BrowserContextKeyedServiceFactory(
30 "ReportingService",
31 BrowserContextDependencyManager::GetInstance()) {}
32
33 ReportingServiceFactory::~ReportingServiceFactory() {}
34
35 KeyedService* ReportingServiceFactory::BuildServiceInstanceFor(
36 content::BrowserContext* browser_context) const {
37 scoped_refptr<net::URLRequestContextGetter> request_context =
38 content::BrowserContext::GetDefaultStoragePartition(browser_context)
39 ->GetURLRequestContext();
40 std::unique_ptr<ReportingService> service(ReportingService::Create(
41 request_context, base::Bind(&content::IsOriginSecure)));
42 return service.release();
43 }
44
45 } // namespace reporting
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698