[tests] Test with OnlineFileSource
When we introduce OfflineFileSource, the behavior of existing tests should not change.
This commit is contained in:
34
include/mbgl/storage/online_file_source.hpp
Normal file
34
include/mbgl/storage/online_file_source.hpp
Normal file
@@ -0,0 +1,34 @@
|
||||
#ifndef MBGL_STORAGE_ONLINE_FILE_SOURCE
|
||||
#define MBGL_STORAGE_ONLINE_FILE_SOURCE
|
||||
|
||||
#include <mbgl/storage/file_source.hpp>
|
||||
#include <mbgl/storage/file_cache.hpp>
|
||||
|
||||
namespace mbgl {
|
||||
|
||||
namespace util {
|
||||
template <typename T> class Thread;
|
||||
} // namespace util
|
||||
|
||||
class OnlineFileSource : public FileSource {
|
||||
public:
|
||||
OnlineFileSource(FileCache *cache, const std::string &root = "");
|
||||
~OnlineFileSource() override;
|
||||
|
||||
void setAccessToken(const std::string& t) { accessToken = t; }
|
||||
std::string getAccessToken() const { return accessToken; }
|
||||
|
||||
std::unique_ptr<FileRequest> request(const Resource&, Callback) override;
|
||||
|
||||
private:
|
||||
friend class OnlineFileRequest;
|
||||
void cancel(const Resource&, FileRequest*);
|
||||
|
||||
class Impl;
|
||||
const std::unique_ptr<util::Thread<Impl>> thread;
|
||||
std::string accessToken;
|
||||
};
|
||||
|
||||
} // namespace mbgl
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user