1 // Copyright 2013 The Flutter 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 FLUTTER_COMMON_TASK_RUNNERS_H_ 6 #define FLUTTER_COMMON_TASK_RUNNERS_H_ 7 8 #include <string> 9 10 #include "flutter/fml/macros.h" 11 #include "flutter/fml/task_runner.h" 12 13 namespace flutter { 14 15 class TaskRunners { 16 public: 17 TaskRunners(std::string label, 18 fml::RefPtr<fml::TaskRunner> platform, 19 fml::RefPtr<fml::TaskRunner> gpu, 20 fml::RefPtr<fml::TaskRunner> ui, 21 fml::RefPtr<fml::TaskRunner> io); 22 23 TaskRunners(const TaskRunners& other); 24 25 ~TaskRunners(); 26 27 const std::string& GetLabel() const; 28 29 fml::RefPtr<fml::TaskRunner> GetPlatformTaskRunner() const; 30 31 fml::RefPtr<fml::TaskRunner> GetUITaskRunner() const; 32 33 fml::RefPtr<fml::TaskRunner> GetIOTaskRunner() const; 34 35 fml::RefPtr<fml::TaskRunner> GetGPUTaskRunner() const; 36 37 bool IsValid() const; 38 39 private: 40 const std::string label_; 41 fml::RefPtr<fml::TaskRunner> platform_; 42 fml::RefPtr<fml::TaskRunner> gpu_; 43 fml::RefPtr<fml::TaskRunner> ui_; 44 fml::RefPtr<fml::TaskRunner> io_; 45 }; 46 47 } // namespace flutter 48 49 #endif // FLUTTER_COMMON_TASK_RUNNERS_H_ 50