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

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

Issue 955673004: Move gcm-independent parts of push messaging out of gcm namespace and directory (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove redundant cast 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
Index: chrome/browser/services/gcm/push_messaging_application_id.h
diff --git a/chrome/browser/services/gcm/push_messaging_application_id.h b/chrome/browser/services/gcm/push_messaging_application_id.h
deleted file mode 100644
index ddb24d64dbbea8a648c49fdaeba152785e0f3bf7..0000000000000000000000000000000000000000
--- a/chrome/browser/services/gcm/push_messaging_application_id.h
+++ /dev/null
@@ -1,85 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef CHROME_BROWSER_SERVICES_GCM_PUSH_MESSAGING_APPLICATION_ID_H_
-#define CHROME_BROWSER_SERVICES_GCM_PUSH_MESSAGING_APPLICATION_ID_H_
-
-#include <string>
-#include <vector>
-
-#include "base/basictypes.h"
-#include "url/gurl.h"
-
-class Profile;
-
-namespace user_prefs {
-class PrefRegistrySyncable;
-}
-
-namespace gcm {
-
-// The prefix used for all push messaging application ids.
-extern const char kPushMessagingApplicationIdPrefix[];
-
-// Type used to identify a web app from a Push API perspective.
-// These can be persisted to disk, in a 1:1 mapping between app_id_guid and
-// pair<origin, service_worker_registration_id>.
-class PushMessagingApplicationId {
- public:
- // Register profile-specific prefs.
- static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry);
-
- // Generates a new application id with random app_id_guid.
- static PushMessagingApplicationId Generate(
- const GURL& origin,
- int64 service_worker_registration_id);
-
- // Looks up an application id by app_id_guid. Will be invalid if not found.
- static PushMessagingApplicationId Get(Profile* profile,
- const std::string& app_id_guid);
-
- // Looks up an application id by origin & service worker registration id.
- // Will be invalid if not found.
- static PushMessagingApplicationId Get(Profile* profile,
- const GURL& origin,
- int64 service_worker_registration_id);
-
- // Returns all the PushMessagingApplicationId currently registered for the
- // given |profile|.
- static std::vector<PushMessagingApplicationId> GetAll(Profile* profile);
-
- ~PushMessagingApplicationId();
-
- // Persist this application id to disk.
- void PersistToDisk(Profile* profile) const;
-
- // Delete this application id from disk.
- void DeleteFromDisk(Profile* profile) const; // TODO: Does const make sense?
-
- bool IsValid() const;
-
- const std::string& app_id_guid() const { return app_id_guid_; }
- const GURL& origin() const { return origin_; }
- int64 service_worker_registration_id() const {
- return service_worker_registration_id_;
- }
-
- private:
- friend class PushMessagingApplicationIdTest;
-
- // Constructs an invalid app id.
- PushMessagingApplicationId();
- // Constructs a valid app id.
- PushMessagingApplicationId(const std::string& app_id_guid,
- const GURL& origin,
- int64 service_worker_registration_id);
-
- std::string app_id_guid_;
- GURL origin_;
- int64 service_worker_registration_id_;
-};
-
-} // namespace gcm
-
-#endif // CHROME_BROWSER_SERVICES_GCM_PUSH_MESSAGING_APPLICATION_ID_H_
« no previous file with comments | « chrome/browser/services/gcm/gcm_profile_service.cc ('k') | chrome/browser/services/gcm/push_messaging_application_id.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698