Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(273)

Side by Side Diff: content/browser/background_sync/background_sync_registration.h

Issue 1348603003: [BackgroundSync] Move BackgroundSyncState from proto to mojo (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Android fix Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 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 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_SYNC_BACKGROUND_SYNC_REGISTRATION_H_ 5 #ifndef CONTENT_BROWSER_BACKGROUND_SYNC_BACKGROUND_SYNC_REGISTRATION_H_
6 #define CONTENT_BROWSER_BACKGROUND_SYNC_BACKGROUND_SYNC_REGISTRATION_H_ 6 #define CONTENT_BROWSER_BACKGROUND_SYNC_BACKGROUND_SYNC_REGISTRATION_H_
7 7
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "content/browser/background_sync/background_sync.pb.h" 10 #include "content/browser/background_sync/background_sync.pb.h"
(...skipping 14 matching lines...) Expand all
25 25
26 bool Equals(const BackgroundSyncRegistration& other) const; 26 bool Equals(const BackgroundSyncRegistration& other) const;
27 bool IsValid() const; 27 bool IsValid() const;
28 28
29 const BackgroundSyncRegistrationOptions* options() const { return &options_; } 29 const BackgroundSyncRegistrationOptions* options() const { return &options_; }
30 BackgroundSyncRegistrationOptions* options() { return &options_; } 30 BackgroundSyncRegistrationOptions* options() { return &options_; }
31 31
32 RegistrationId id() const { return id_; } 32 RegistrationId id() const { return id_; }
33 void set_id(RegistrationId id) { id_ = id; } 33 void set_id(RegistrationId id) { id_ = id; }
34 34
35 SyncState sync_state() const { return sync_state_; } 35 BackgroundSyncState sync_state() const { return sync_state_; }
36 void set_sync_state(SyncState state) { sync_state_ = state; } 36 void set_sync_state(BackgroundSyncState state) { sync_state_ = state; }
37 37
38 private: 38 private:
39 static const RegistrationId kInvalidRegistrationId; 39 static const RegistrationId kInvalidRegistrationId;
40 40
41 BackgroundSyncRegistrationOptions options_; 41 BackgroundSyncRegistrationOptions options_;
42 RegistrationId id_ = kInvalidRegistrationId; 42 RegistrationId id_ = kInvalidRegistrationId;
43 SyncState sync_state_ = SYNC_STATE_PENDING; 43 BackgroundSyncState sync_state_ = BACKGROUND_SYNC_STATE_PENDING;
44 44
45 DISALLOW_COPY_AND_ASSIGN(BackgroundSyncRegistration); 45 DISALLOW_COPY_AND_ASSIGN(BackgroundSyncRegistration);
46 }; 46 };
47 47
48 } // namespace content 48 } // namespace content
49 49
50 namespace mojo { 50 namespace mojo {
51 51
52 template <> 52 template <>
53 struct CONTENT_EXPORT 53 struct CONTENT_EXPORT
54 TypeConverter<scoped_ptr<content::BackgroundSyncRegistration>, 54 TypeConverter<scoped_ptr<content::BackgroundSyncRegistration>,
55 content::SyncRegistrationPtr> { 55 content::SyncRegistrationPtr> {
56 static scoped_ptr<content::BackgroundSyncRegistration> Convert( 56 static scoped_ptr<content::BackgroundSyncRegistration> Convert(
57 const content::SyncRegistrationPtr& input); 57 const content::SyncRegistrationPtr& input);
58 }; 58 };
59 59
60 template <> 60 template <>
61 struct CONTENT_EXPORT TypeConverter<content::SyncRegistrationPtr, 61 struct CONTENT_EXPORT TypeConverter<content::SyncRegistrationPtr,
62 content::BackgroundSyncRegistration> { 62 content::BackgroundSyncRegistration> {
63 static content::SyncRegistrationPtr Convert( 63 static content::SyncRegistrationPtr Convert(
64 const content::BackgroundSyncRegistration& input); 64 const content::BackgroundSyncRegistration& input);
65 }; 65 };
66 66
67 } // namespace 67 } // namespace
68 68
69 #endif // CONTENT_BROWSER_BACKGROUND_SYNC_BACKGROUND_SYNC_REGISTRATION_H_ 69 #endif // CONTENT_BROWSER_BACKGROUND_SYNC_BACKGROUND_SYNC_REGISTRATION_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698