[core] Add a pause/resume API to the DefaultFileSource

It will halt the networking thread completely. Expired and error'ed
tiles won't get re-requested until resume() is called again.
This commit is contained in:
Thiago Marcos P. Santos
2017-02-24 15:08:49 +02:00
committed by Thiago Marcos P. Santos
parent bc5e9afd0d
commit 4c2e720b15
2 changed files with 11 additions and 0 deletions

View File

@@ -115,6 +115,9 @@ public:
*/
void setOfflineMapboxTileCountLimit(uint64_t) const;
void pause();
void resume();
// For testing only.
void put(const Resource&, const Response&);

View File

@@ -261,6 +261,14 @@ void DefaultFileSource::setOfflineMapboxTileCountLimit(uint64_t limit) const {
thread->invokeSync(&Impl::setOfflineMapboxTileCountLimit, limit);
}
void DefaultFileSource::pause() {
thread->pause();
}
void DefaultFileSource::resume() {
thread->resume();
}
// For testing only:
void DefaultFileSource::put(const Resource& resource, const Response& response) {