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

Unified Diff: chrome/browser/profiles/profile_impl_io_data.cc

Issue 2769083005: Reporting: Set up in ProfileImplIOData. (Closed)
Patch Set: rebase Created 3 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/profiles/profile_impl_io_data.h ('k') | chrome/browser/profiles/profile_io_data.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/profiles/profile_impl_io_data.cc
diff --git a/chrome/browser/profiles/profile_impl_io_data.cc b/chrome/browser/profiles/profile_impl_io_data.cc
index c4fe90c0986e7023897ced4209a3ec270d5ec8b5..ae46c2ba5428e59892f0c77cdfd96cd0a70707e4 100644
--- a/chrome/browser/profiles/profile_impl_io_data.cc
+++ b/chrome/browser/profiles/profile_impl_io_data.cc
@@ -65,6 +65,9 @@
#include "net/http/http_cache.h"
#include "net/http/http_network_session.h"
#include "net/http/http_server_properties_manager.h"
+#include "net/reporting/reporting_feature.h"
+#include "net/reporting/reporting_policy.h"
+#include "net/reporting/reporting_service.h"
#include "net/ssl/channel_id_service.h"
#include "net/url_request/url_request_context_storage.h"
#include "net/url_request/url_request_intercepting_job_factory.h"
@@ -552,6 +555,9 @@ void ProfileImplIOData::InitializeInternal(
InitializeExtensionsRequestContext(profile_params);
#endif
+ main_context_storage->set_reporting_service(
+ MaybeCreateReportingService(main_context));
+
// Create a media request context based on the main context, but using a
// media cache. It shares the same job factory as the main context.
StoragePartitionDescriptor details(profile_path_, false);
@@ -696,6 +702,8 @@ net::URLRequestContext* ProfileImplIOData::InitializeAppRequestContext(
context->host_resolver()));
context->SetJobFactory(std::move(top_job_factory));
+ context->SetReportingService(MaybeCreateReportingService(context));
+
return context;
}
@@ -784,6 +792,16 @@ chrome_browser_net::Predictor* ProfileImplIOData::GetPredictor() {
return predictor_.get();
}
+std::unique_ptr<net::ReportingService>
+ProfileImplIOData::MaybeCreateReportingService(
+ net::URLRequestContext* url_request_context) const {
+ if (!base::FeatureList::IsEnabled(features::kReporting))
+ return std::unique_ptr<net::ReportingService>();
+
+ return net::ReportingService::Create(net::ReportingPolicy(),
+ url_request_context);
+}
+
void ProfileImplIOData::ClearNetworkingHistorySinceOnIOThread(
base::Time time,
const base::Closure& completion) {
« no previous file with comments | « chrome/browser/profiles/profile_impl_io_data.h ('k') | chrome/browser/profiles/profile_io_data.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698