15821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Copyright (c) 2012 The Chromium Authors. All rights reserved.
25821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Use of this source code is governed by a BSD-style license that can be
35821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// found in the LICENSE file.
45821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
55821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#ifndef SYNC_INTERNAL_API_PUBLIC_DATA_TYPE_DEBUG_INFO_LISTENER_H_
65821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#define SYNC_INTERNAL_API_PUBLIC_DATA_TYPE_DEBUG_INFO_LISTENER_H_
75821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
868043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)#include <vector>
968043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)
105821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "sync/internal_api/public/base/model_type.h"
115821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "sync/internal_api/public/data_type_association_stats.h"
125821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
135821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)namespace syncer {
145821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
15868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)struct SYNC_EXPORT DataTypeConfigurationStats {
16868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  DataTypeConfigurationStats();
17868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  ~DataTypeConfigurationStats();
18868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)
19868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  // The datatype that was configured.
20868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  ModelType model_type;
21868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)
22868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  // Waiting time before downloading starts.
23868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  base::TimeDelta download_wait_time;
24868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)
25868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  // Time spent on downloading data for first-sync data types.
26868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  base::TimeDelta download_time;
27868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)
28868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  // Waiting time for association of higher priority types to finish before
29868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  // asking association manager to associate.
30868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  base::TimeDelta association_wait_time_for_high_priority;
31868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)
32868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  // Types configured before this type.
33868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  ModelTypeSet high_priority_types_configured_before;
34868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  ModelTypeSet same_priority_types_configured_before;
35868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)
36868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  // Association stats.
37868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  DataTypeAssociationStats association_stats;
38868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)};
39868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)
405821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Interface for the sync internals to listen to external sync events.
415821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)class DataTypeDebugInfoListener {
425821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) public:
4368043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)  // Notify the listener that configuration of data types has completed.
4468043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)  virtual void OnDataTypeConfigureComplete(
4568043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)      const std::vector<DataTypeConfigurationStats>& configuration_stats) = 0;
465821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)};
475821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
485821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)}  // namespace syncer
495821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
505821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#endif  // SYNC_INTERNAL_API_PUBLIC_DATA_TYPE_DEBUG_INFO_LISTENER_H_
51