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

Unified Diff: chromeos/network/network_handler.cc

Issue 15649018: Call crypto::InitializeTPMToken on the IO thread (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Test Created 7 years, 6 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: chromeos/network/network_handler.cc
diff --git a/chromeos/network/network_handler.cc b/chromeos/network/network_handler.cc
index 5eb2a87649014c88835bd890d3473fb5630d46b6..bdf54aabfddc1cba8789cbdeeb9544841ee25a63 100644
--- a/chromeos/network/network_handler.cc
+++ b/chromeos/network/network_handler.cc
@@ -39,7 +39,9 @@ NetworkHandler::~NetworkHandler() {
network_event_log::Shutdown();
}
-void NetworkHandler::Init() {
+void NetworkHandler::Init(
+ const scoped_refptr<base::SequencedTaskRunner>& io_task_runner) {
+ cert_loader_->Init(io_task_runner);
network_state_handler_->InitShillPropertyHandler();
network_configuration_handler_->Init(network_state_handler_.get());
managed_network_configuration_handler_->Init(
@@ -52,10 +54,21 @@ void NetworkHandler::Init() {
}
// static
-void NetworkHandler::Initialize() {
+void NetworkHandler::Initialize(
+ const scoped_refptr<base::SequencedTaskRunner>& io_task_runner) {
CHECK(!g_network_handler);
g_network_handler = new NetworkHandler();
- g_network_handler->Init();
+ g_network_handler->Init(io_task_runner);
+}
+
+// static
+void NetworkHandler::InitializeForTest() {
+ CHECK(!g_network_handler);
+ g_network_handler = new NetworkHandler();
+ // For Test, run IO operations on the curent thread.
+ scoped_refptr<base::SequencedTaskRunner> io_task_runner =
+ base::MessageLoopProxy::current();
+ g_network_handler->Init(io_task_runner);
}
// static

Powered by Google App Engine
This is Rietveld 408576698