OLD | NEW |
---|---|
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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 CONTENT_BROWSER_BACKGROUND_FETCH_BACKGROUND_FETCH_REGISTRATION_ID_H_ | 5 #ifndef CONTENT_BROWSER_BACKGROUND_FETCH_BACKGROUND_FETCH_REGISTRATION_ID_H_ |
6 #define CONTENT_BROWSER_BACKGROUND_FETCH_BACKGROUND_FETCH_REGISTRATION_ID_H_ | 6 #define CONTENT_BROWSER_BACKGROUND_FETCH_BACKGROUND_FETCH_REGISTRATION_ID_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 21 matching lines...) Expand all Loading... | |
32 bool operator==(const BackgroundFetchRegistrationId& other) const; | 32 bool operator==(const BackgroundFetchRegistrationId& other) const; |
33 bool operator!=(const BackgroundFetchRegistrationId& other) const; | 33 bool operator!=(const BackgroundFetchRegistrationId& other) const; |
34 | 34 |
35 // Enables this type to be used in an std::map and std::set. | 35 // Enables this type to be used in an std::map and std::set. |
36 // TODO(peter): Delete this when we switch away from using maps. | 36 // TODO(peter): Delete this when we switch away from using maps. |
37 bool operator<(const BackgroundFetchRegistrationId& other) const; | 37 bool operator<(const BackgroundFetchRegistrationId& other) const; |
38 | 38 |
39 // Returns whether this registration id refers to valid data. | 39 // Returns whether this registration id refers to valid data. |
40 bool is_null() const; | 40 bool is_null() const; |
41 | 41 |
42 void FromString(const std::string& str); | |
43 std::string ToString() const; | |
Peter Beverloo
2017/03/29 14:32:12
Could we call them Serialize and Deserialize(), wh
Peter Beverloo
2017/03/29 14:32:13
Also ++docs
harkness
2017/03/30 12:42:36
Done.
harkness
2017/03/30 12:42:36
Done.
| |
44 | |
42 int64_t service_worker_registration_id() const { | 45 int64_t service_worker_registration_id() const { |
43 return service_worker_registration_id_; | 46 return service_worker_registration_id_; |
44 } | 47 } |
45 const url::Origin& origin() const { return origin_; } | 48 const url::Origin& origin() const { return origin_; } |
46 const std::string& tag() const { return tag_; } | 49 const std::string& tag() const { return tag_; } |
47 | 50 |
48 private: | 51 private: |
49 int64_t service_worker_registration_id_; | 52 int64_t service_worker_registration_id_; |
50 url::Origin origin_; | 53 url::Origin origin_; |
51 std::string tag_; | 54 std::string tag_; |
52 }; | 55 }; |
53 | 56 |
54 } // namespace content | 57 } // namespace content |
55 | 58 |
56 #endif // CONTENT_BROWSER_BACKGROUND_FETCH_BACKGROUND_FETCH_REGISTRATION_ID_H_ | 59 #endif // CONTENT_BROWSER_BACKGROUND_FETCH_BACKGROUND_FETCH_REGISTRATION_ID_H_ |
OLD | NEW |