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

Unified Diff: chrome/browser/services/gcm/push_messaging_service_impl.h

Issue 905713002: Push API: Fix registration failing because app handler is missing (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@countgrace
Patch Set: Avoid decreasing too often Created 5 years, 10 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 | « no previous file | chrome/browser/services/gcm/push_messaging_service_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/services/gcm/push_messaging_service_impl.h
diff --git a/chrome/browser/services/gcm/push_messaging_service_impl.h b/chrome/browser/services/gcm/push_messaging_service_impl.h
index 9cc53c08b73d2b11ba3168ee531d8b7b0c2f0397..a8db9a14ffcab514703214bf8976c5c71c1e3385 100644
--- a/chrome/browser/services/gcm/push_messaging_service_impl.h
+++ b/chrome/browser/services/gcm/push_messaging_service_impl.h
@@ -75,8 +75,9 @@ class PushMessagingServiceImpl : public content::PushMessagingService,
void SetProfileForTesting(Profile* profile);
private:
- void IncreasePushRegistrationCount(int add);
- void DecreasePushRegistrationCount(int subtract);
+ // A registration is pending until it has succeeded or failed.
+ void IncreasePushRegistrationCount(int add, bool is_pending);
+ void DecreasePushRegistrationCount(int subtract, bool was_pending);
void DeliverMessageCallback(const PushMessagingApplicationId& application_id,
const GCMClient::IncomingMessage& message,
@@ -120,15 +121,12 @@ class PushMessagingServiceImpl : public content::PushMessagingService,
// Helper method that checks if a given origin is allowed to use Push.
bool HasPermission(const GURL& origin);
- // Adds this service as an app handler to the GCMDriver if it has not been
- // added yet.
- void AddAppHandlerIfNecessary();
-
GCMProfileService* gcm_profile_service_; // It owns us.
Profile* profile_; // It owns our owner.
int push_registration_count_;
+ int pending_push_registration_count_;
base::WeakPtrFactory<PushMessagingServiceImpl> weak_factory_;
« no previous file with comments | « no previous file | chrome/browser/services/gcm/push_messaging_service_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698