diff options
author | Chris Loer <chris.loer@gmail.com> | 2018-10-16 14:42:20 -0700 |
---|---|---|
committer | Chris Loer <chris.loer@mapbox.com> | 2018-10-17 12:53:24 -0700 |
commit | f510b577aadad43c2ade55c0be3f8289209d559f (patch) | |
tree | de5c5c0f205447442e281674de5a2cd0dc935dcc | |
parent | 53a0ed16f6828d75897a3207c1304d86e79fb530 (diff) | |
download | qtlocation-mapboxgl-f510b577aadad43c2ade55c0be3f8289209d559f.tar.gz |
[core] Promote DefaultFileSource::put to general use.
-rw-r--r-- | include/mbgl/storage/default_file_source.hpp | 12 | ||||
-rw-r--r-- | platform/default/default_file_source.cpp | 8 |
2 files changed, 15 insertions, 5 deletions
diff --git a/include/mbgl/storage/default_file_source.hpp b/include/mbgl/storage/default_file_source.hpp index 929fb3d7c3..6ce7e8c6f9 100644 --- a/include/mbgl/storage/default_file_source.hpp +++ b/include/mbgl/storage/default_file_source.hpp @@ -160,10 +160,20 @@ public: * expired while the file source was paused. */ void resume(); + + /* + * Insert the provided resource into the ambient cache + * + * Consumers of the resource will expect the uncompressed version; the + * OfflineDatabase will determine whether to compress the data on disk. + * This call is asynchronous: the data may not be immediately available + * for in-progress requests, although subsequent requests should have + * access to the cached data. + */ + void put(const Resource&, const Response&); // For testing only. void setOnlineStatus(bool); - void put(const Resource&, const Response&); class Impl; diff --git a/platform/default/default_file_source.cpp b/platform/default/default_file_source.cpp index 99e5c4dff3..cad68e7de9 100644 --- a/platform/default/default_file_source.cpp +++ b/platform/default/default_file_source.cpp @@ -302,6 +302,10 @@ void DefaultFileSource::pause() { void DefaultFileSource::resume() { impl->resume(); } + +void DefaultFileSource::put(const Resource& resource, const Response& response) { + impl->actor().invoke(&Impl::put, resource, response); +} // For testing only: @@ -309,8 +313,4 @@ void DefaultFileSource::setOnlineStatus(const bool status) { impl->actor().invoke(&Impl::setOnlineStatus, status); } -void DefaultFileSource::put(const Resource& resource, const Response& response) { - impl->actor().invoke(&Impl::put, resource, response); -} - } // namespace mbgl |