| 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 #include "content/browser/background_fetch/background_fetch_registration_id.h" | 5 #include "content/browser/background_fetch/background_fetch_registration_id.h" |
| 6 | 6 |
| 7 #include "content/common/service_worker/service_worker_types.h" | 7 #include "content/common/service_worker/service_worker_types.h" |
| 8 | 8 |
| 9 namespace content { | 9 namespace content { |
| 10 | 10 |
| 11 BackgroundFetchRegistrationId::BackgroundFetchRegistrationId() | 11 BackgroundFetchRegistrationId::BackgroundFetchRegistrationId() |
| 12 : service_worker_registration_id_(kInvalidServiceWorkerRegistrationId) {} | 12 : service_worker_registration_id_(kInvalidServiceWorkerRegistrationId) {} |
| 13 | 13 |
| 14 BackgroundFetchRegistrationId::BackgroundFetchRegistrationId( | 14 BackgroundFetchRegistrationId::BackgroundFetchRegistrationId( |
| 15 int64_t service_worker_registration_id, | 15 int64_t service_worker_registration_id, |
| 16 const url::Origin& origin, | 16 const url::Origin& origin, |
| 17 const std::string& tag) | 17 const std::string& tag) |
| 18 : service_worker_registration_id_(service_worker_registration_id), | 18 : service_worker_registration_id_(service_worker_registration_id), |
| 19 origin_(origin), | 19 origin_(origin), |
| 20 tag_(tag) {} | 20 tag_(tag) {} |
| 21 | 21 |
| 22 BackgroundFetchRegistrationId::BackgroundFetchRegistrationId( | 22 BackgroundFetchRegistrationId::BackgroundFetchRegistrationId( |
| 23 const BackgroundFetchRegistrationId& other) = default; |
| 24 |
| 25 BackgroundFetchRegistrationId::BackgroundFetchRegistrationId( |
| 23 BackgroundFetchRegistrationId&& other) = default; | 26 BackgroundFetchRegistrationId&& other) = default; |
| 24 | 27 |
| 25 BackgroundFetchRegistrationId::~BackgroundFetchRegistrationId() = default; | 28 BackgroundFetchRegistrationId::~BackgroundFetchRegistrationId() = default; |
| 26 | 29 |
| 27 BackgroundFetchRegistrationId& BackgroundFetchRegistrationId::operator=( | 30 BackgroundFetchRegistrationId& BackgroundFetchRegistrationId::operator=( |
| 28 const BackgroundFetchRegistrationId& other) = default; | 31 const BackgroundFetchRegistrationId& other) = default; |
| 29 | 32 |
| 30 bool BackgroundFetchRegistrationId::operator==( | 33 bool BackgroundFetchRegistrationId::operator==( |
| 31 const BackgroundFetchRegistrationId& other) const { | 34 const BackgroundFetchRegistrationId& other) const { |
| 32 return other.service_worker_registration_id_ == | 35 return other.service_worker_registration_id_ == |
| (...skipping 11 matching lines...) Expand all Loading... |
| 44 return service_worker_registration_id_ < | 47 return service_worker_registration_id_ < |
| 45 other.service_worker_registration_id_ || | 48 other.service_worker_registration_id_ || |
| 46 origin_ < other.origin_ || tag_ < other.tag_; | 49 origin_ < other.origin_ || tag_ < other.tag_; |
| 47 } | 50 } |
| 48 | 51 |
| 49 bool BackgroundFetchRegistrationId::is_null() const { | 52 bool BackgroundFetchRegistrationId::is_null() const { |
| 50 return service_worker_registration_id_ == kInvalidServiceWorkerRegistrationId; | 53 return service_worker_registration_id_ == kInvalidServiceWorkerRegistrationId; |
| 51 } | 54 } |
| 52 | 55 |
| 53 } // namespace content | 56 } // namespace content |
| OLD | NEW |