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 572c02d8b793d035901b76021e924d4dbd04f9de..169d751b2023bfdfa85db774477d896defb436ae 100644 |
| --- a/components/gcm_driver/gcm_driver.h |
| +++ b/components/gcm_driver/gcm_driver.h |
| @@ -265,6 +265,12 @@ class GCMDriver { |
| bool HasRegisterCallback(const std::string& app_id); |
| + // Dispatches the OnMessage event to the app handler associated with |app_id|. |
| + // If the |message| has been encrypted, it will be asynchronously decrypted |
| + // before being dispatched to the handler associated with |app_id|. |
| + void DispatchMessage(const std::string& app_id, |
| + const IncomingMessage& message); |
| + |
| void ClearCallbacks(); |
| private: |
| @@ -281,6 +287,11 @@ class GCMDriver { |
| const UnregisterCallback& unregister_callback, |
| GCMClient::Result result); |
| + // Dispatches |message| to |app_id| if the decryption was successful. |
| + void DispatchDecryptedMessage(const std::string& app_id, |
|
jianli
2015/08/04 00:49:30
This method might also dispatch an error event in
Peter Beverloo
2015/09/25 16:37:35
This doesn't apply anymore due to re-using Dispatc
|
| + const IncomingMessage& message, |
| + bool decryption_successful); |
| + |
| // Callback map (from app_id to callback) for Register. |
| std::map<std::string, RegisterCallback> register_callbacks_; |