[core] Remove ThreadContext::getFileSource; instead thread FileSource through

This commit is contained in:
John Firebaugh
2016-02-18 10:48:51 -08:00
parent d5eb5240f8
commit 7b39ce9521
23 changed files with 79 additions and 80 deletions

View File

@@ -13,6 +13,7 @@ RasterTileData::RasterTileData(const TileID& id_,
const std::string& urlTemplate,
gl::TexturePool &texturePool_,
Worker& worker_,
FileSource& fileSource,
const std::function<void(std::exception_ptr)>& callback)
: TileData(id_),
texturePool(texturePool_),
@@ -20,7 +21,7 @@ RasterTileData::RasterTileData(const TileID& id_,
state = State::loading;
const Resource resource = Resource::tile(urlTemplate, pixelRatio, id.x, id.y, id.sourceZ);
req = util::ThreadContext::getFileSource()->request(resource, [callback, this](Response res) {
req = fileSource.request(resource, [callback, this](Response res) {
if (res.error) {
callback(std::make_exception_ptr(std::runtime_error(res.error->message)));
} else if (res.notModified) {