| 81 | } |
| 82 | |
| 83 | static bool ShouldScheduleCallback(const CallbackRecord& callback_record, |
| 84 | bool in_add_callback) { |
| 85 | switch (callback_record.options.should_schedule) { |
| 86 | case ShouldSchedule::Never: |
| 87 | return false; |
| 88 | case ShouldSchedule::Always: |
| 89 | return true; |
| 90 | case ShouldSchedule::IfUnfinished: |
| 91 | return !in_add_callback; |
| 92 | case ShouldSchedule::IfDifferentExecutor: |
| 93 | return !(callback_record.options.executor->IsCurrentExecutor()); |
| 94 | default: |
| 95 | DCHECK(false) << "Unrecognized ShouldSchedule option"; |
| 96 | return false; |
| 97 | } |
| 98 | } |
| 99 | |
| 100 | static void RunOrScheduleCallback(const std::shared_ptr<FutureImpl>& self, |
| 101 | CallbackRecord&& callback_record, |
nothing calls this directly
no test coverage detected