post_task_android.h 1.0 KB

12345678910111213141516171819202122232425262728293031
  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. #ifndef BASE_ANDROID_TASK_SCHEDULER_POST_TASK_ANDROID_H_
  5. #define BASE_ANDROID_TASK_SCHEDULER_POST_TASK_ANDROID_H_
  6. #include "base/android/jni_weak_ref.h"
  7. #include "base/base_export.h"
  8. namespace base {
  9. // C++ interface for PostTask.java
  10. class BASE_EXPORT PostTaskAndroid {
  11. public:
  12. PostTaskAndroid() = delete;
  13. PostTaskAndroid(const PostTaskAndroid&) = delete;
  14. PostTaskAndroid& operator=(const PostTaskAndroid&) = delete;
  15. // Routes tasks posted via the Java PostTask APIs through the C++ PostTask
  16. // APIs. Invoked once the C++ PostTask APIs are fully initialized.
  17. static void SignalNativeSchedulerReady();
  18. // Signals that the C++ PostTask APIs have shutdown. Needed to make unit tests
  19. // that repeatedly create and destroy the scheduler work.
  20. static void SignalNativeSchedulerShutdownForTesting();
  21. };
  22. } // namespace base
  23. #endif // BASE_ANDROID_TASK_SCHEDULER_POST_TASK_ANDROID_H_