| 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..e5b1d45804d2a3823add14b32f3443e8780ddae7
|
| --- /dev/null
|
| +++ b/content/public/browser/push_messaging_application_id.h
|
| @@ -0,0 +1,37 @@
|
| +// 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 {
|
| +
|
| +// Type used to identify an "application" from a Push API perspective.
|
| +struct CONTENT_EXPORT PushMessagingApplicationId {
|
| + public:
|
| + static PushMessagingApplicationId Parse(const std::string& id);
|
| + static bool IsValid(const std::string& id);
|
| +
|
| + PushMessagingApplicationId()
|
| + : origin(GURL::EmptyGURL()), worker_registration_id(-1) {}
|
| + PushMessagingApplicationId(GURL origin, int64 worker_registration_id)
|
| + : origin(origin), worker_registration_id(worker_registration_id) {}
|
| +
|
| + bool is_valid() { return origin.is_valid() && worker_registration_id >= 0; }
|
| +
|
| + std::string ToString();
|
| +
|
| + GURL origin;
|
| + int64 worker_registration_id;
|
| +};
|
| +
|
| +} // namespace content
|
| +
|
| +#endif // CONTENT_PUBLIC_BROWSER_PUSH_MESSAGING_APPLICATION_ID_H_
|
|
|