Index: chrome/browser/push_messaging/push_messaging_app_identifier.h |
diff --git a/chrome/browser/push_messaging/push_messaging_app_identifier.h b/chrome/browser/push_messaging/push_messaging_app_identifier.h |
index 6d64fc2be5f4066ed6b5a1ca7b493c9dc5a564db..20fb53040135a370fa7ec8d01537924261882dfb 100644 |
--- a/chrome/browser/push_messaging/push_messaging_app_identifier.h |
+++ b/chrome/browser/push_messaging/push_messaging_app_identifier.h |
@@ -24,13 +24,16 @@ extern const char kPushMessagingAppIdentifierPrefix[]; |
// Type used to identify a Service Worker registration from a Push API |
// perspective. These can be persisted to prefs, in a 1:1 mapping between |
-// app_id and pair<origin, service_worker_registration_id>. |
+// app_id (which includes origin) and service_worker_registration_id. |
+// Legacy mapped values saved by old versions of Chrome are also supported; |
+// these don't contain the origin in the app_id, so instead they map from |
+// app_id to pair<origin, service_worker_registration_id>. |
class PushMessagingAppIdentifier { |
public: |
// Register profile-specific prefs. |
static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry); |
- // Generates a new app identifier with random app_id. |
+ // Generates a new app identifier, with partially random app_id. |
static PushMessagingAppIdentifier Generate( |
const GURL& origin, |
int64_t service_worker_registration_id); |
@@ -63,7 +66,8 @@ class PushMessagingAppIdentifier { |
// String that should be passed to push services like GCM to identify a |
// particular Service Worker (so we can route incoming messages). Example: |
- // wp:9CC55CCE-B8F9-4092-A364-3B0F73A3AB5F |
+ // wp:https://foo.example.com:8443#9CC55CCE-B8F9-4092-A364-3B0F73A3AB5F |
+ // Legacy app_ids have no origin, e.g. wp:9CC55CCE-B8F9-4092-A364-3B0F73A3AB5F |
const std::string& app_id() const { |
DCHECK(!is_null()); |
return app_id_; |