| 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 namespace content { | 7 namespace content { |
| 8 | 8 |
| 9 BackgroundFetchRegistrationId::BackgroundFetchRegistrationId( | 9 BackgroundFetchRegistrationId::BackgroundFetchRegistrationId( |
| 10 int64_t service_worker_registration_id, | 10 int64_t service_worker_registration_id, |
| 11 const url::Origin& origin, | 11 const url::Origin& origin, |
| 12 const std::string& tag) | 12 const std::string& tag) |
| 13 : service_worker_registration_id_(service_worker_registration_id), | 13 : service_worker_registration_id_(service_worker_registration_id), |
| 14 origin_(origin), | 14 origin_(origin), |
| 15 tag_(tag) {} | 15 tag_(tag) {} |
| 16 | 16 |
| 17 BackgroundFetchRegistrationId::BackgroundFetchRegistrationId( | 17 BackgroundFetchRegistrationId::BackgroundFetchRegistrationId( |
| 18 const BackgroundFetchRegistrationId& other) = default; |
| 19 |
| 20 BackgroundFetchRegistrationId::BackgroundFetchRegistrationId( |
| 18 BackgroundFetchRegistrationId&& other) = default; | 21 BackgroundFetchRegistrationId&& other) = default; |
| 19 | 22 |
| 20 BackgroundFetchRegistrationId::~BackgroundFetchRegistrationId() = default; | 23 BackgroundFetchRegistrationId::~BackgroundFetchRegistrationId() = default; |
| 21 | 24 |
| 22 bool BackgroundFetchRegistrationId::operator==( | 25 bool BackgroundFetchRegistrationId::operator==( |
| 23 const BackgroundFetchRegistrationId& other) const { | 26 const BackgroundFetchRegistrationId& other) const { |
| 24 return other.service_worker_registration_id_ == | 27 return other.service_worker_registration_id_ == |
| 25 service_worker_registration_id_ && | 28 service_worker_registration_id_ && |
| 26 other.origin_ == origin_ && other.tag_ == tag_; | 29 other.origin_ == origin_ && other.tag_ == tag_; |
| 27 } | 30 } |
| 28 | 31 |
| 29 bool BackgroundFetchRegistrationId::operator!=( | 32 bool BackgroundFetchRegistrationId::operator!=( |
| 30 const BackgroundFetchRegistrationId& other) const { | 33 const BackgroundFetchRegistrationId& other) const { |
| 31 return !(*this == other); | 34 return !(*this == other); |
| 32 } | 35 } |
| 33 | 36 |
| 34 bool BackgroundFetchRegistrationId::operator<( | 37 bool BackgroundFetchRegistrationId::operator<( |
| 35 const BackgroundFetchRegistrationId& other) const { | 38 const BackgroundFetchRegistrationId& other) const { |
| 36 return service_worker_registration_id_ < | 39 return service_worker_registration_id_ < |
| 37 other.service_worker_registration_id_ || | 40 other.service_worker_registration_id_ || |
| 38 origin_ < other.origin_ || tag_ < other.tag_; | 41 origin_ < other.origin_ || tag_ < other.tag_; |
| 39 } | 42 } |
| 40 | 43 |
| 41 } // namespace content | 44 } // namespace content |
| OLD | NEW |