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

Unified Diff: components/gcm_driver/crypto/gcm_key_store.cc

Issue 1231613005: Hook up the Push API with GCM's new ability to own encryption keys. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@gcm-encryption
Patch Set: Created 5 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: components/gcm_driver/crypto/gcm_key_store.cc
diff --git a/components/gcm_driver/crypto/gcm_key_store.cc b/components/gcm_driver/crypto/gcm_key_store.cc
index d445efe383aa41a9af84f8f3c654631230919293..0086291f35537ed209973c79dee92ac0452b479e 100644
--- a/components/gcm_driver/crypto/gcm_key_store.cc
+++ b/components/gcm_driver/crypto/gcm_key_store.cc
@@ -22,11 +22,11 @@ enum class GCMKeyStore::State {
GCMKeyStore::GCMKeyStore(
const base::FilePath& key_store_path,
- scoped_refptr<base::SequencedTaskRunner> background_task_runner)
+ const scoped_refptr<base::SequencedTaskRunner>& blocking_task_runner)
: key_store_path_(key_store_path),
- database_(new leveldb_proto::ProtoDatabaseImpl<EncryptionData>(
- background_task_runner)),
+ blocking_task_runner_(blocking_task_runner),
state_(State::UNINITIALIZED) {
+ DCHECK(blocking_task_runner);
}
GCMKeyStore::~GCMKeyStore() {}
@@ -168,6 +168,9 @@ void GCMKeyStore::LazyInitialize(const base::Closure& done_closure) {
state_ = State::INITIALIZING;
+ database_.reset(new leveldb_proto::ProtoDatabaseImpl<EncryptionData>(
+ blocking_task_runner_));
+
database_->Init(key_store_path_,
base::Bind(&GCMKeyStore::DidInitialize, this));
}
« no previous file with comments | « components/gcm_driver/crypto/gcm_key_store.h ('k') | components/gcm_driver/crypto/gcm_key_store_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698