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

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

Issue 1230213004: [Background Sync] Sent sync registration details to worker (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@bgsync-event-mek
Patch Set: Remove const ref from mojo StructPtr (with rebase) Created 5 years, 5 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/memory/scoped_ptr.h"
8 #include "content/browser/background_sync/background_sync.pb.h" 9 #include "content/browser/background_sync/background_sync.pb.h"
9 #include "content/browser/background_sync/background_sync_registration_options.h " 10 #include "content/browser/background_sync/background_sync_registration_options.h "
11 #include "content/common/background_sync_service.mojom.h"
10 #include "content/common/content_export.h" 12 #include "content/common/content_export.h"
13 #include "third_party/mojo/src/mojo/public/cpp/bindings/type_converter.h"
11 14
12 namespace content { 15 namespace content {
13 16
14 class CONTENT_EXPORT BackgroundSyncRegistration { 17 class CONTENT_EXPORT BackgroundSyncRegistration {
15 public: 18 public:
16 using RegistrationId = int64_t; 19 using RegistrationId = int64_t;
17 static const RegistrationId kInitialId; 20 static const RegistrationId kInitialId;
18 21
19 BackgroundSyncRegistration(); 22 BackgroundSyncRegistration();
20 bool Equals(const BackgroundSyncRegistration& other) const; 23 bool Equals(const BackgroundSyncRegistration& other) const;
(...skipping 11 matching lines...) Expand all
32 private: 35 private:
33 static const RegistrationId kInvalidRegistrationId; 36 static const RegistrationId kInvalidRegistrationId;
34 37
35 BackgroundSyncRegistrationOptions options_; 38 BackgroundSyncRegistrationOptions options_;
36 RegistrationId id_ = kInvalidRegistrationId; 39 RegistrationId id_ = kInvalidRegistrationId;
37 SyncState sync_state_ = SYNC_STATE_PENDING; 40 SyncState sync_state_ = SYNC_STATE_PENDING;
38 }; 41 };
39 42
40 } // namespace content 43 } // namespace content
41 44
45 namespace mojo {
46
47 template <>
48 struct CONTENT_EXPORT
49 TypeConverter<scoped_ptr<content::BackgroundSyncRegistration>,
50 content::SyncRegistrationPtr> {
51 static scoped_ptr<content::BackgroundSyncRegistration> Convert(
52 const content::SyncRegistrationPtr& input);
53 };
54
55 template <>
56 struct CONTENT_EXPORT TypeConverter<content::SyncRegistrationPtr,
57 content::BackgroundSyncRegistration> {
58 static content::SyncRegistrationPtr Convert(
59 const content::BackgroundSyncRegistration& input);
60 };
61
62 } // namespace
63
42 #endif // CONTENT_BROWSER_BACKGROUND_SYNC_BACKGROUND_SYNC_REGISTRATION_H_ 64 #endif // CONTENT_BROWSER_BACKGROUND_SYNC_BACKGROUND_SYNC_REGISTRATION_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698