diff options
author | Leith Bade <leith@mapbox.com> | 2014-12-02 19:40:07 +1100 |
---|---|---|
committer | Leith Bade <leith@mapbox.com> | 2014-12-02 19:41:50 +1100 |
commit | 2b865224127c2b5126e089e6384795282c3601cd (patch) | |
tree | 2d17d5834b1f48c5d49d0f17a5b914fe875c078d /include | |
parent | 9a8c018a32c351954f96cfe587c3f108ce4a986b (diff) | |
download | qtlocation-mapboxgl-2b865224127c2b5126e089e6384795282c3601cd.tar.gz |
Share asset_request between platforms
Diffstat (limited to 'include')
-rw-r--r-- | include/mbgl/storage/asset_request.hpp (renamed from include/mbgl/platform/android/asset_request.hpp) | 0 | ||||
-rw-r--r-- | include/mbgl/storage/asset_request_baton.hpp (renamed from include/mbgl/platform/android/asset_request_baton.hpp) | 20 |
2 files changed, 11 insertions, 9 deletions
diff --git a/include/mbgl/platform/android/asset_request.hpp b/include/mbgl/storage/asset_request.hpp index 3114d41ad2..3114d41ad2 100644 --- a/include/mbgl/platform/android/asset_request.hpp +++ b/include/mbgl/storage/asset_request.hpp diff --git a/include/mbgl/platform/android/asset_request_baton.hpp b/include/mbgl/storage/asset_request_baton.hpp index 1acbfbae0d..b9c3372595 100644 --- a/include/mbgl/platform/android/asset_request_baton.hpp +++ b/include/mbgl/storage/asset_request_baton.hpp @@ -1,10 +1,9 @@ #ifndef MBGL_STORAGE_ASSET_REQUEST_BATON #define MBGL_STORAGE_ASSET_REQUEST_BATON -#include <mbgl/platform/android/asset_request.hpp> +#include <mbgl/storage/asset_request.hpp> #include <uv.h> -#include <zip.h> namespace mbgl { @@ -12,18 +11,21 @@ struct AssetRequestBaton { AssetRequestBaton(AssetRequest *request_, const std::string &path, uv_loop_t *loop); ~AssetRequestBaton(); - void cancel(); - static void run(uv_async_t *async); - static void notify_error(uv_async_t *async, const int code, const char *message); - static void cleanup(uv_async_t *async); - const unsigned long thread_id; AssetRequest *request = nullptr; std::unique_ptr<uv_async_t> async_run; - struct zip *apk = nullptr; - struct zip_file *apk_file = nullptr; std::string path; bool canceled = false; + + void cancel(); + static void notify_error(uv_async_t *async, const int code, const char *message); + static void cleanup(uv_async_t *async); + + // IMPLEMENT THIS PLATFORM SPECIFIC FUNCTION: + + // Called to load the asset. Platform-specific implementation. + static void run(uv_async_t *async); + }; |