diff options
author | droger <droger@chromium.org> | 2015-01-27 02:20:23 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-01-27 10:21:06 +0000 |
commit | 13cf36de637ac1f4da4e5beb9197af29017ba6c5 (patch) | |
tree | e1c89ab021101ec891da173df7092d696d51cfbb /chrome/browser/browser_process_impl.cc | |
parent | 9593e7af0db1f65bb438fa0ccfa20ea90bedbecf (diff) | |
download | chromium_src-13cf36de637ac1f4da4e5beb9197af29017ba6c5.zip chromium_src-13cf36de637ac1f4da4e5beb9197af29017ba6c5.tar.gz chromium_src-13cf36de637ac1f4da4e5beb9197af29017ba6c5.tar.bz2 |
WebResourceService is no longer reference counted
WebResourceService was extending its own lifetime while network requests
were in progress. This was not needed, and made the lifetime management
of request contexts harder.
This CL removes this behavior and cancels the requests when the service
is deleted.
Finally, the virtual method GetRequestContext(), which was a workaround
for the lifetime issues, is removed.
BUG=447575
Review URL: https://codereview.chromium.org/872703003
Cr-Commit-Position: refs/heads/master@{#313254}
Diffstat (limited to 'chrome/browser/browser_process_impl.cc')
-rw-r--r-- | chrome/browser/browser_process_impl.cc | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/chrome/browser/browser_process_impl.cc b/chrome/browser/browser_process_impl.cc index d8b45ea..c64b40e 100644 --- a/chrome/browser/browser_process_impl.cc +++ b/chrome/browser/browser_process_impl.cc @@ -243,6 +243,10 @@ void BrowserProcessImpl::StartTearDown() { if (safe_browsing_service_.get()) safe_browsing_service()->ShutDown(); #endif + promo_resource_service_.reset(); +#if defined(ENABLE_PLUGIN_INSTALLATION) + plugins_resource_service_.reset(); +#endif // Need to clear the desktop notification balloons before the io_thread_ and // before the profiles, since if there are any still showing we will access @@ -1014,7 +1018,7 @@ void BrowserProcessImpl::PreMainMessageLoopRun() { #if defined(ENABLE_PLUGIN_INSTALLATION) DCHECK(!plugins_resource_service_.get()); - plugins_resource_service_ = new PluginsResourceService(local_state()); + plugins_resource_service_.reset(new PluginsResourceService(local_state())); plugins_resource_service_->Init(); #endif #endif // defined(ENABLE_PLUGINS) @@ -1023,7 +1027,7 @@ void BrowserProcessImpl::PreMainMessageLoopRun() { *base::CommandLine::ForCurrentProcess(); if (!command_line.HasSwitch(switches::kDisableWebResources)) { DCHECK(!promo_resource_service_.get()); - promo_resource_service_ = new PromoResourceService; + promo_resource_service_.reset(new PromoResourceService); promo_resource_service_->StartAfterDelay(); } |