Gnash
0.8.10
|
#include <MovieLoader.h>
Classes | |
class | Request |
A movie load request. More... | |
Public Member Functions | |
MovieLoader (movie_root &mr) | |
~MovieLoader () | |
void | loadMovie (const std::string &url, const std::string &target, const std::string &data, MovieClip::VariablesMethod method, as_object *handler=0) |
Queue a request for loading a movie. | |
void | clear () |
Drop all requests and kill the thread. | |
void | processCompletedRequests () |
Process all completed movie load requests. | |
void | setReachable () const |
Movie loader.
All public functions are intended to be called by the main thread Hide the asynchonous mechanism of movies loading. Currently implemented using threads, could be refactored to use non-blocking reads.
gnash::MovieLoader::MovieLoader | ( | movie_root & | mr | ) |
gnash::MovieLoader::~MovieLoader | ( | ) |
References clear().
void gnash::MovieLoader::clear | ( | ) |
Drop all requests and kill the thread.
Referenced by gnash::movie_root::~movie_root(), gnash::movie_root::reset(), and ~MovieLoader().
void gnash::MovieLoader::loadMovie | ( | const std::string & | url, |
const std::string & | target, | ||
const std::string & | data, | ||
MovieClip::VariablesMethod | method, | ||
as_object * | handler = 0 |
||
) |
Queue a request for loading a movie.
This function constructs the URL and, if required, the postdata from the arguments. The variables to send should *not* be appended to
urlstr | before calling this function. |
urlstr | The url exactly as requested. This may already contain a query string. |
target | Target for request. |
data | The variables data to send, URL encoded in key/value pairs |
method | The VariablesMethod to use for sending the data. If MovieClip::METHOD_NONE, no data will be sent. |
handler | An object which will be signalled of load events (onLoadStart, onLoadComplete, onLoadInit, onLoadError). Can be null if caller doesn't care. |
URL security is checked in StreamProvider::getStream() down the chain.
If the method is MovieClip::METHOD_NONE, we send no data.
GET: append data to query string.
References url, gnash::movie_root::runResources(), gnash::RunResources::streamProvider(), gnash::StreamProvider::baseURL(), and gnash::MovieClip::METHOD_GET.
void gnash::MovieLoader::processCompletedRequests | ( | ) |
Process all completed movie load requests.
References gnash::MovieLoader::Request::completed(), gnash::key::_1, gnash::MovieLoader::Request::getTarget(), and assert.
Referenced by gnash::movie_root::advanceMovie().
void gnash::MovieLoader::setReachable | ( | ) | const |
References gnash::renderer::opengl::for_each(), and gnash::MovieLoader::Request::setReachable().
Referenced by gnash::movie_root::markReachableResources().