Define wxWebSession::ms_defaultSession and ms_factoryMap in the
implementation file to avoid having to make the otherwise unnecessary
wxStringWebSessionFactoryMap type public.
No real changes.
The former can be called from the derived class ctors while the latter
only needs to be called from wxWebRequest itself, so just make it a
friend: this is not ideal, but still better than leaving this public and
simpler than any alternatives.
It doesn't make much sense to specify the conversion here, it would
ideally be taken from the response Content-Type header itself and
currently is just assumed to be UTF-8 anyhow.
Also implement fallback to Latin-1 to avoid losing the data entirely if
it's not in UTF-8.
Default ctor was leaving pointers uninitialized which was dangerous, so
merge it with the other ctor to ensure that we always set them to NULL.
Also make m_response const as it can't be changed after creating the
event.
Check that the stream is valid, if specified at all, and return false if
it isn't -- or if no size was specified and determining stream size
failed.
Check for SetData() success in the test to provide better diagnostics in
case the file it uses is not found (as is the case when running the test
from another directory, for example).
Also pass wxSharedPtr<> by const reference instead of by value to avoid
unnecessary copies.