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

Side by Side Diff: sync/protocol/sync_protocol_error.cc

Issue 263273002: Add a ClientAction used by SyncRollbackManager to notify PSS that rollback is (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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
« no previous file with comments | « sync/protocol/sync_protocol_error.h ('k') | no next file » | 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/protocol/sync_protocol_error.h" 5 #include "sync/protocol/sync_protocol_error.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/values.h" 10 #include "base/values.h"
(...skipping 21 matching lines...) Expand all
32 32
33 const char* GetClientActionString(ClientAction action) { 33 const char* GetClientActionString(ClientAction action) {
34 switch (action) { 34 switch (action) {
35 ENUM_CASE(UPGRADE_CLIENT); 35 ENUM_CASE(UPGRADE_CLIENT);
36 ENUM_CASE(CLEAR_USER_DATA_AND_RESYNC); 36 ENUM_CASE(CLEAR_USER_DATA_AND_RESYNC);
37 ENUM_CASE(ENABLE_SYNC_ON_ACCOUNT); 37 ENUM_CASE(ENABLE_SYNC_ON_ACCOUNT);
38 ENUM_CASE(STOP_AND_RESTART_SYNC); 38 ENUM_CASE(STOP_AND_RESTART_SYNC);
39 ENUM_CASE(DISABLE_SYNC_ON_CLIENT); 39 ENUM_CASE(DISABLE_SYNC_ON_CLIENT);
40 ENUM_CASE(STOP_SYNC_FOR_DISABLED_ACCOUNT); 40 ENUM_CASE(STOP_SYNC_FOR_DISABLED_ACCOUNT);
41 ENUM_CASE(DISABLE_SYNC_AND_ROLLBACK); 41 ENUM_CASE(DISABLE_SYNC_AND_ROLLBACK);
42 ENUM_CASE(ROLLBACK_DONE);
42 ENUM_CASE(UNKNOWN_ACTION); 43 ENUM_CASE(UNKNOWN_ACTION);
43 } 44 }
44 NOTREACHED(); 45 NOTREACHED();
45 return ""; 46 return "";
46 } 47 }
47 48
48 SyncProtocolError::SyncProtocolError() 49 SyncProtocolError::SyncProtocolError()
49 : error_type(UNKNOWN_ERROR), 50 : error_type(UNKNOWN_ERROR),
50 action(UNKNOWN_ACTION) { 51 action(UNKNOWN_ACTION) {
51 } 52 }
52 53
53 SyncProtocolError::~SyncProtocolError() { 54 SyncProtocolError::~SyncProtocolError() {
54 } 55 }
55 56
56 base::DictionaryValue* SyncProtocolError::ToValue() const { 57 base::DictionaryValue* SyncProtocolError::ToValue() const {
57 base::DictionaryValue* value = new base::DictionaryValue(); 58 base::DictionaryValue* value = new base::DictionaryValue();
58 value->SetString("ErrorType", 59 value->SetString("ErrorType",
59 GetSyncErrorTypeString(error_type)); 60 GetSyncErrorTypeString(error_type));
60 value->SetString("ErrorDescription", error_description); 61 value->SetString("ErrorDescription", error_description);
61 value->SetString("url", url); 62 value->SetString("url", url);
62 value->SetString("action", GetClientActionString(action)); 63 value->SetString("action", GetClientActionString(action));
63 return value; 64 return value;
64 } 65 }
65 66
66 } // namespace syncer 67 } // namespace syncer
67 68
OLDNEW
« no previous file with comments | « sync/protocol/sync_protocol_error.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698