| 133 | } |
| 134 | |
| 135 | void WasmFetchRequest::response(const FetchResponseCallback& callback) { |
| 136 | FL_WARN("Starting JavaScript-based fetch request to: " << mUrl); |
| 137 | |
| 138 | // Generate unique request ID for this request |
| 139 | u32 request_id = getCallbackManager().generateRequestId(); |
| 140 | |
| 141 | // Store the callback for when JavaScript calls back (using move semantics) |
| 142 | getCallbackManager().storeCallback(request_id, FetchResponseCallback(callback)); |
| 143 | |
| 144 | FL_WARN("Stored callback for request ID: " << request_id); |
| 145 | |
| 146 | // Start the JavaScript fetch (non-blocking) with request ID |
| 147 | js_fetch_async(request_id, mUrl.c_str()); |
| 148 | } |
| 149 | |
| 150 | #endif // FL_IS_WASM |
| 151 |
no test coverage detected