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

Side by Side Diff: mojo/services/catalog/factory.cc

Issue 1844973002: Implement a system-level entry cache so that packages loaded from the system dir can be visible to … (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 8 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 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 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 "mojo/services/catalog/factory.h" 5 #include "mojo/services/catalog/factory.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "mojo/services/catalog/catalog.h" 8 #include "mojo/services/catalog/catalog.h"
9 #include "mojo/shell/public/cpp/connection.h" 9 #include "mojo/shell/public/cpp/connection.h"
10 #include "mojo/shell/public/cpp/shell_connection.h" 10 #include "mojo/shell/public/cpp/shell_connection.h"
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 GetCatalogForUserId(connection->GetRemoteIdentity().user_id()); 51 GetCatalogForUserId(connection->GetRemoteIdentity().user_id());
52 instance->BindCatalog(std::move(request)); 52 instance->BindCatalog(std::move(request));
53 } 53 }
54 54
55 Catalog* Factory::GetCatalogForUserId(const std::string& user_id) { 55 Catalog* Factory::GetCatalogForUserId(const std::string& user_id) {
56 auto it = catalogs_.find(user_id); 56 auto it = catalogs_.find(user_id);
57 if (it != catalogs_.end()) 57 if (it != catalogs_.end())
58 return it->second.get(); 58 return it->second.get();
59 59
60 // TODO(beng): There needs to be a way to load the store from different users. 60 // TODO(beng): There needs to be a way to load the store from different users.
61 Catalog* instance = new Catalog(std::move(store_), file_task_runner_); 61 Catalog* instance =
62 new Catalog(std::move(store_), file_task_runner_, &system_catalog_);
62 catalogs_[user_id] = make_scoped_ptr(instance); 63 catalogs_[user_id] = make_scoped_ptr(instance);
63 return instance; 64 return instance;
64 } 65 }
65 66
66 } // namespace catalog 67 } // namespace catalog
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698