Remove the 'gyp_config' concept from MB.
[chromium-blink-merge.git] / content / browser / background_sync / background_sync_registration.h
blob575ecf91e7e41b85a11bbbcc56f92c54a5b4b7f4
1 // Copyright 2015 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.
5 #ifndef CONTENT_BROWSER_BACKGROUND_SYNC_BACKGROUND_SYNC_REGISTRATION_H_
6 #define CONTENT_BROWSER_BACKGROUND_SYNC_BACKGROUND_SYNC_REGISTRATION_H_
8 #include "base/macros.h"
9 #include "base/memory/scoped_ptr.h"
10 #include "content/browser/background_sync/background_sync.pb.h"
11 #include "content/browser/background_sync/background_sync_registration_options.h"
12 #include "content/common/background_sync_service.mojom.h"
13 #include "content/common/content_export.h"
14 #include "third_party/mojo/src/mojo/public/cpp/bindings/type_converter.h"
16 namespace content {
18 class CONTENT_EXPORT BackgroundSyncRegistration {
19 public:
20 using RegistrationId = int64_t;
21 static const RegistrationId kInitialId;
23 BackgroundSyncRegistration() = default;
24 ~BackgroundSyncRegistration() = default;
26 bool Equals(const BackgroundSyncRegistration& other) const;
27 bool IsValid() const;
29 const BackgroundSyncRegistrationOptions* options() const { return &options_; }
30 BackgroundSyncRegistrationOptions* options() { return &options_; }
32 RegistrationId id() const { return id_; }
33 void set_id(RegistrationId id) { id_ = id; }
35 SyncState sync_state() const { return sync_state_; }
36 void set_sync_state(SyncState state) { sync_state_ = state; }
38 private:
39 static const RegistrationId kInvalidRegistrationId;
41 BackgroundSyncRegistrationOptions options_;
42 RegistrationId id_ = kInvalidRegistrationId;
43 SyncState sync_state_ = SYNC_STATE_PENDING;
45 DISALLOW_COPY_AND_ASSIGN(BackgroundSyncRegistration);
48 } // namespace content
50 namespace mojo {
52 template <>
53 struct CONTENT_EXPORT
54 TypeConverter<scoped_ptr<content::BackgroundSyncRegistration>,
55 content::SyncRegistrationPtr> {
56 static scoped_ptr<content::BackgroundSyncRegistration> Convert(
57 const content::SyncRegistrationPtr& input);
60 template <>
61 struct CONTENT_EXPORT TypeConverter<content::SyncRegistrationPtr,
62 content::BackgroundSyncRegistration> {
63 static content::SyncRegistrationPtr Convert(
64 const content::BackgroundSyncRegistration& input);
67 } // namespace
69 #endif // CONTENT_BROWSER_BACKGROUND_SYNC_BACKGROUND_SYNC_REGISTRATION_H_