[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:
committed by
Thiago Marcos P. Santos
parent
bc5e9afd0d
commit
4c2e720b15
@@ -115,6 +115,9 @@ public:
|
||||
*/
|
||||
void setOfflineMapboxTileCountLimit(uint64_t) const;
|
||||
|
||||
void pause();
|
||||
void resume();
|
||||
|
||||
// For testing only.
|
||||
void put(const Resource&, const Response&);
|
||||
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user