CefTask.cs 944 B

1234567891011121314151617181920212223242526272829
  1. namespace Xilium.CefGlue
  2. {
  3. using System;
  4. using System.Collections.Generic;
  5. using Xilium.CefGlue.Interop;
  6. /// <summary>
  7. /// Implement this interface for asynchronous task execution. If the task is
  8. /// posted successfully and if the associated message loop is still running then
  9. /// the Execute() method will be called on the target thread. If the task fails
  10. /// to post then the task object may be destroyed on the source thread instead of
  11. /// the target thread. For this reason be cautious when performing work in the
  12. /// task object destructor.
  13. /// </summary>
  14. public abstract unsafe partial class CefTask
  15. {
  16. private void execute(cef_task_t* self)
  17. {
  18. CheckSelf(self);
  19. Execute();
  20. }
  21. /// <summary>
  22. /// Method that will be executed on the target thread.
  23. /// </summary>
  24. protected abstract void Execute();
  25. }
  26. }