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

Side by Side Diff: components/sync/base/sync_string_conversions.cc

Issue 2130453004: [Sync] Move //sync to //components/sync. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 4 years, 4 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
« no previous file with comments | « components/sync/base/sync_string_conversions.h ('k') | components/sync/base/syncer_error.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "sync/internal_api/public/util/sync_string_conversions.h" 5 #include "components/sync/base/sync_string_conversions.h"
6 6
7 #define ENUM_CASE(x) case x: return #x 7 #define ENUM_CASE(x) \
8 case x: \
9 return #x
8 10
9 namespace syncer { 11 namespace syncer {
10 12
11 const char* ConnectionStatusToString(ConnectionStatus status) { 13 const char* ConnectionStatusToString(ConnectionStatus status) {
12 switch (status) { 14 switch (status) {
13 ENUM_CASE(CONNECTION_OK); 15 ENUM_CASE(CONNECTION_OK);
14 ENUM_CASE(CONNECTION_AUTH_ERROR); 16 ENUM_CASE(CONNECTION_AUTH_ERROR);
15 ENUM_CASE(CONNECTION_SERVER_ERROR); 17 ENUM_CASE(CONNECTION_SERVER_ERROR);
16 default: 18 default:
17 NOTREACHED(); 19 NOTREACHED();
18 return "INVALID_CONNECTION_STATUS"; 20 return "INVALID_CONNECTION_STATUS";
19 } 21 }
20 } 22 }
21 23
22 // Helper function that converts a PassphraseRequiredReason value to a string. 24 // Helper function that converts a PassphraseRequiredReason value to a string.
23 const char* PassphraseRequiredReasonToString( 25 const char* PassphraseRequiredReasonToString(PassphraseRequiredReason reason) {
24 PassphraseRequiredReason reason) {
25 switch (reason) { 26 switch (reason) {
26 ENUM_CASE(REASON_PASSPHRASE_NOT_REQUIRED); 27 ENUM_CASE(REASON_PASSPHRASE_NOT_REQUIRED);
27 ENUM_CASE(REASON_ENCRYPTION); 28 ENUM_CASE(REASON_ENCRYPTION);
28 ENUM_CASE(REASON_DECRYPTION); 29 ENUM_CASE(REASON_DECRYPTION);
29 default: 30 default:
30 NOTREACHED(); 31 NOTREACHED();
31 return "INVALID_REASON"; 32 return "INVALID_REASON";
32 } 33 }
33 } 34 }
34 35
(...skipping 13 matching lines...) Expand all
48 switch (type) { 49 switch (type) {
49 ENUM_CASE(PASSPHRASE_BOOTSTRAP_TOKEN); 50 ENUM_CASE(PASSPHRASE_BOOTSTRAP_TOKEN);
50 ENUM_CASE(KEYSTORE_BOOTSTRAP_TOKEN); 51 ENUM_CASE(KEYSTORE_BOOTSTRAP_TOKEN);
51 default: 52 default:
52 NOTREACHED(); 53 NOTREACHED();
53 return "INVALID_BOOTSTRAP_TOKEN_TYPE"; 54 return "INVALID_BOOTSTRAP_TOKEN_TYPE";
54 } 55 }
55 } 56 }
56 57
57 } // namespace syncer 58 } // namespace syncer
OLDNEW
« no previous file with comments | « components/sync/base/sync_string_conversions.h ('k') | components/sync/base/syncer_error.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698