Gnash
0.8.11dev
|
A StreamProvider makes IOChannels available to the core on request. More...
#include <StreamProvider.h>
Public Member Functions | |
StreamProvider (URL original, URL base, std::unique_ptr< NamingPolicy > np=std::unique_ptr< NamingPolicy >(new NamingPolicy)) | |
Construct a StreamProvider. More... | |
virtual | ~StreamProvider () |
virtual std::unique_ptr< IOChannel > | getStream (const URL &url, bool namedCacheFile=false) const |
Returned stream ownership is transferred to caller. More... | |
virtual std::unique_ptr< IOChannel > | getStream (const URL &url, const std::string &postdata, bool namedCacheFile=false) const |
Get a stream from the response of a POST operation. More... | |
virtual std::unique_ptr< IOChannel > | getStream (const URL &url, const std::string &postdata, const NetworkAdapter::RequestHeaders &headers, bool namedCacheFile=false) const |
void | setNamingPolicy (std::unique_ptr< NamingPolicy > np) |
Set the NamingPolicy for cache files. More... | |
const NamingPolicy & | namingPolicy () const |
Return the currently selected policy for converting URL to filename. More... | |
bool | allow (const URL &url) const |
Check whether access to a URL is allowed. More... | |
const URL & | baseURL () const |
The base URL that should be used to resolve all relative URLs. More... | |
A StreamProvider makes IOChannels available to the core on request.
The current functions of this class are:
The class should in future also:
gnash::StreamProvider::StreamProvider | ( | URL | original, |
URL | base, | ||
std::unique_ptr< NamingPolicy > | np = std::unique_ptr<NamingPolicy>(new NamingPolicy) |
||
) |
Construct a StreamProvider.
|
inlinevirtual |
References url.
bool gnash::StreamProvider::allow | ( | const URL & | url | ) | const |
Check whether access to a URL is allowed.
This is used by the core to check whether a connection can be made before trying to make it. It's useful currently for some functions to decide what to return.
url | The url to check |
References gnash::URLAccessManager::allow().
Referenced by gnash::NetConnection_as::connect(), gnash::externalinterface_class_init(), getStream(), and gnash::NetConnection_as::validateURL().
|
inline |
The base URL that should be used to resolve all relative URLs.
TODO: drop this if possible and handle all resolution in this class.
Referenced by gnash::NetConnection_as::connect(), gnash::SWF::ImportAssetsTag::executeState(), gnash::externalinterface_class_init(), gnash::NetConnection_as::getStream(), gnash::movie_root::getURL(), gnash::MovieLoader::loadMovie(), gnash::MovieClip::loadVariables(), gnash::registerLocalConnectionNative(), gnash::registerSoundNative(), gnash::Gui::takeScreenShot(), and gnash::NetConnection_as::validateURL().
|
virtual |
Returned stream ownership is transferred to caller.
On error NULL is returned Derive from this for a CachingStreamProvider
References _, allow(), gnash::log_error(), gnash::makeFileChannel(), gnash::NetworkAdapter::makeStream(), namingPolicy(), gnash::URL::path(), path, gnash::URL::protocol(), gnash::URL::str(), and url.
Referenced by gnash::MovieFactory::clear(), getStream(), gnash::NetConnection_as::getStream(), gnash::LoadVariablesThread::LoadVariablesThread(), and gnash::registerSoundNative().
|
virtual |
Get a stream from the response of a POST operation.
Returned stream ownership is transferred to caller.
On error NULL is returned Derive from this for a CachingStreamProvider
url | The url to post to. |
postdata | Post data in url-encoded form. |
References _, allow(), gnash::log_error(), gnash::makeFileChannel(), gnash::NetworkAdapter::makeStream(), namingPolicy(), gnash::URL::path(), path, gnash::URL::protocol(), gnash::URL::str(), and url.
|
virtual |
References _, allow(), getStream(), gnash::log_error(), gnash::NetworkAdapter::makeStream(), namingPolicy(), gnash::URL::protocol(), gnash::URL::str(), and url.
|
inline |
Return the currently selected policy for converting URL to filename.
References gnash::URLAccessManager::allow().
Referenced by getStream().
|
inline |
Set the NamingPolicy for cache files.
This is only used when cache file naming is requested in getStream() This StreamProvider owns the NamingPolicy instance.