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

Side by Side Diff: services/user/user_shell_client.cc

Issue 2215133002: Change signature of OnConnect (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@cleanup
Patch Set: . Created 4 years, 4 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
« no previous file with comments | « services/user/user_shell_client.h ('k') | ui/ozone/platform/drm/ozone_platform_gbm.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "services/user/user_shell_client.h" 5 #include "services/user/user_shell_client.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/memory/ptr_util.h" 8 #include "base/memory/ptr_util.h"
9 #include "base/memory/weak_ptr.h" 9 #include "base/memory/weak_ptr.h"
10 #include "components/filesystem/lock_table.h" 10 #include "components/filesystem/lock_table.h"
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 leveldb_service_runner_->DeleteSoon(FROM_HERE, leveldb_objects_.release()); 88 leveldb_service_runner_->DeleteSoon(FROM_HERE, leveldb_objects_.release());
89 } 89 }
90 90
91 void UserShellClient::OnStart(const shell::Identity& identity) { 91 void UserShellClient::OnStart(const shell::Identity& identity) {
92 user_objects_.reset(new UserShellClient::UserServiceObjects( 92 user_objects_.reset(new UserShellClient::UserServiceObjects(
93 GetUserDirForUserId(identity.user_id()))); 93 GetUserDirForUserId(identity.user_id())));
94 leveldb_objects_.reset( 94 leveldb_objects_.reset(
95 new UserShellClient::LevelDBServiceObjects(leveldb_service_runner_)); 95 new UserShellClient::LevelDBServiceObjects(leveldb_service_runner_));
96 } 96 }
97 97
98 bool UserShellClient::OnConnect(shell::Connection* connection) { 98 bool UserShellClient::OnConnect(const shell::Identity& remote_identity,
99 connection->AddInterface<leveldb::mojom::LevelDBService>(this); 99 shell::InterfaceRegistry* registry) {
100 connection->AddInterface<mojom::UserService>(this); 100 registry->AddInterface<leveldb::mojom::LevelDBService>(this);
101 registry->AddInterface<mojom::UserService>(this);
101 return true; 102 return true;
102 } 103 }
103 104
104 void UserShellClient::Create(const shell::Identity& remote_identity, 105 void UserShellClient::Create(const shell::Identity& remote_identity,
105 mojom::UserServiceRequest request) { 106 mojom::UserServiceRequest request) {
106 user_service_runner_->PostTask( 107 user_service_runner_->PostTask(
107 FROM_HERE, 108 FROM_HERE,
108 base::Bind(&UserShellClient::UserServiceObjects::OnUserServiceRequest, 109 base::Bind(&UserShellClient::UserServiceObjects::OnUserServiceRequest,
109 user_objects_->AsWeakPtr(), remote_identity, 110 user_objects_->AsWeakPtr(), remote_identity,
110 base::Passed(&request))); 111 base::Passed(&request)));
111 } 112 }
112 113
113 void UserShellClient::Create(const shell::Identity& remote_identity, 114 void UserShellClient::Create(const shell::Identity& remote_identity,
114 leveldb::mojom::LevelDBServiceRequest request) { 115 leveldb::mojom::LevelDBServiceRequest request) {
115 leveldb_service_runner_->PostTask( 116 leveldb_service_runner_->PostTask(
116 FROM_HERE, 117 FROM_HERE,
117 base::Bind( 118 base::Bind(
118 &UserShellClient::LevelDBServiceObjects::OnLevelDBServiceRequest, 119 &UserShellClient::LevelDBServiceObjects::OnLevelDBServiceRequest,
119 leveldb_objects_->AsWeakPtr(), remote_identity, 120 leveldb_objects_->AsWeakPtr(), remote_identity,
120 base::Passed(&request))); 121 base::Passed(&request)));
121 } 122 }
122 123
123 } // namespace user_service 124 } // namespace user_service
OLDNEW
« no previous file with comments | « services/user/user_shell_client.h ('k') | ui/ozone/platform/drm/ozone_platform_gbm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698