There's no need to do the work that OnlineFileRequest does on a separate thread from the DefaultFileSource thread, and having AsyncTasks proxy to other tasks across a thread boundary adds needless complexity.
29 lines
624 B
C++
29 lines
624 B
C++
#ifndef MBGL_STORAGE_ONLINE_FILE_SOURCE
|
|
#define MBGL_STORAGE_ONLINE_FILE_SOURCE
|
|
|
|
#include <mbgl/storage/file_source.hpp>
|
|
|
|
namespace mbgl {
|
|
|
|
class OnlineFileSource : public FileSource {
|
|
public:
|
|
OnlineFileSource();
|
|
~OnlineFileSource() override;
|
|
|
|
void setAccessToken(const std::string& t) { accessToken = t; }
|
|
std::string getAccessToken() const { return accessToken; }
|
|
|
|
std::unique_ptr<AsyncRequest> request(const Resource&, Callback) override;
|
|
|
|
private:
|
|
friend class OnlineFileRequest;
|
|
|
|
class Impl;
|
|
const std::unique_ptr<Impl> impl;
|
|
std::string accessToken;
|
|
};
|
|
|
|
} // namespace mbgl
|
|
|
|
#endif
|