summaryrefslogtreecommitdiff
path: root/src/mbgl/tile/vector_tile.cpp
diff options
context:
space:
mode:
authorJohn Firebaugh <john.firebaugh@gmail.com>2016-02-18 10:48:51 -0800
committerJohn Firebaugh <john.firebaugh@gmail.com>2016-02-18 15:15:24 -0800
commit7b39ce95210ceb6640b3a3399dacd1d0e826ac1f (patch)
treeeb97fdc8a284826d3a3fe9426a8a10f88a654799 /src/mbgl/tile/vector_tile.cpp
parentd5eb5240f8c35016927e89bf9d186addc09b83fa (diff)
downloadqtlocation-mapboxgl-7b39ce95210ceb6640b3a3399dacd1d0e826ac1f.tar.gz
[core] Remove ThreadContext::getFileSource; instead thread FileSource through
Diffstat (limited to 'src/mbgl/tile/vector_tile.cpp')
-rw-r--r--src/mbgl/tile/vector_tile.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/mbgl/tile/vector_tile.cpp b/src/mbgl/tile/vector_tile.cpp
index da070abe2e..9e35debbff 100644
--- a/src/mbgl/tile/vector_tile.cpp
+++ b/src/mbgl/tile/vector_tile.cpp
@@ -3,7 +3,6 @@
#include <mbgl/storage/resource.hpp>
#include <mbgl/storage/response.hpp>
#include <mbgl/storage/file_source.hpp>
-#include <mbgl/util/thread_context.hpp>
#include <mbgl/util/url.hpp>
#include <utility>
@@ -182,15 +181,16 @@ util::ptr<const GeometryTileFeature> VectorTileLayer::getFeature(std::size_t i)
return std::make_shared<VectorTileFeature>(features.at(i), *this);
}
-VectorTileMonitor::VectorTileMonitor(const TileID& tileID_, float pixelRatio_, const std::string& urlTemplate_)
+VectorTileMonitor::VectorTileMonitor(const TileID& tileID_, float pixelRatio_, const std::string& urlTemplate_, FileSource& fileSource_)
: tileID(tileID_),
pixelRatio(pixelRatio_),
- urlTemplate(urlTemplate_) {
+ urlTemplate(urlTemplate_),
+ fileSource(fileSource_) {
}
std::unique_ptr<FileRequest> VectorTileMonitor::monitorTile(const GeometryTileMonitor::Callback& callback) {
const Resource resource = Resource::tile(urlTemplate, pixelRatio, tileID.x, tileID.y, tileID.sourceZ);
- return util::ThreadContext::getFileSource()->request(resource, [callback, this](Response res) {
+ return fileSource.request(resource, [callback, this](Response res) {
if (res.error) {
callback(std::make_exception_ptr(std::runtime_error(res.error->message)), nullptr, res.modified, res.expires);
} else if (res.notModified) {