| OLD | NEW |
| 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 CHROME_BROWSER_SERVICES_GCM_PUSH_MESSAGING_APPLICATION_ID_H_ | 5 #ifndef CHROME_BROWSER_SERVICES_GCM_PUSH_MESSAGING_APPLICATION_ID_H_ |
| 6 #define CHROME_BROWSER_SERVICES_GCM_PUSH_MESSAGING_APPLICATION_ID_H_ | 6 #define CHROME_BROWSER_SERVICES_GCM_PUSH_MESSAGING_APPLICATION_ID_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 ~PushMessagingApplicationId(); | 47 ~PushMessagingApplicationId(); |
| 48 | 48 |
| 49 // Persist this application id to disk. | 49 // Persist this application id to disk. |
| 50 void PersistToDisk(Profile* profile) const; | 50 void PersistToDisk(Profile* profile) const; |
| 51 | 51 |
| 52 // Delete this application id from disk. | 52 // Delete this application id from disk. |
| 53 void DeleteFromDisk(Profile* profile) const; // TODO: Does const make sense? | 53 void DeleteFromDisk(Profile* profile) const; // TODO: Does const make sense? |
| 54 | 54 |
| 55 bool IsValid() const; | 55 bool IsValid() const; |
| 56 | 56 |
| 57 const std::string app_id_guid; | 57 const std::string& app_id_guid() const { return app_id_guid_; } |
| 58 const GURL origin; | 58 const GURL& origin() const { return origin_; } |
| 59 const int64 service_worker_registration_id; | 59 int64 service_worker_registration_id() const { |
| 60 return service_worker_registration_id_; |
| 61 } |
| 60 | 62 |
| 61 private: | 63 private: |
| 62 friend class PushMessagingApplicationIdTest; | 64 friend class PushMessagingApplicationIdTest; |
| 63 | 65 |
| 64 // Constructs an invalid app id. | 66 // Constructs an invalid app id. |
| 65 PushMessagingApplicationId(); | 67 PushMessagingApplicationId(); |
| 66 // Constructs a valid app id. | 68 // Constructs a valid app id. |
| 67 PushMessagingApplicationId(const std::string& app_id_guid, | 69 PushMessagingApplicationId(const std::string& app_id_guid, |
| 68 const GURL& origin, | 70 const GURL& origin, |
| 69 int64 service_worker_registration_id); | 71 int64 service_worker_registration_id); |
| 72 |
| 73 const std::string app_id_guid_; |
| 74 const GURL origin_; |
| 75 const int64 service_worker_registration_id_; |
| 70 }; | 76 }; |
| 71 | 77 |
| 72 } // namespace gcm | 78 } // namespace gcm |
| 73 | 79 |
| 74 #endif // CHROME_BROWSER_SERVICES_GCM_PUSH_MESSAGING_APPLICATION_ID_H_ | 80 #endif // CHROME_BROWSER_SERVICES_GCM_PUSH_MESSAGING_APPLICATION_ID_H_ |
| OLD | NEW |