OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "chrome/browser/sync/glue/data_type_manager.h" | 5 #include "chrome/browser/sync/glue/data_type_manager.h" |
6 | 6 |
7 namespace browser_sync { | 7 namespace browser_sync { |
8 | 8 |
9 DataTypeManager::ConfigureResult::ConfigureResult() | 9 DataTypeManager::ConfigureResult::ConfigureResult() |
10 : status(UNKNOWN) {} | 10 : status(UNKNOWN) {} |
11 | 11 |
12 DataTypeManager::ConfigureResult::ConfigureResult(ConfigureStatus status, | 12 DataTypeManager::ConfigureResult::ConfigureResult(ConfigureStatus status, |
13 TypeSet requested_types) | 13 TypeSet requested_types) |
14 : status(status), | 14 : status(status), |
15 requested_types(requested_types) { | 15 requested_types(requested_types) { |
16 DCHECK_EQ(OK, status); | 16 DCHECK_EQ(OK, status); |
17 } | 17 } |
18 | 18 |
19 DataTypeManager::ConfigureResult::ConfigureResult( | 19 DataTypeManager::ConfigureResult::ConfigureResult( |
20 ConfigureStatus status, | 20 ConfigureStatus status, |
21 TypeSet requested_types, | 21 TypeSet requested_types, |
22 const std::list<SyncError>& error) | 22 const std::list<SyncError>& failed_data_types, |
| 23 syncable::ModelTypeSet waiting_to_start) |
23 : status(status), | 24 : status(status), |
24 requested_types(requested_types), | 25 requested_types(requested_types), |
25 errors(error) { | 26 failed_data_types(failed_data_types), |
26 if (!error.empty()) { | 27 waiting_to_start(waiting_to_start) { |
| 28 if (!failed_data_types.empty()) { |
27 DCHECK_NE(OK, status); | 29 DCHECK_NE(OK, status); |
28 } | 30 } |
29 } | 31 } |
30 | 32 |
31 DataTypeManager::ConfigureResult::~ConfigureResult() { | 33 DataTypeManager::ConfigureResult::~ConfigureResult() { |
32 } | 34 } |
33 | 35 |
34 // Static. | 36 // Static. |
35 std::string DataTypeManager::ConfigureStatusToString(ConfigureStatus status) { | 37 std::string DataTypeManager::ConfigureStatusToString(ConfigureStatus status) { |
36 switch (status) { | 38 switch (status) { |
37 case OK: | 39 case OK: |
38 return "Ok"; | 40 return "Ok"; |
39 case ABORTED: | 41 case ABORTED: |
40 return "Aborted"; | 42 return "Aborted"; |
41 case UNRECOVERABLE_ERROR: | 43 case UNRECOVERABLE_ERROR: |
42 return "Unrecoverable Error"; | 44 return "Unrecoverable Error"; |
43 case PARTIAL_SUCCESS: | 45 case PARTIAL_SUCCESS: |
44 return "Partial Success"; | 46 return "Partial Success"; |
45 default: | 47 default: |
46 NOTREACHED(); | 48 NOTREACHED(); |
47 return std::string(); | 49 return std::string(); |
48 } | 50 } |
49 } | 51 } |
50 | 52 |
51 } // namespace browser_sync | 53 } // namespace browser_sync |
OLD | NEW |