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

Side by Side Diff: chromeos/dbus/session_manager_client.h

Issue 2801993002: Abandon user sign in when policy is retrieved before session started (Closed)
Patch Set: Added comments to new functions 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #ifndef CHROMEOS_DBUS_SESSION_MANAGER_CLIENT_H_ 5 #ifndef CHROMEOS_DBUS_SESSION_MANAGER_CLIENT_H_
6 #define CHROMEOS_DBUS_SESSION_MANAGER_CLIENT_H_ 6 #define CHROMEOS_DBUS_SESSION_MANAGER_CLIENT_H_
7 7
8 #include <map> 8 #include <map>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 virtual void RetrieveActiveSessions( 140 virtual void RetrieveActiveSessions(
141 const ActiveSessionsCallback& callback) = 0; 141 const ActiveSessionsCallback& callback) = 0;
142 142
143 // Used for RetrieveDevicePolicy, RetrievePolicyForUser and 143 // Used for RetrieveDevicePolicy, RetrievePolicyForUser and
144 // RetrieveDeviceLocalAccountPolicy. Takes a serialized protocol buffer as 144 // RetrieveDeviceLocalAccountPolicy. Takes a serialized protocol buffer as
145 // string. Upon success, we will pass a protobuf to the callback. On 145 // string. Upon success, we will pass a protobuf to the callback. On
146 // failure, we will pass "". 146 // failure, we will pass "".
147 using RetrievePolicyCallback = 147 using RetrievePolicyCallback =
148 base::Callback<void(const std::string& protobuf)>; 148 base::Callback<void(const std::string& protobuf)>;
149 149
150 // Used to RetrievePolicyForUserWithErrorCallback. Triggered when the
151 // D-Bus request fails.
152 using ErrorCallback = base::Callback<void(const std::string& error_name,
Daniel Erat 2017/04/10 18:59:26 mentioned earlier, but this should pass an enum ra
Andrew T Wilson (Slow) 2017/04/11 13:35:04 +1 as this lets us log UMA stats for it.
igorcov 2017/04/18 10:23:18 Done.
153 const std::string& error_message)>;
154
150 // Fetches the device policy blob stored by the session manager. Upon 155 // Fetches the device policy blob stored by the session manager. Upon
151 // completion of the retrieve attempt, we will call the provided callback. 156 // completion of the retrieve attempt, we will call the provided callback.
152 virtual void RetrieveDevicePolicy(const RetrievePolicyCallback& callback) = 0; 157 virtual void RetrieveDevicePolicy(const RetrievePolicyCallback& callback) = 0;
153 158
154 // Same as RetrieveDevicePolicy() but blocks until a reply is received, and 159 // Same as RetrieveDevicePolicy() but blocks until a reply is received, and
155 // returns the policy synchronously. Returns an empty string if the method 160 // returns the policy synchronously. Returns an empty string if the method
156 // call fails. 161 // call fails.
157 // This may only be called in situations where blocking the UI thread is 162 // This may only be called in situations where blocking the UI thread is
158 // considered acceptable (e.g. restarting the browser after a crash or after 163 // considered acceptable (e.g. restarting the browser after a crash or after
159 // a flag change). 164 // a flag change).
160 // TODO: Get rid of blocking calls (crbug.com/160522). 165 // TODO: Get rid of blocking calls (crbug.com/160522).
161 virtual std::string BlockingRetrieveDevicePolicy() = 0; 166 virtual std::string BlockingRetrieveDevicePolicy() = 0;
162 167
163 // Fetches the user policy blob stored by the session manager for the given 168 // Fetches the user policy blob stored by the session manager for the given
164 // |cryptohome_id|. Upon completion of the retrieve attempt, we will call the 169 // |cryptohome_id|. Upon completion of the retrieve attempt, we will call the
165 // provided callback. 170 // provided callback.
166 virtual void RetrievePolicyForUser( 171 virtual void RetrievePolicyForUser(
167 const cryptohome::Identification& cryptohome_id, 172 const cryptohome::Identification& cryptohome_id,
168 const RetrievePolicyCallback& callback) = 0; 173 const RetrievePolicyCallback& callback) = 0;
169 174
175 // Same as RetrievePolicyForUser() but the error_callback is invoked in case
176 // of an error.
177 virtual void RetrievePolicyForUserWithErrorCallback(
Daniel Erat 2017/04/10 18:59:26 please use a single method and update callers inst
igorcov 2017/04/18 10:23:18 Done.
178 const cryptohome::Identification& cryptohome_id,
179 const RetrievePolicyCallback& callback,
180 const ErrorCallback& error_callback) = 0;
181
170 // Same as RetrievePolicyForUser() but blocks until a reply is received, and 182 // Same as RetrievePolicyForUser() but blocks until a reply is received, and
171 // returns the policy synchronously. Returns an empty string if the method 183 // returns the policy synchronously. Returns an empty string if the method
172 // call fails. 184 // call fails.
173 // This may only be called in situations where blocking the UI thread is 185 // This may only be called in situations where blocking the UI thread is
174 // considered acceptable (e.g. restarting the browser after a crash or after 186 // considered acceptable (e.g. restarting the browser after a crash or after
175 // a flag change). 187 // a flag change).
176 // TODO: Get rid of blocking calls (crbug.com/160522). 188 // TODO: Get rid of blocking calls (crbug.com/160522).
177 virtual std::string BlockingRetrievePolicyForUser( 189 virtual std::string BlockingRetrievePolicyForUser(
178 const cryptohome::Identification& cryptohome_id) = 0; 190 const cryptohome::Identification& cryptohome_id) = 0;
179 191
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
313 // Create() should be used instead. 325 // Create() should be used instead.
314 SessionManagerClient(); 326 SessionManagerClient();
315 327
316 private: 328 private:
317 DISALLOW_COPY_AND_ASSIGN(SessionManagerClient); 329 DISALLOW_COPY_AND_ASSIGN(SessionManagerClient);
318 }; 330 };
319 331
320 } // namespace chromeos 332 } // namespace chromeos
321 333
322 #endif // CHROMEOS_DBUS_SESSION_MANAGER_CLIENT_H_ 334 #endif // CHROMEOS_DBUS_SESSION_MANAGER_CLIENT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698