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

Side by Side Diff: components/invalidation/notifier_reason_util.cc

Issue 294123004: Move some sync/notifier to components/invalidation (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 6 years, 6 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/notifier/invalidator_state.h" 5 #include "components/invalidation/notifier_reason_util.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 8
9 namespace syncer { 9 namespace syncer {
10 10
11 const char* InvalidatorStateToString(InvalidatorState state) {
12 switch (state) {
13 case TRANSIENT_INVALIDATION_ERROR:
14 return "TRANSIENT_INVALIDATION_ERROR";
15 case INVALIDATION_CREDENTIALS_REJECTED:
16 return "INVALIDATION_CREDENTIALS_REJECTED";
17 case INVALIDATIONS_ENABLED:
18 return "INVALIDATIONS_ENABLED";
19 default:
20 NOTREACHED();
21 return "UNKNOWN_INVALIDATOR_STATE";
22 }
23 }
24
25 InvalidatorState FromNotifierReason( 11 InvalidatorState FromNotifierReason(
26 notifier::NotificationsDisabledReason reason) { 12 notifier::NotificationsDisabledReason reason) {
27 switch (reason) { 13 switch (reason) {
28 case notifier::NO_NOTIFICATION_ERROR: 14 case notifier::NO_NOTIFICATION_ERROR:
29 return INVALIDATIONS_ENABLED; 15 return INVALIDATIONS_ENABLED;
30 case notifier::TRANSIENT_NOTIFICATION_ERROR: 16 case notifier::TRANSIENT_NOTIFICATION_ERROR:
31 return TRANSIENT_INVALIDATION_ERROR; 17 return TRANSIENT_INVALIDATION_ERROR;
32 case notifier::NOTIFICATION_CREDENTIALS_REJECTED: 18 case notifier::NOTIFICATION_CREDENTIALS_REJECTED:
33 return INVALIDATION_CREDENTIALS_REJECTED; 19 return INVALIDATION_CREDENTIALS_REJECTED;
34 default: 20 default:
(...skipping 11 matching lines...) Expand all
46 return notifier::NOTIFICATION_CREDENTIALS_REJECTED; 32 return notifier::NOTIFICATION_CREDENTIALS_REJECTED;
47 case INVALIDATIONS_ENABLED: 33 case INVALIDATIONS_ENABLED:
48 // Fall through. 34 // Fall through.
49 default: 35 default:
50 NOTREACHED(); 36 NOTREACHED();
51 return notifier::TRANSIENT_NOTIFICATION_ERROR; 37 return notifier::TRANSIENT_NOTIFICATION_ERROR;
52 } 38 }
53 } 39 }
54 40
55 } // namespace syncer 41 } // namespace syncer
OLDNEW
« no previous file with comments | « components/invalidation/notifier_reason_util.h ('k') | components/invalidation/p2p_invalidation_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698