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

Unified Diff: chrome/browser/chromeos/settings/device_settings_service.cc

Issue 20130002: Call crypto::InitializeTPMToken on the IO thread (Take 2) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix browser tests Created 7 years, 5 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/device_settings_service.cc
diff --git a/chrome/browser/chromeos/settings/device_settings_service.cc b/chrome/browser/chromeos/settings/device_settings_service.cc
index 8e6ce758768dd221721294e63e066a27ceeb62c1..14a89dda9163ad93bf9fe2abf15eeaaff2ea2c19 100644
--- a/chrome/browser/chromeos/settings/device_settings_service.cc
+++ b/chrome/browser/chromeos/settings/device_settings_service.cc
@@ -13,6 +13,7 @@
#include "chrome/browser/chromeos/settings/session_manager_operation.h"
#include "chrome/browser/policy/proto/chromeos/chrome_device_policy.pb.h"
#include "chrome/browser/policy/proto/cloud/device_management_backend.pb.h"
+#include "chromeos/network/network_handler.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/notification_service.h"
#include "content/public/browser/notification_source.h"
@@ -75,10 +76,14 @@ DeviceSettingsService::DeviceSettingsService()
weak_factory_(this),
store_status_(STORE_SUCCESS),
load_retries_left_(kMaxLoadRetries) {
+ if (NetworkHandler::IsInitialized())
Mattias Nissler (ping if slow) 2013/07/25 08:56:24 I'm a bit uncomfortable about the fact that we now
pneubeck (no reviews) 2013/07/25 09:08:43 CertLoader itself doesn't depend on any of the oth
stevenjb 2013/07/25 17:02:27 OK, I'll make CertLoader its own singleton. I agre
+ NetworkHandler::Get()->cert_loader()->AddObserver(this);
}
DeviceSettingsService::~DeviceSettingsService() {
DCHECK(pending_operations_.empty());
+ if (NetworkHandler::IsInitialized())
+ NetworkHandler::Get()->cert_loader()->RemoveObserver(this);
}
void DeviceSettingsService::SetSessionManager(
@@ -208,6 +213,14 @@ void DeviceSettingsService::PropertyChangeComplete(bool success) {
EnsureReload(false);
}
+void DeviceSettingsService::OnCertificatesLoaded(
+ const net::CertificateList& cert_list,
+ bool initial_load) {
+ // CertLoader initializes the TPM and NSS database which is necessary to
+ // determine ownership. Force a reload once we know these are initialized.
+ EnsureReload(true);
+}
+
void DeviceSettingsService::Enqueue(SessionManagerOperation* operation) {
pending_operations_.push_back(operation);
if (pending_operations_.front() == operation)

Powered by Google App Engine
This is Rietveld 408576698