Index: content/public/browser/push_messaging_application_id.h |
diff --git a/content/public/browser/push_messaging_application_id.h b/content/public/browser/push_messaging_application_id.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..a3a6ff3d162efe9fe185b5b90f1e14b5bdda86a8 |
--- /dev/null |
+++ b/content/public/browser/push_messaging_application_id.h |
@@ -0,0 +1,40 @@ |
+// 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 CONTENT_PUBLIC_BROWSER_PUSH_MESSAGING_APPLICATION_ID_H_ |
+#define CONTENT_PUBLIC_BROWSER_PUSH_MESSAGING_APPLICATION_ID_H_ |
+ |
+#include <string> |
+ |
+#include "base/basictypes.h" |
+#include "content/common/content_export.h" |
+#include "url/gurl.h" |
+ |
+namespace content { |
+ |
+// The prefix used for all push messaging application ids. |
+CONTENT_EXPORT extern const char kPushMessagingApplicationIdPrefix[]; |
+ |
+// Type used to identify a web app from a Push API perspective. |
+struct CONTENT_EXPORT PushMessagingApplicationId { |
+ public: |
+ static PushMessagingApplicationId Parse(const std::string& id); |
+ |
+ PushMessagingApplicationId() |
+ : origin(GURL::EmptyGURL()), service_worker_registration_id(-1) {} |
+ PushMessagingApplicationId(const GURL& origin, |
+ int64 service_worker_registration_id) |
+ : origin(origin), |
+ service_worker_registration_id(service_worker_registration_id) {} |
+ |
+ bool IsValid(); |
+ std::string ToString(); |
+ |
+ const GURL origin; |
+ const int64 service_worker_registration_id; |
+}; |
+ |
+} // namespace content |
+ |
+#endif // CONTENT_PUBLIC_BROWSER_PUSH_MESSAGING_APPLICATION_ID_H_ |