Shaka Player Embedded
|
#include <network_thread.h>
Public Member Functions | |
NetworkThread () | |
~NetworkThread () | |
void | Stop () |
bool | ContainsRequest (RefPtr< js::XMLHttpRequest > request) const |
void | AddRequest (RefPtr< js::XMLHttpRequest > request) |
void | AbortRequest (RefPtr< js::XMLHttpRequest > request) |
This manages a background thread that runs network requests using CURL. This uses a CURL multi-handle to make multiple requests concurrently. As the request happens, the background thread will make calls into the XHR object. The XHR object MUST handle any synchronization required for cross-thread access.
Definition at line 41 of file network_thread.h.
shaka::NetworkThread::NetworkThread | ( | ) |
Definition at line 35 of file network_thread.cc.
shaka::NetworkThread::~NetworkThread | ( | ) |
Definition at line 44 of file network_thread.cc.
void shaka::NetworkThread::AbortRequest | ( | RefPtr< js::XMLHttpRequest > | request | ) |
Aborts a pending request. Depending on timing, the request may already be done. Once this method returns, the CURL handle has been removed from this object, so it is safe to free.
Definition at line 70 of file network_thread.cc.
void shaka::NetworkThread::AddRequest | ( | RefPtr< js::XMLHttpRequest > | request | ) |
Adds a request to perform. The request will be kept alive by this object until the request is complete. The object MUST NOT be otherwise destroyed until the request is done or is aborted. This will hold a reference to the object.
Definition at line 61 of file network_thread.cc.
bool shaka::NetworkThread::ContainsRequest | ( | RefPtr< js::XMLHttpRequest > | request | ) | const |
Definition at line 56 of file network_thread.cc.
void shaka::NetworkThread::Stop | ( | ) |
Stops the background thread and joins it.
Definition at line 50 of file network_thread.cc.