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 #include "content/child/background_sync/background_sync_type_converters.h" | 5 #include "content/child/background_sync/background_sync_type_converters.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 | 8 |
9 namespace mojo { | 9 namespace mojo { |
10 | 10 |
11 #define COMPILE_ASSERT_MATCHING_ENUM(mojo_name, blink_name) \ | 11 #define COMPILE_ASSERT_MATCHING_ENUM(mojo_name, blink_name) \ |
12 COMPILE_ASSERT(static_cast<int>(content::mojo_name) == \ | 12 static_assert(static_cast<int>(content::mojo_name) == \ |
13 static_cast<int>(blink::blink_name), \ | 13 static_cast<int>(blink::blink_name), \ |
14 mismatching_enums) | 14 "mojo and blink enums must match") |
15 | 15 |
16 COMPILE_ASSERT_MATCHING_ENUM(BACKGROUND_SYNC_PERIODICITY_PERIODIC, | 16 COMPILE_ASSERT_MATCHING_ENUM(BACKGROUND_SYNC_PERIODICITY_PERIODIC, |
17 WebSyncRegistration::PeriodicityPeriodic); | 17 WebSyncRegistration::PeriodicityPeriodic); |
18 COMPILE_ASSERT_MATCHING_ENUM(BACKGROUND_SYNC_PERIODICITY_ONE_SHOT, | 18 COMPILE_ASSERT_MATCHING_ENUM(BACKGROUND_SYNC_PERIODICITY_ONE_SHOT, |
19 WebSyncRegistration::PeriodicityOneShot); | 19 WebSyncRegistration::PeriodicityOneShot); |
20 COMPILE_ASSERT_MATCHING_ENUM(BACKGROUND_SYNC_PERIODICITY_MAX, | 20 COMPILE_ASSERT_MATCHING_ENUM(BACKGROUND_SYNC_PERIODICITY_MAX, |
21 WebSyncRegistration::PeriodicityOneShot); | 21 WebSyncRegistration::PeriodicityOneShot); |
22 COMPILE_ASSERT_MATCHING_ENUM(BACKGROUND_SYNC_PERIODICITY_MAX, | 22 COMPILE_ASSERT_MATCHING_ENUM(BACKGROUND_SYNC_PERIODICITY_MAX, |
23 WebSyncRegistration::PeriodicityLast); | 23 WebSyncRegistration::PeriodicityLast); |
24 COMPILE_ASSERT_MATCHING_ENUM(BACKGROUND_SYNC_NETWORK_STATE_ANY, | 24 COMPILE_ASSERT_MATCHING_ENUM(BACKGROUND_SYNC_NETWORK_STATE_ANY, |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 | 142 |
143 // static | 143 // static |
144 content::BackgroundSyncEventLastChance | 144 content::BackgroundSyncEventLastChance |
145 TypeConverter<content::BackgroundSyncEventLastChance, | 145 TypeConverter<content::BackgroundSyncEventLastChance, |
146 blink::WebServiceWorkerContextProxy::LastChanceOption>:: | 146 blink::WebServiceWorkerContextProxy::LastChanceOption>:: |
147 Convert(blink::WebServiceWorkerContextProxy::LastChanceOption input) { | 147 Convert(blink::WebServiceWorkerContextProxy::LastChanceOption input) { |
148 return static_cast<content::BackgroundSyncEventLastChance>(input); | 148 return static_cast<content::BackgroundSyncEventLastChance>(input); |
149 } | 149 } |
150 | 150 |
151 } // namespace mojo | 151 } // namespace mojo |
OLD | NEW |