Chromium Code Reviews| Index: components/gcm_driver/gcm_driver.h |
| diff --git a/components/gcm_driver/gcm_driver.h b/components/gcm_driver/gcm_driver.h |
| index 4095f3e41371c6d093684b56e3303b077992c56f..51f5b1bdfb52fc51e31213585dc08b6b27d8f33f 100644 |
| --- a/components/gcm_driver/gcm_driver.h |
| +++ b/components/gcm_driver/gcm_driver.h |
| @@ -11,12 +11,19 @@ |
| #include "base/callback.h" |
| #include "base/macros.h" |
| +#include "base/memory/ref_counted.h" |
| #include "base/memory/weak_ptr.h" |
| #include "base/threading/thread_checker.h" |
| #include "components/gcm_driver/common/gcm_messages.h" |
| +#include "components/gcm_driver/crypto/gcm_encryption_handler.h" |
| #include "components/gcm_driver/default_gcm_app_handler.h" |
| #include "components/gcm_driver/gcm_client.h" |
| +namespace base { |
| +class FilePath; |
| +class SequencedTaskRunner; |
| +} |
| + |
| namespace gcm { |
| class GCMAppHandler; |
| @@ -76,7 +83,9 @@ class GCMDriver { |
| typedef base::Callback<void(const GCMClient::GCMStatistics& stats)> |
| GetGCMStatisticsCallback; |
| - GCMDriver(); |
| + GCMDriver( |
| + const base::FilePath& store_path, |
| + const scoped_refptr<base::SequencedTaskRunner>& blocking_task_runner); |
| virtual ~GCMDriver(); |
| // Registers |sender_ids| for an app. A registration ID will be returned by |
| @@ -117,6 +126,13 @@ class GCMDriver { |
| const OutgoingMessage& message, |
| const SendCallback& callback); |
| + // Get the public encryption key associated with |app_id|. If no keys have |
| + // been associated with |app_id| yet, they will be created. The |callback| |
| + // will be invoked when it is available. |
| + void GetPublicEncryptionKey( |
|
jianli
2015/07/17 20:55:21
GetPublicKey
Peter Beverloo
2015/07/20 17:55:54
Done.
|
| + const std::string& app_id, |
| + const GCMEncryptionHandler::KeyCallback& callback); |
|
jianli
2015/07/17 20:55:21
We should try avoid referring something defined in
Peter Beverloo
2015/07/20 17:55:54
Done.
|
| + |
| const GCMAppHandlerMap& app_handlers() const { return app_handlers_; } |
| // This method must be called before destroying the GCMDriver. Once it has |
| @@ -274,6 +290,10 @@ class GCMDriver { |
| // Callback map (from <app_id, message_id> to callback) for Send. |
| std::map<std::pair<std::string, std::string>, SendCallback> send_callbacks_; |
| + // The encryption handler, used for key management and decryption of |
| + // encrypted, incoming messages. |
| + GCMEncryptionHandler encryption_handler_; |
| + |
| // App handler map (from app_id to handler pointer). |
| // The handler is not owned. |
| GCMAppHandlerMap app_handlers_; |