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

Side by Side Diff: components/gcm_driver/gcm_driver.h

Issue 1243563002: Teach the GCM Driver how to decrypt incoming messages. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@gcm-push-keys
Patch Set: address comment Created 5 years, 2 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef COMPONENTS_GCM_DRIVER_GCM_DRIVER_H_ 5 #ifndef COMPONENTS_GCM_DRIVER_GCM_DRIVER_H_
6 #define COMPONENTS_GCM_DRIVER_GCM_DRIVER_H_ 6 #define COMPONENTS_GCM_DRIVER_GCM_DRIVER_H_
7 7
8 #include <map> 8 #include <map>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after
260 260
261 // Runs the Send callback. 261 // Runs the Send callback.
262 void SendFinished(const std::string& app_id, 262 void SendFinished(const std::string& app_id,
263 const std::string& message_id, 263 const std::string& message_id,
264 GCMClient::Result result); 264 GCMClient::Result result);
265 265
266 bool HasRegisterCallback(const std::string& app_id); 266 bool HasRegisterCallback(const std::string& app_id);
267 267
268 void ClearCallbacks(); 268 void ClearCallbacks();
269 269
270 // Dispatches the OnMessage event to the app handler associated with |app_id|.
271 // If |message| has been encrypted, it will be decrypted asynchronously and
272 // dispatched when the decryption operation was successful. Otherwise, the
273 // |message| will be dispatched immediately to the handler for |app_id|.
274 void DispatchMessage(const std::string& app_id,
275 const IncomingMessage& message);
276
270 private: 277 private:
271 // Common code shared by Unregister and UnregisterWithSenderId. 278 // Common code shared by Unregister and UnregisterWithSenderId.
272 void UnregisterInternal(const std::string& app_id, 279 void UnregisterInternal(const std::string& app_id,
273 const std::string* sender_id, 280 const std::string* sender_id,
274 const UnregisterCallback& callback); 281 const UnregisterCallback& callback);
275 282
276 // Called after unregistration completes in order to trigger the pending 283 // Called after unregistration completes in order to trigger the pending
277 // registration. 284 // registration.
278 void RegisterAfterUnregister( 285 void RegisterAfterUnregister(
279 const std::string& app_id, 286 const std::string& app_id,
(...skipping 22 matching lines...) Expand all
302 DefaultGCMAppHandler default_app_handler_; 309 DefaultGCMAppHandler default_app_handler_;
303 310
304 base::WeakPtrFactory<GCMDriver> weak_ptr_factory_; 311 base::WeakPtrFactory<GCMDriver> weak_ptr_factory_;
305 312
306 DISALLOW_COPY_AND_ASSIGN(GCMDriver); 313 DISALLOW_COPY_AND_ASSIGN(GCMDriver);
307 }; 314 };
308 315
309 } // namespace gcm 316 } // namespace gcm
310 317
311 #endif // COMPONENTS_GCM_DRIVER_GCM_DRIVER_H_ 318 #endif // COMPONENTS_GCM_DRIVER_GCM_DRIVER_H_
OLDNEW
« no previous file with comments | « components/gcm_driver/crypto/gcm_message_cryptographer.cc ('k') | components/gcm_driver/gcm_driver.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698