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

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..8e9c005e41141157e536f938d1139c82612f3bc9 100644
--- a/components/gcm_driver/crypto/gcm_key_store.cc
+++ b/components/gcm_driver/crypto/gcm_key_store.cc
@@ -22,10 +22,9 @@ enum class GCMKeyStore::State {
GCMKeyStore::GCMKeyStore(
const base::FilePath& key_store_path,
- scoped_refptr<base::SequencedTaskRunner> background_task_runner)
+ 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) {
}
@@ -168,6 +167,10 @@ void GCMKeyStore::LazyInitialize(const base::Closure& done_closure) {
state_ = State::INITIALIZING;
+ DCHECK(blocking_task_runner_);
jianli 2015/07/17 20:55:21 This DCHECK should be moved to constructor.
Peter Beverloo 2015/07/20 17:55:53 Done.
+ database_.reset(new leveldb_proto::ProtoDatabaseImpl<EncryptionData>(
+ blocking_task_runner_));
+
database_->Init(key_store_path_,
base::Bind(&GCMKeyStore::DidInitialize, this));
}

Powered by Google App Engine
This is Rietveld 408576698