diff options
author | jkarlin <jkarlin@chromium.org> | 2015-07-03 05:54:51 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-07-03 12:55:22 +0000 |
commit | eb98458c8a21119ce98808839cd065345a1e819b (patch) | |
tree | b54c3271f30b4627726cd59a65773a5a94564faf /content/browser/background_sync/background_sync_registration.cc | |
parent | e8575f594f2669946f3d611135aa0cd7200bbc4a (diff) | |
download | chromium_src-eb98458c8a21119ce98808839cd065345a1e819b.zip chromium_src-eb98458c8a21119ce98808839cd065345a1e819b.tar.gz chromium_src-eb98458c8a21119ce98808839cd065345a1e819b.tar.bz2 |
Make BackgroundSyncRegistration a proper class
This CL refactors content::BackgroundSyncManager::BackgroundSyncRegistration into content::BackgroundSyncRegistration. It also moves it from a struct into a class for better access control. In a followup CL the BackgroundSyncRegistration will become refcounted (so that the clients can own the registrations after the BackgroundSyncManager no longer cares about them). For more information see the bug.
BUG=506271
Review URL: https://codereview.chromium.org/1221883004
Cr-Commit-Position: refs/heads/master@{#337306}
Diffstat (limited to 'content/browser/background_sync/background_sync_registration.cc')
-rw-r--r-- | content/browser/background_sync/background_sync_registration.cc | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/content/browser/background_sync/background_sync_registration.cc b/content/browser/background_sync/background_sync_registration.cc new file mode 100644 index 0000000..d6a122c --- /dev/null +++ b/content/browser/background_sync/background_sync_registration.cc @@ -0,0 +1,24 @@ +// Copyright 2015 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. + +#include "content/browser/background_sync/background_sync_registration.h" + +namespace content { + +const BackgroundSyncRegistration::RegistrationId + BackgroundSyncRegistration::kInvalidRegistrationId = -1; + +const BackgroundSyncRegistration::RegistrationId + BackgroundSyncRegistration::kInitialId = 0; + +bool BackgroundSyncRegistration::Equals( + const BackgroundSyncRegistration& other) const { + return options_.Equals(other.options_); +} + +bool BackgroundSyncRegistration::IsValid() const { + return id_ != kInvalidRegistrationId; +} + +} // namespace content |