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

Side by Side Diff: chrome/browser/services/gcm/push_messaging_application_id.h

Issue 404353003: Define PushMessagingApplicationId and replace ad-hoc code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments from jam and fgorski. Created 6 years, 5 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/services/gcm/push_messaging_application_id.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_SERVICES_GCM_PUSH_MESSAGING_APPLICATION_ID_H_
6 #define CHROME_BROWSER_SERVICES_GCM_PUSH_MESSAGING_APPLICATION_ID_H_
7
8 #include <string>
9
10 #include "base/basictypes.h"
11 #include "url/gurl.h"
12
13 namespace gcm {
14
15 // The prefix used for all push messaging application ids.
16 extern const char kPushMessagingApplicationIdPrefix[];
17
18 // Type used to identify a web app from a Push API perspective.
19 struct PushMessagingApplicationId {
20 public:
21 static PushMessagingApplicationId Parse(const std::string& id);
22
23 PushMessagingApplicationId()
24 : origin(GURL::EmptyGURL()), service_worker_registration_id(-1) {}
25 PushMessagingApplicationId(const GURL& origin,
26 int64 service_worker_registration_id)
27 : origin(origin),
28 service_worker_registration_id(service_worker_registration_id) {}
29
30 bool IsValid();
31 std::string ToString() const;
32
33 const GURL origin;
34 const int64 service_worker_registration_id;
35 };
36
37 } // namespace gcm
38
39 #endif // CHROME_BROWSER_SERVICES_GCM_PUSH_MESSAGING_APPLICATION_ID_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/services/gcm/push_messaging_application_id.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698