| OLD | NEW |
| (Empty) |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "components/profile_service/user_id_map.h" | |
| 6 | |
| 7 #include <map> | |
| 8 | |
| 9 #include "base/lazy_instance.h" | |
| 10 | |
| 11 namespace profile { | |
| 12 | |
| 13 namespace { | |
| 14 base::LazyInstance<std::map<std::string, base::FilePath>> | |
| 15 g_user_id_to_data_dir = LAZY_INSTANCE_INITIALIZER; | |
| 16 } // namespace | |
| 17 | |
| 18 void AssociateMojoUserIDWithProfileDir(const std::string& user_id, | |
| 19 const base::FilePath& profile_data_dir) { | |
| 20 g_user_id_to_data_dir.Get()[user_id] = profile_data_dir; | |
| 21 } | |
| 22 | |
| 23 base::FilePath GetProfileDirForUserID(const std::string& user_id) { | |
| 24 auto it = g_user_id_to_data_dir.Get().find(user_id); | |
| 25 DCHECK(it != g_user_id_to_data_dir.Get().end()); | |
| 26 return it->second; | |
| 27 } | |
| 28 | |
| 29 } // namespace profile | |
| OLD | NEW |