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