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

Unified Diff: chrome/browser/chromeos/settings/session_manager_operation.h

Issue 270663002: Implemented profile-aware owner key loading. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed DeviceOAuth2TokenServiceTest.* unit_tests. Created 6 years, 7 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
Index: chrome/browser/chromeos/settings/session_manager_operation.h
diff --git a/chrome/browser/chromeos/settings/session_manager_operation.h b/chrome/browser/chromeos/settings/session_manager_operation.h
index f15e0eba8fc3de5840af9d6686dfa866dfacfed6..37ed1cfc7f51c1f2b00d4fe75cb2f3a5fb3e2c23 100644
--- a/chrome/browser/chromeos/settings/session_manager_operation.h
+++ b/chrome/browser/chromeos/settings/session_manager_operation.h
@@ -11,6 +11,7 @@
#include "base/memory/scoped_ptr.h"
#include "chrome/browser/chromeos/policy/device_cloud_policy_validator.h"
#include "chrome/browser/chromeos/settings/device_settings_service.h"
+#include "crypto/scoped_nss_types.h"
namespace enterprise_management {
class ChromeDeviceSettingsProto;
@@ -66,6 +67,8 @@ class SessionManagerOperation {
force_key_load_ = force_key_load;
}
+ void set_username(const std::string& username) { username_ = username; }
+
protected:
// Runs the operation. The result is reported through |callback_|.
virtual void Run() = 0;
@@ -85,10 +88,20 @@ class SessionManagerOperation {
}
private:
+ // Calls LoadOwnerKey() on blocking pool and passes the result to
+ // StoreOwnerKey().
+ static void LoadAndStoreOwnerKey(
+ base::WeakPtr<SessionManagerOperation> weak_ptr,
+ scoped_refptr<OwnerKeyUtil> util,
+ scoped_refptr<OwnerKey> current_key,
+ const base::Closure& callback,
+ crypto::ScopedPK11Slot slot);
+
// Loads the owner key from disk. Must be run on a thread that can do I/O.
static scoped_refptr<OwnerKey> LoadOwnerKey(
scoped_refptr<OwnerKeyUtil> util,
- scoped_refptr<OwnerKey> current_key);
+ scoped_refptr<OwnerKey> current_key,
+ crypto::ScopedPK11Slot slot);
// Stores the owner key loaded by LoadOwnerKey and calls |callback|.
void StoreOwnerKey(const base::Closure& callback,
@@ -112,6 +125,7 @@ class SessionManagerOperation {
scoped_refptr<OwnerKey> owner_key_;
bool force_key_load_;
+ std::string username_;
bool is_loading_;
scoped_ptr<enterprise_management::PolicyData> policy_data_;

Powered by Google App Engine
This is Rietveld 408576698