| Index: components/gcm_driver/gcm_driver.cc
|
| diff --git a/components/gcm_driver/gcm_driver.cc b/components/gcm_driver/gcm_driver.cc
|
| index cebec36b0dab0f0e3cd56b5eb79faf5293980a46..bbaa206eb4f3b57ccffdf1774dede170b9483fed 100644
|
| --- a/components/gcm_driver/gcm_driver.cc
|
| +++ b/components/gcm_driver/gcm_driver.cc
|
| @@ -7,14 +7,17 @@
|
| #include <algorithm>
|
|
|
| #include "base/bind.h"
|
| +#include "base/files/file_path.h"
|
| #include "base/logging.h"
|
| #include "components/gcm_driver/gcm_app_handler.h"
|
|
|
| namespace gcm {
|
|
|
| -namespace {
|
| const size_t kMaxSenders = 100;
|
| -} // namespace
|
| +
|
| +// Directory in the GCM Store in which the encryption database will be stored.
|
| +const base::FilePath::CharType kEncryptionDirectoryName[] =
|
| + FILE_PATH_LITERAL("Encryption");
|
|
|
| InstanceIDHandler::InstanceIDHandler() {
|
| }
|
| @@ -27,7 +30,17 @@ void InstanceIDHandler::DeleteAllTokensForApp(
|
| DeleteToken(app_id, "*", "*", callback);
|
| }
|
|
|
| -GCMDriver::GCMDriver() : weak_ptr_factory_(this) {
|
| +GCMDriver::GCMDriver(
|
| + const base::FilePath& store_path,
|
| + const scoped_refptr<base::SequencedTaskRunner>& blocking_task_runner)
|
| + : weak_ptr_factory_(this) {
|
| + // The |blocking_task_runner| can be NULL for tests that do not need the
|
| + // encryption capabilities of the GCMDriver class.
|
| + if (blocking_task_runner) {
|
| + DCHECK(!store_path.empty());
|
| + encryption_provider_.Init(store_path.Append(kEncryptionDirectoryName),
|
| + blocking_task_runner);
|
| + }
|
| }
|
|
|
| GCMDriver::~GCMDriver() {
|
| @@ -149,6 +162,12 @@ void GCMDriver::Send(const std::string& app_id,
|
| SendImpl(app_id, receiver_id, message);
|
| }
|
|
|
| +void GCMDriver::GetPublicKey(
|
| + const std::string& app_id,
|
| + const GetPublicKeyCallback& callback) {
|
| + encryption_provider_.GetPublicKey(app_id, callback);
|
| +}
|
| +
|
| void GCMDriver::UnregisterWithSenderIdImpl(const std::string& app_id,
|
| const std::string& sender_id) {
|
| NOTREACHED();
|
|
|