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

Unified Diff: chrome/browser/profiles/profile_impl.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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/profiles/profile_impl.cc
diff --git a/chrome/browser/profiles/profile_impl.cc b/chrome/browser/profiles/profile_impl.cc
index 5145a8c4602cdaced6ee32ae975754c974a63ce4..e672e24dfbb3c83504571a2efcb88d92767adf1f 100644
--- a/chrome/browser/profiles/profile_impl.cc
+++ b/chrome/browser/profiles/profile_impl.cc
@@ -279,6 +279,11 @@ PrefStore* CreateExtensionPrefStore(Profile* profile,
#endif
}
+bool IsValidProfile(Profile* profile) {
+ return g_browser_process && g_browser_process->profile_manager() &&
+ g_browser_process->profile_manager()->IsValidProfile(profile);
+}
+
} // namespace
// static
@@ -610,14 +615,23 @@ void ProfileImpl::DoFinalInit() {
session_cookie_mode = content::CookieStoreConfig::RESTORED_SESSION_COOKIES;
}
+ std::unique_ptr<reporting::ReportingNetworkDelegate::Handle>
+ reporting_handle =
+ base::MakeUnique<reporting::ReportingNetworkDelegate::Handle>();
+ reporting_handle->task_runner = base::MessageLoop::current()->task_runner();
+ reporting_handle->browser_context_is_valid =
+ base::Bind(&IsValidProfile, base::Unretained(this));
+
+ reporting_handle->browser_context = this;
+
// Make sure we initialize the ProfileIOData after everything else has been
// initialized that we might be reading from the IO thread.
- io_data_.Init(cookie_path, channel_id_path, cache_path,
- cache_max_size, media_cache_path, media_cache_max_size,
- extensions_cookie_path, GetPath(), predictor_,
- session_cookie_mode, GetSpecialStoragePolicy(),
- CreateDomainReliabilityMonitor(local_state));
+ io_data_.Init(
+ cookie_path, channel_id_path, cache_path, cache_max_size,
+ media_cache_path, media_cache_max_size, extensions_cookie_path, GetPath(),
+ predictor_, session_cookie_mode, GetSpecialStoragePolicy(),
+ CreateDomainReliabilityMonitor(local_state), std::move(reporting_handle));
#if defined(ENABLE_PLUGINS)
ChromePluginServiceFilter::GetInstance()->RegisterResourceContext(

Powered by Google App Engine
This is Rietveld 408576698