OLD | NEW |
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 #ifndef CHROME_BROWSER_SYNC_GLUE_DATA_TYPE_MANAGER_H__ | 5 #ifndef CHROME_BROWSER_SYNC_GLUE_DATA_TYPE_MANAGER_H__ |
6 #define CHROME_BROWSER_SYNC_GLUE_DATA_TYPE_MANAGER_H__ | 6 #define CHROME_BROWSER_SYNC_GLUE_DATA_TYPE_MANAGER_H__ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <list> | 9 #include <list> |
10 #include <set> | 10 #include <set> |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 | 52 |
53 typedef syncable::ModelTypeSet TypeSet; | 53 typedef syncable::ModelTypeSet TypeSet; |
54 | 54 |
55 // Note: |errors| is only filled when status is not OK. | 55 // Note: |errors| is only filled when status is not OK. |
56 struct ConfigureResult { | 56 struct ConfigureResult { |
57 ConfigureResult(); | 57 ConfigureResult(); |
58 ConfigureResult(ConfigureStatus status, | 58 ConfigureResult(ConfigureStatus status, |
59 TypeSet requested_types); | 59 TypeSet requested_types); |
60 ConfigureResult(ConfigureStatus status, | 60 ConfigureResult(ConfigureStatus status, |
61 TypeSet requested_types, | 61 TypeSet requested_types, |
62 const std::list<SyncError>& errors); | 62 const std::list<SyncError>& failed_data_types, |
| 63 syncable::ModelTypeSet waiting_to_start); |
63 ~ConfigureResult(); | 64 ~ConfigureResult(); |
64 ConfigureStatus status; | 65 ConfigureStatus status; |
65 TypeSet requested_types; | 66 TypeSet requested_types; |
66 std::list<SyncError> errors; | 67 |
| 68 // These types encountered a failure in association. |
| 69 std::list<SyncError> failed_data_types; |
| 70 |
| 71 // List of types that failed to start association with in our alloted |
| 72 // time period(see kDataTypeLoadWaitTimeInSeconds). We move |
| 73 // forward here and allow these types to continue loading in the |
| 74 // background. When these types are loaded DataTypeManager will |
| 75 // be informed and another configured cycle will be started. |
| 76 syncable::ModelTypeSet waiting_to_start; |
67 }; | 77 }; |
68 | 78 |
69 virtual ~DataTypeManager() {} | 79 virtual ~DataTypeManager() {} |
70 | 80 |
71 // Convert a ConfigureStatus to string for debug purposes. | 81 // Convert a ConfigureStatus to string for debug purposes. |
72 static std::string ConfigureStatusToString(ConfigureStatus status); | 82 static std::string ConfigureStatusToString(ConfigureStatus status); |
73 | 83 |
74 // Begins asynchronous configuration of data types. Any currently | 84 // Begins asynchronous configuration of data types. Any currently |
75 // running data types that are not in the desired_types set will be | 85 // running data types that are not in the desired_types set will be |
76 // stopped. Any stopped data types that are in the desired_types | 86 // stopped. Any stopped data types that are in the desired_types |
(...skipping 18 matching lines...) Expand all Loading... |
95 // stopped. | 105 // stopped. |
96 virtual void Stop() = 0; | 106 virtual void Stop() = 0; |
97 | 107 |
98 // The current state of the data type manager. | 108 // The current state of the data type manager. |
99 virtual State state() const = 0; | 109 virtual State state() const = 0; |
100 }; | 110 }; |
101 | 111 |
102 } // namespace browser_sync | 112 } // namespace browser_sync |
103 | 113 |
104 #endif // CHROME_BROWSER_SYNC_GLUE_DATA_TYPE_MANAGER_H__ | 114 #endif // CHROME_BROWSER_SYNC_GLUE_DATA_TYPE_MANAGER_H__ |
OLD | NEW |