Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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 { | |
|
jkarlin
2015/07/17 18:07:22
Not sure if it's kosher to have multiple namespace
iclelland
2015/07/17 18:34:25
The style guide is mostly silent on the issue, and
iclelland
2015/07/17 18:56:35
So I found these examples of this exact thing:
h
jkarlin
2015/07/17 20:29:18
Sounds good, thanks for looking it up!
| |
| 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_ |
| OLD | NEW |