Home | History | Annotate | Download | only in public
      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
      3 // found in the LICENSE file.
      4 
      5 #ifndef SYNC_INTERNAL_API_PUBLIC_DATA_TYPE_DEBUG_INFO_LISTENER_H_
      6 #define SYNC_INTERNAL_API_PUBLIC_DATA_TYPE_DEBUG_INFO_LISTENER_H_
      7 
      8 #include <vector>
      9 
     10 #include "sync/internal_api/public/base/model_type.h"
     11 #include "sync/internal_api/public/data_type_association_stats.h"
     12 
     13 namespace syncer {
     14 
     15 struct SYNC_EXPORT DataTypeConfigurationStats {
     16   DataTypeConfigurationStats();
     17   ~DataTypeConfigurationStats();
     18 
     19   // The datatype that was configured.
     20   ModelType model_type;
     21 
     22   // Waiting time before downloading starts.
     23   base::TimeDelta download_wait_time;
     24 
     25   // Time spent on downloading data for first-sync data types.
     26   base::TimeDelta download_time;
     27 
     28   // Waiting time for association of higher priority types to finish before
     29   // asking association manager to associate.
     30   base::TimeDelta association_wait_time_for_high_priority;
     31 
     32   // Types configured before this type.
     33   ModelTypeSet high_priority_types_configured_before;
     34   ModelTypeSet same_priority_types_configured_before;
     35 
     36   // Association stats.
     37   DataTypeAssociationStats association_stats;
     38 };
     39 
     40 // Interface for the sync internals to listen to external sync events.
     41 class DataTypeDebugInfoListener {
     42  public:
     43   // Notify the listener that configuration of data types has completed.
     44   virtual void OnDataTypeConfigureComplete(
     45       const std::vector<DataTypeConfigurationStats>& configuration_stats) = 0;
     46 };
     47 
     48 }  // namespace syncer
     49 
     50 #endif  // SYNC_INTERNAL_API_PUBLIC_DATA_TYPE_DEBUG_INFO_LISTENER_H_
     51