| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/profile_keyed_service_factory.h" | 5 #include "chrome/browser/profiles/profile_keyed_service_factory.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <map> |
| 8 | 8 |
| 9 #include "base/memory/singleton.h" | 9 #include "base/memory/singleton.h" |
| 10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
| 11 #include "chrome/browser/profiles/profile_dependency_manager.h" | 11 #include "chrome/browser/profiles/profile_dependency_manager.h" |
| 12 #include "chrome/browser/profiles/profile_keyed_service.h" | 12 #include "chrome/browser/profiles/profile_keyed_service.h" |
| 13 | 13 |
| 14 void ProfileKeyedServiceFactory::SetTestingFactory(Profile* profile, | 14 void ProfileKeyedServiceFactory::SetTestingFactory(Profile* profile, |
| 15 FactoryFunction factory) { | 15 FactoryFunction factory) { |
| 16 ProfileShutdown(profile); | 16 ProfileShutdown(profile); |
| 17 ProfileDestroyed(profile); | 17 ProfileDestroyed(profile); |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 delete it->second; | 129 delete it->second; |
| 130 mapping_.erase(it); | 130 mapping_.erase(it); |
| 131 } | 131 } |
| 132 | 132 |
| 133 // For unit tests, we also remove the factory function both so we don't | 133 // For unit tests, we also remove the factory function both so we don't |
| 134 // maintain a big map of dead pointers, but also since we may have a second | 134 // maintain a big map of dead pointers, but also since we may have a second |
| 135 // object that lives at the same address (see other comments about unit tests | 135 // object that lives at the same address (see other comments about unit tests |
| 136 // in this file). | 136 // in this file). |
| 137 factories_.erase(profile); | 137 factories_.erase(profile); |
| 138 } | 138 } |
| OLD | NEW |