diff options
author | droger <droger@chromium.org> | 2015-03-06 12:39:20 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-03-06 20:40:09 +0000 |
commit | 0a8d9a6cb29caf11ee23d8d3bc0a72bb6d0ab998 (patch) | |
tree | 70ee7523176f46c60fe691bcf1ffab80c88fe1eb /components/update_client | |
parent | dce2e0b5d89ebcc00482fe95494c9c2163d2f463 (diff) | |
download | chromium_src-0a8d9a6cb29caf11ee23d8d3bc0a72bb6d0ab998.zip chromium_src-0a8d9a6cb29caf11ee23d8d3bc0a72bb6d0ab998.tar.gz chromium_src-0a8d9a6cb29caf11ee23d8d3bc0a72bb6d0ab998.tar.bz2 |
Fix destruction order of PromoResourceService and NTPResourceCache
The existing code was leading to a crash:
- NTPResourceCache has a callback subscription on PromoResourceService
- PromoResourceService was deleted before NTPResourceCache
- When the NTPResourceCache was destroyed, it tried to remove itself
from the callback list, which no longer exists and crashes.
The bug was introduced by
https://codereview.chromium.org/926633002
This CL changes the destruction order so that the PromoResourceService
is deleted after NTPResourceCache (which is a keyed service and thus is
tied to the profile).
BUG=464391
Review URL: https://codereview.chromium.org/988433002
Cr-Commit-Position: refs/heads/master@{#319491}
Diffstat (limited to 'components/update_client')
-rw-r--r-- | components/update_client/update_query_params.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/components/update_client/update_query_params.cc b/components/update_client/update_query_params.cc index 7bb4db5..33bd00e 100644 --- a/components/update_client/update_query_params.cc +++ b/components/update_client/update_query_params.cc @@ -124,7 +124,7 @@ const char* UpdateQueryParams::GetNaclArch() { // static void UpdateQueryParams::SetDelegate(UpdateQueryParamsDelegate* delegate) { - DCHECK(!g_delegate || !delegate); + DCHECK(!g_delegate || !delegate || (delegate == g_delegate)); g_delegate = delegate; } |