[core] Privatize SQLiteCache

This commit is contained in:
John Firebaugh
2016-01-06 18:01:31 -08:00
parent 0a8fef1f51
commit e7b0b31d58
9 changed files with 26 additions and 29 deletions

View File

@@ -75,8 +75,7 @@ NativeMapView::NativeMapView(JNIEnv *env, jobject obj_, float pixelRatio_, int a
return;
}
fileCache = mbgl::SharedSQLiteCache::get(mbgl::android::cachePath + "/mbgl-cache.db");
fileSource = std::make_unique<mbgl::DefaultFileSource>(fileCache.get());
fileSource = std::make_unique<mbgl::DefaultFileSource>(mbgl::android::cachePath + "/mbgl-cache.db");
map = std::make_unique<mbgl::Map>(*this, *fileSource, MapMode::Continuous);
float zoomFactor = map->getMaxZoom() - map->getMinZoom() + 1;
@@ -103,7 +102,6 @@ NativeMapView::~NativeMapView() {
map.reset();
fileSource.reset();
fileCache.reset();
jint ret;
JNIEnv *env = nullptr;

View File

@@ -4,7 +4,6 @@
#include <mbgl/map/map.hpp>
#include <mbgl/map/view.hpp>
#include <mbgl/util/noncopyable.hpp>
#include <mbgl/storage/sqlite_cache.hpp>
#include <mbgl/storage/default_file_source.hpp>
#include <string>
@@ -91,7 +90,6 @@ private:
JNIEnv *renderEnv = nullptr;
// Ensure these are initialised last
std::shared_ptr<mbgl::SQLiteCache> fileCache;
std::unique_ptr<mbgl::DefaultFileSource> fileSource;
std::unique_ptr<mbgl::Map> map;
};