MCPcopy Create free account
hub / github.com/bumptop/BumpTop / httpRequestFinished

Method httpRequestFinished

trunk/win/Source/BT_JavaScriptAPI.cpp:287–306  ·  view source on GitHub ↗

This slot is triggered from an HTTP request in sendXmlHttpRequest().

Source from the content-addressed store, hash-verified

285
286// This slot is triggered from an HTTP request in sendXmlHttpRequest().
287void JavaScriptAPI::httpRequestFinished( int id, bool error )
288{
289 if (_pendingHttpRequests.contains(id))
290 {
291 assert(_stringData.isNull());
292 _stringData = _httpImpl.readAll();
293
294 // If we close the connection here, we don't seem to be able to make any
295 // further requests with this object.
296// _httpImpl.close();
297
298 QString callbackCode = QString("%1(BumpTopNative.internal_getStringData(), %2);")
299 .arg(_pendingHttpRequests[id])
300 .arg(error ? "false" : "true");
301 _page->evaluateJavaScript(callbackCode);
302
303 // Remove the object from the list, and let Qt delete it when signal processing is done
304 _pendingHttpRequests.remove(id);
305 }
306}
307
308// This slot is triggered from an HTTP request in sendXmlHttpRequest().
309// Not connected by default, but left here because it's useful for debugging.

Callers

nothing calls this directly

Calls 8

assertClass · 0.85
evaluateJavaScriptMethod · 0.80
QStringFunction · 0.50
containsMethod · 0.45
isNullMethod · 0.45
readAllMethod · 0.45
argMethod · 0.45
removeMethod · 0.45

Tested by

no test coverage detected