scope Requests to an Environment object for easier cancelation

we are now scoping all file requests to an environment object. The FileSource implementation treats
this as an opaque pointer, but allows canceling all Requests that are associated with that pointer.
This is necessary to abort all file requests that originated from a particular Map object. Aborting
a file request is different from canceling a file request: A canceled request doesn't have its
callback called, while an aborted request will have its callback called with an error, indicating
that the environment is going to be shut down.
This commit is contained in:
Konstantin Käfer
2015-03-04 12:32:14 +01:00
committed by Konstantin Käfer
parent 8c0acecbe3
commit 9781785ab7
41 changed files with 485 additions and 201 deletions

View File

@@ -14,8 +14,8 @@ VectorTileData::VectorTileData(Tile::ID const& id_,
float mapMaxZoom, util::ptr<Style> style_,
GlyphAtlas& glyphAtlas_, GlyphStore& glyphStore_,
SpriteAtlas& spriteAtlas_, util::ptr<Sprite> sprite_,
const SourceInfo& source_, FileSource &fileSource_)
: TileData(id_, source_, fileSource_),
const SourceInfo& source_, Environment &env_)
: TileData(id_, source_, env_),
glyphAtlas(glyphAtlas_),
glyphStore(glyphStore_),
spriteAtlas(spriteAtlas_),