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

Side by Side Diff: mash/init/init.cc

Issue 2182643003: Remove shell::Connection* parameter to InterfaceFactory<T>::Create() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
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 | « mash/init/init.h ('k') | mash/login/login.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 "mash/init/init.h" 5 #include "mash/init/init.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/guid.h" 9 #include "base/guid.h"
10 #include "mash/login/public/interfaces/login.mojom.h" 10 #include "mash/login/public/interfaces/login.mojom.h"
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 user_services_[user_id] = std::move(connection); 43 user_services_[user_id] = std::move(connection);
44 } 44 }
45 } 45 }
46 46
47 void Init::StopServicesForUser(const mojo::String& user_id) { 47 void Init::StopServicesForUser(const mojo::String& user_id) {
48 auto it = user_services_.find(user_id); 48 auto it = user_services_.find(user_id);
49 if (it != user_services_.end()) 49 if (it != user_services_.end())
50 user_services_.erase(it); 50 user_services_.erase(it);
51 } 51 }
52 52
53 void Init::Create(shell::Connection* connection, mojom::InitRequest request) { 53 void Init::Create(const shell::Identity& remote_identity,
54 mojom::InitRequest request) {
54 init_bindings_.AddBinding(this, std::move(request)); 55 init_bindings_.AddBinding(this, std::move(request));
55 } 56 }
56 57
57 void Init::UserServiceQuit(const std::string& user_id) { 58 void Init::UserServiceQuit(const std::string& user_id) {
58 auto it = user_services_.find(user_id); 59 auto it = user_services_.find(user_id);
59 DCHECK(it != user_services_.end()); 60 DCHECK(it != user_services_.end());
60 user_services_.erase(it); 61 user_services_.erase(it);
61 } 62 }
62 63
63 void Init::StartTracing() { 64 void Init::StartTracing() {
64 connector_->Connect("mojo:tracing"); 65 connector_->Connect("mojo:tracing");
65 } 66 }
66 67
67 void Init::StartLogin() { 68 void Init::StartLogin() {
68 login_connection_ = connector_->Connect("mojo:login"); 69 login_connection_ = connector_->Connect("mojo:login");
69 login_connection_->AddInterface<mojom::Init>(this); 70 login_connection_->AddInterface<mojom::Init>(this);
70 mash::login::mojom::LoginPtr login; 71 mash::login::mojom::LoginPtr login;
71 login_connection_->GetInterface(&login); 72 login_connection_->GetInterface(&login);
72 login->ShowLoginUI(); 73 login->ShowLoginUI();
73 } 74 }
74 75
75 } // namespace init 76 } // namespace init
76 } // namespace main 77 } // namespace main
OLDNEW
« no previous file with comments | « mash/init/init.h ('k') | mash/login/login.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698