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

Unified Diff: chrome/browser/prefs/active_profile_pref_service.cc

Issue 2795883002: Eliminate OnConnect usage (Closed)
Patch Set: . Created 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/prefs/active_profile_pref_service.h ('k') | chrome/browser/ui/ash/ash_util.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/prefs/active_profile_pref_service.cc
diff --git a/chrome/browser/prefs/active_profile_pref_service.cc b/chrome/browser/prefs/active_profile_pref_service.cc
index bafda8eec02a600352f9a6c2aeb2cab083366c2d..d674c31028ec73ecaccb291e51ef5aab68fefd5f 100644
--- a/chrome/browser/prefs/active_profile_pref_service.cc
+++ b/chrome/browser/prefs/active_profile_pref_service.cc
@@ -8,9 +8,10 @@
#include "content/public/browser/browser_context.h"
#include "mojo/public/cpp/bindings/interface_request.h"
#include "services/service_manager/public/cpp/connector.h"
-#include "services/service_manager/public/cpp/interface_registry.h"
-ActiveProfilePrefService::ActiveProfilePrefService() = default;
+ActiveProfilePrefService::ActiveProfilePrefService() {
+ registry_.AddInterface<prefs::mojom::PrefStoreConnector>(this);
+}
ActiveProfilePrefService::~ActiveProfilePrefService() = default;
@@ -35,21 +36,23 @@ void ActiveProfilePrefService::Create(
void ActiveProfilePrefService::OnStart() {}
-bool ActiveProfilePrefService::OnConnect(
- const service_manager::ServiceInfo& remote_info,
- service_manager::InterfaceRegistry* registry) {
+void ActiveProfilePrefService::OnBindInterface(
+ const service_manager::ServiceInfo& source_info,
+ const std::string& interface_name,
+ mojo::ScopedMessagePipeHandle interface_pipe) {
// N.B. This check is important as not doing it would allow one user to read
// another user's prefs.
- if (remote_info.identity.user_id() != service_manager::mojom::kRootUserID) {
+ // TODO(beng): This should be obsoleted by Service Manager user id routing.
+ if (source_info.identity.user_id() != service_manager::mojom::kRootUserID) {
LOG(WARNING) << "Blocked service instance="
- << remote_info.identity.instance()
- << ", name=" << remote_info.identity.name()
- << ", user_id=" << remote_info.identity.user_id()
+ << source_info.identity.instance()
+ << ", name=" << source_info.identity.name()
+ << ", user_id=" << source_info.identity.user_id()
<< " from connecting to the active profile's pref service.";
- return false;
+ return;
}
- registry->AddInterface<prefs::mojom::PrefStoreConnector>(this);
- return true;
+ registry_.BindInterface(source_info.identity, interface_name,
+ std::move(interface_pipe));
}
void ActiveProfilePrefService::OnConnectError() {
« no previous file with comments | « chrome/browser/prefs/active_profile_pref_service.h ('k') | chrome/browser/ui/ash/ash_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698