1 // Copyright 2018 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 BASE_TASK_SEQUENCE_MANAGER_TASK_TIME_OBSERVER_H_ 6 #define BASE_TASK_SEQUENCE_MANAGER_TASK_TIME_OBSERVER_H_ 7 8 #include "base/time/time.h" 9 10 namespace base { 11 namespace sequence_manager { 12 13 // TaskTimeObserver provides an API for observing completion of tasks. 14 class TaskTimeObserver { 15 public: 16 TaskTimeObserver() = default; 17 virtual ~TaskTimeObserver() = default; 18 19 // To be called when task is about to start. 20 virtual void WillProcessTask(TimeTicks start_time) = 0; 21 22 // To be called when task is completed. 23 virtual void DidProcessTask(TimeTicks start_time, TimeTicks end_time) = 0; 24 25 private: 26 DISALLOW_COPY_AND_ASSIGN(TaskTimeObserver); 27 }; 28 29 } // namespace sequence_manager 30 } // namespace base 31 32 #endif // BASE_TASK_SEQUENCE_MANAGER_TASK_TIME_OBSERVER_H_ 33