| 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/profile_info_cache.h" | 5 #include "chrome/browser/profiles/profile_info_cache.h" |
| 6 | 6 |
| 7 #include <utility> |
| 8 |
| 7 #include "base/bind.h" | 9 #include "base/bind.h" |
| 8 #include "base/files/file_util.h" | 10 #include "base/files/file_util.h" |
| 9 #include "base/i18n/case_conversion.h" | 11 #include "base/i18n/case_conversion.h" |
| 10 #include "base/logging.h" | 12 #include "base/logging.h" |
| 11 #include "base/macros.h" | 13 #include "base/macros.h" |
| 12 #include "base/memory/scoped_ptr.h" | 14 #include "base/memory/scoped_ptr.h" |
| 13 #include "base/prefs/pref_registry_simple.h" | 15 #include "base/prefs/pref_registry_simple.h" |
| 14 #include "base/prefs/pref_service.h" | 16 #include "base/prefs/pref_service.h" |
| 15 #include "base/prefs/scoped_user_pref_update.h" | 17 #include "base/prefs/scoped_user_pref_update.h" |
| 16 #include "base/profiler/scoped_tracker.h" | 18 #include "base/profiler/scoped_tracker.h" |
| (...skipping 1348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1365 return false; | 1367 return false; |
| 1366 | 1368 |
| 1367 if (GetIndexOfProfileWithPath(path) == std::string::npos) | 1369 if (GetIndexOfProfileWithPath(path) == std::string::npos) |
| 1368 return false; | 1370 return false; |
| 1369 | 1371 |
| 1370 if (profile_attributes_entries_.find(path) == | 1372 if (profile_attributes_entries_.find(path) == |
| 1371 profile_attributes_entries_.end()) { | 1373 profile_attributes_entries_.end()) { |
| 1372 // The profile info is in the cache but its entry isn't created yet, insert | 1374 // The profile info is in the cache but its entry isn't created yet, insert |
| 1373 // it in the map. | 1375 // it in the map. |
| 1374 scoped_ptr<ProfileAttributesEntry> new_entry(new ProfileAttributesEntry()); | 1376 scoped_ptr<ProfileAttributesEntry> new_entry(new ProfileAttributesEntry()); |
| 1375 profile_attributes_entries_.add(path, new_entry.Pass()); | 1377 profile_attributes_entries_.add(path, std::move(new_entry)); |
| 1376 profile_attributes_entries_.get(path)->Initialize(this, path); | 1378 profile_attributes_entries_.get(path)->Initialize(this, path); |
| 1377 } | 1379 } |
| 1378 | 1380 |
| 1379 *entry = profile_attributes_entries_.get(path); | 1381 *entry = profile_attributes_entries_.get(path); |
| 1380 return true; | 1382 return true; |
| 1381 } | 1383 } |
| OLD | NEW |