Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(644)

Unified Diff: components/profile_service/user_id_map.cc

Issue 1737933002: mojo leveldb: Get profile and leveldb connected to DOMStorageContext. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove stray mark. Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: components/profile_service/user_id_map.cc
diff --git a/components/profile_service/user_id_map.cc b/components/profile_service/user_id_map.cc
new file mode 100644
index 0000000000000000000000000000000000000000..a5e54e42a437ea8f29eb4470a4ef63ddc2fdbc7a
--- /dev/null
+++ b/components/profile_service/user_id_map.cc
@@ -0,0 +1,29 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "components/profile_service/user_id_map.h"
+
+#include <map>
+
+#include "base/lazy_instance.h"
+
+namespace profile {
+
+namespace {
+base::LazyInstance<std::map<std::string, base::FilePath>>
+ g_user_id_to_data_dir = LAZY_INSTANCE_INITIALIZER;
+} // namespace
+
+void AssociateMojoUserIDWithProfileDir(const std::string& user_id,
+ const base::FilePath& profile_data_dir) {
+ g_user_id_to_data_dir.Get()[user_id] = profile_data_dir;
+}
+
+base::FilePath GetProfileDirForUserID(const std::string& user_id) {
+ auto it = g_user_id_to_data_dir.Get().find(user_id);
+ DCHECK(it != g_user_id_to_data_dir.Get().end());
+ return it->second;
+}
+
+} // namespace profile

Powered by Google App Engine
This is Rietveld 408576698