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

Side by Side Diff: content/child/background_sync/background_sync_type_converters.cc

Issue 1468803002: Switch to static_assert. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@assert1
Patch Set: message cleanup Created 5 years 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 #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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698