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

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

Issue 2245073003: [Sync] Clean up intra-sync DEPS significantly. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comments/fix test. 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
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "components/sync/base/sync_string_conversions.h"
6
7 #define ENUM_CASE(x) \
8 case x: \
9 return #x
10
11 namespace syncer {
12
13 const char* ConnectionStatusToString(ConnectionStatus status) {
14 switch (status) {
15 ENUM_CASE(CONNECTION_OK);
16 ENUM_CASE(CONNECTION_AUTH_ERROR);
17 ENUM_CASE(CONNECTION_SERVER_ERROR);
18 default:
19 NOTREACHED();
20 return "INVALID_CONNECTION_STATUS";
21 }
22 }
23
24 // Helper function that converts a PassphraseRequiredReason value to a string.
25 const char* PassphraseRequiredReasonToString(PassphraseRequiredReason reason) {
26 switch (reason) {
27 ENUM_CASE(REASON_PASSPHRASE_NOT_REQUIRED);
28 ENUM_CASE(REASON_ENCRYPTION);
29 ENUM_CASE(REASON_DECRYPTION);
30 default:
31 NOTREACHED();
32 return "INVALID_REASON";
33 }
34 }
35
36 const char* PassphraseTypeToString(PassphraseType type) {
37 switch (type) {
38 ENUM_CASE(IMPLICIT_PASSPHRASE);
39 ENUM_CASE(KEYSTORE_PASSPHRASE);
40 ENUM_CASE(FROZEN_IMPLICIT_PASSPHRASE);
41 ENUM_CASE(CUSTOM_PASSPHRASE);
42 default:
43 NOTREACHED();
44 return "INVALID_PASSPHRASE_TYPE";
45 }
46 }
47
48 const char* BootstrapTokenTypeToString(BootstrapTokenType type) {
49 switch (type) {
50 ENUM_CASE(PASSPHRASE_BOOTSTRAP_TOKEN);
51 ENUM_CASE(KEYSTORE_BOOTSTRAP_TOKEN);
52 default:
53 NOTREACHED();
54 return "INVALID_BOOTSTRAP_TOKEN_TYPE";
55 }
56 }
57
58 } // namespace syncer
OLDNEW
« no previous file with comments | « components/sync/base/sync_string_conversions.h ('k') | components/sync/core/shared_model_type_processor.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698