diff options
author | Alexander Shalamov <alexander.shalamov@mapbox.com> | 2020-01-24 20:19:58 +0200 |
---|---|---|
committer | Alexander Shalamov <alexander.shalamov@mapbox.com> | 2020-01-27 14:25:37 +0300 |
commit | 9ec2e2aff79e9a94d751a7644daf229261ecfe4c (patch) | |
tree | c8f3994c84e47ddb418a0a264515dba13e0c1d1e | |
parent | 429292fb9898cbcf3f2a0b644e01277473124252 (diff) | |
download | qtlocation-mapboxgl-9ec2e2aff79e9a94d751a7644daf229261ecfe4c.tar.gz |
[core] Add pause and resume to database filesource implementation
-rw-r--r-- | include/mbgl/storage/database_file_source.hpp | 2 | ||||
-rw-r--r-- | platform/default/src/mbgl/storage/database_file_source.cpp | 11 |
2 files changed, 13 insertions, 0 deletions
diff --git a/include/mbgl/storage/database_file_source.hpp b/include/mbgl/storage/database_file_source.hpp index 8ccb5ce39b..81e5315fd8 100644 --- a/include/mbgl/storage/database_file_source.hpp +++ b/include/mbgl/storage/database_file_source.hpp @@ -20,6 +20,8 @@ public: void forward(const Resource&, const Response&, std::function<void()> callback) override; bool canRequest(const Resource&) const override; void setProperty(const std::string&, const mapbox::base::Value&) override; + void pause() override; + void resume() override; // Methods common to Ambient cache and Offline functionality diff --git a/platform/default/src/mbgl/storage/database_file_source.cpp b/platform/default/src/mbgl/storage/database_file_source.cpp index ba8ba7b31d..b46693849a 100644 --- a/platform/default/src/mbgl/storage/database_file_source.cpp +++ b/platform/default/src/mbgl/storage/database_file_source.cpp @@ -153,6 +153,9 @@ public: ActorRef<DatabaseFileSourceThread> actor() const { return thread->actor(); } + void pause() { thread->pause(); } + void resume() { thread->resume(); } + private: const std::unique_ptr<util::Thread<DatabaseFileSourceThread>> thread; }; @@ -277,4 +280,12 @@ void DatabaseFileSource::setProperty(const std::string& key, const mapbox::base: } } +void DatabaseFileSource::pause() { + impl->pause(); +} + +void DatabaseFileSource::resume() { + impl->resume(); +} + } // namespace mbgl |