| 132 | } |
| 133 | |
| 134 | void set_canceled() override { |
| 135 | mCanceled = true; |
| 136 | // Release callbacks immediately to free captured variables (e.g. promises |
| 137 | // holding response objects). Without this, captures survive until the |
| 138 | // scheduler erases the task on its next update pass. |
| 139 | mThenCallback = {}; |
| 140 | mCatchCallback = {}; |
| 141 | mHasThen = false; |
| 142 | mHasCatch = false; |
| 143 | } |
| 144 | |
| 145 | int id() const override { return mTaskId; } |
| 146 | void set_id(int id) override { mTaskId = id; } |