OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/profiles/refcounted_profile_keyed_service_factory.h" | 5 #include "chrome/browser/profiles/refcounted_profile_keyed_service_factory.h" |
6 | 6 |
| 7 #include "base/logging.h" |
7 #include "chrome/browser/profiles/profile_keyed_service.h" | 8 #include "chrome/browser/profiles/profile_keyed_service.h" |
8 #include "chrome/browser/profiles/refcounted_profile_keyed_service.h" | 9 #include "chrome/browser/profiles/refcounted_profile_keyed_service.h" |
9 #include "content/public/browser/browser_thread.h" | 10 #include "content/public/browser/browser_thread.h" |
10 | 11 |
11 using content::BrowserThread; | 12 using content::BrowserThread; |
12 | 13 |
13 RefcountedProfileKeyedServiceFactory::RefcountedProfileKeyedServiceFactory( | 14 RefcountedProfileKeyedServiceFactory::RefcountedProfileKeyedServiceFactory( |
14 const char* name, | 15 const char* name, |
15 ProfileDependencyManager* manager) | 16 ProfileDependencyManager* manager) |
16 : ProfileKeyedBaseFactory(name, manager) { | 17 : ProfileKeyedBaseFactory(name, manager) { |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 void RefcountedProfileKeyedServiceFactory::ProfileDestroyed(Profile* profile) { | 52 void RefcountedProfileKeyedServiceFactory::ProfileDestroyed(Profile* profile) { |
52 RefCountedStorage::iterator it = mapping_.find(profile); | 53 RefCountedStorage::iterator it = mapping_.find(profile); |
53 if (it != mapping_.end()) { | 54 if (it != mapping_.end()) { |
54 // We "merely" drop our reference to the service. Hopefully this will cause | 55 // We "merely" drop our reference to the service. Hopefully this will cause |
55 // the service to be destroyed. If not, oh well. | 56 // the service to be destroyed. If not, oh well. |
56 mapping_.erase(it); | 57 mapping_.erase(it); |
57 } | 58 } |
58 | 59 |
59 ProfileKeyedBaseFactory::ProfileDestroyed(profile); | 60 ProfileKeyedBaseFactory::ProfileDestroyed(profile); |
60 } | 61 } |
OLD | NEW |