[core] Added modified, expires information to TileData

This commit is contained in:
Bruno de Oliveira Abinader
2015-11-25 15:06:33 +02:00
parent 31fd2822f5
commit 591e0dde2f
10 changed files with 37 additions and 14 deletions

View File

@@ -25,7 +25,10 @@ VectorTileData::VectorTileData(const TileID& id_,
monitor(std::move(monitor_))
{
state = State::loading;
tileRequest = monitor->monitorTile([callback, this](std::exception_ptr err, std::unique_ptr<GeometryTile> tile) {
tileRequest = monitor->monitorTile([callback, this](std::exception_ptr err,
std::unique_ptr<GeometryTile> tile,
Seconds modified_,
Seconds expires_) {
if (err) {
try {
std::rethrow_exception(err);
@@ -50,6 +53,9 @@ VectorTileData::VectorTileData(const TileID& id_,
state = State::partial;
}
modified = modified_;
expires = expires_;
// Kick off a fresh parse of this tile. This happens when the tile is new, or
// when tile data changed. Replacing the workdRequest will cancel a pending work
// request in case there is one.