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

Unified Diff: components/gcm_driver/gcm_driver.h

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
« no previous file with comments | « components/gcm_driver/fake_gcm_driver.cc ('k') | components/gcm_driver/gcm_driver.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..572c02d8b793d035901b76021e924d4dbd04f9de 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_provider.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;
@@ -72,11 +79,14 @@ class GCMDriver {
GCMClient::Result result)> RegisterCallback;
typedef base::Callback<void(const std::string& message_id,
GCMClient::Result result)> SendCallback;
+ typedef base::Callback<void(const std::string&)> GetPublicKeyCallback;
typedef base::Callback<void(GCMClient::Result result)> UnregisterCallback;
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 +127,12 @@ 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 GetPublicKey(const std::string& app_id,
+ const GetPublicKeyCallback& callback);
+
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 provider, used for key management and decryption of
+ // encrypted, incoming messages.
+ GCMEncryptionProvider encryption_provider_;
+
// App handler map (from app_id to handler pointer).
// The handler is not owned.
GCMAppHandlerMap app_handlers_;
« no previous file with comments | « components/gcm_driver/fake_gcm_driver.cc ('k') | components/gcm_driver/gcm_driver.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698