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( |