summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/mbgl/storage/asset_context_base.hpp20
-rw-r--r--src/mbgl/storage/asset_file_source.hpp26
-rw-r--r--src/mbgl/util/url.cpp8
-rw-r--r--src/mbgl/util/url.hpp2
4 files changed, 26 insertions, 30 deletions
diff --git a/src/mbgl/storage/asset_context_base.hpp b/src/mbgl/storage/asset_context_base.hpp
deleted file mode 100644
index 92138615b5..0000000000
--- a/src/mbgl/storage/asset_context_base.hpp
+++ /dev/null
@@ -1,20 +0,0 @@
-#ifndef MBGL_STORAGE_ASSET_CONTEXT_BASE
-#define MBGL_STORAGE_ASSET_CONTEXT_BASE
-
-#include <mbgl/storage/request_base.hpp>
-
-namespace mbgl {
-
-class AssetContextBase {
-public:
- static std::unique_ptr<AssetContextBase> createContext();
-
- virtual ~AssetContextBase() = default;
- virtual RequestBase* createRequest(const std::string& url,
- RequestBase::Callback,
- const std::string& assetRoot) = 0;
-};
-
-} // namespace mbgl
-
-#endif // MBGL_STORAGE_ASSET_CONTEXT_BASE
diff --git a/src/mbgl/storage/asset_file_source.hpp b/src/mbgl/storage/asset_file_source.hpp
new file mode 100644
index 0000000000..11a430e124
--- /dev/null
+++ b/src/mbgl/storage/asset_file_source.hpp
@@ -0,0 +1,26 @@
+#ifndef MBGL_STORAGE_ASSET_FILE_SOURCE
+#define MBGL_STORAGE_ASSET_FILE_SOURCE
+
+#include <mbgl/storage/file_source.hpp>
+
+namespace mbgl {
+
+namespace util {
+template <typename T> class Thread;
+} // namespace util
+
+class AssetFileSource : public FileSource {
+public:
+ AssetFileSource(const std::string& assetRoot);
+ ~AssetFileSource() override;
+
+ std::unique_ptr<FileRequest> request(const Resource&, Callback) override;
+
+private:
+ class Impl;
+ std::unique_ptr<util::Thread<Impl>> thread;
+};
+
+} // namespace mbgl
+
+#endif // MBGL_STORAGE_ASSET_FILE_SOURCE
diff --git a/src/mbgl/util/url.cpp b/src/mbgl/util/url.cpp
index 1bd9f410fe..85d8bc5bd0 100644
--- a/src/mbgl/util/url.cpp
+++ b/src/mbgl/util/url.cpp
@@ -71,13 +71,5 @@ std::string templateTileURL(const std::string& url, const TileID& id, float pixe
});
}
-namespace {
-const std::string assetProtocol = "asset://";
-}
-
-bool isAssetURL(const std::string& url) {
- return std::equal(assetProtocol.begin(), assetProtocol.end(), url.begin());
-}
-
} // namespace util
} // namespace mbgl
diff --git a/src/mbgl/util/url.hpp b/src/mbgl/util/url.hpp
index da4cfb2672..550fff8aa1 100644
--- a/src/mbgl/util/url.hpp
+++ b/src/mbgl/util/url.hpp
@@ -14,8 +14,6 @@ std::string percentDecode(const std::string&);
std::string templateTileURL(const std::string& url, const TileID& id, float pixelRatio = 1);
-bool isAssetURL(const std::string&);
-
} // namespace util
} // namespace mbgl