Shaka Player Embedded
Public Member Functions | List of all members
shaka::NetworkThread Class Reference

#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)
 

Detailed Description

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.

Constructor & Destructor Documentation

§ NetworkThread()

shaka::NetworkThread::NetworkThread ( )

Definition at line 35 of file network_thread.cc.

§ ~NetworkThread()

shaka::NetworkThread::~NetworkThread ( )

Definition at line 44 of file network_thread.cc.

Member Function Documentation

§ AbortRequest()

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.

§ AddRequest()

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.

§ ContainsRequest()

bool shaka::NetworkThread::ContainsRequest ( RefPtr< js::XMLHttpRequest request) const
Returns
Whether the given request is being processed.

Definition at line 56 of file network_thread.cc.

§ Stop()

void shaka::NetworkThread::Stop ( )

Stops the background thread and joins it.

Definition at line 50 of file network_thread.cc.


The documentation for this class was generated from the following files: