Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Commit

Permalink
[core] Prepare for OfflineFileSource
Browse files Browse the repository at this point in the history
* Rename existing DefaultFileSource to OnlineFileSource
* Restore a DefaultFileSource that's a passthrough to OnlineFileSource
  • Loading branch information
jfirebaugh committed Dec 21, 2015
1 parent 49bfdd6 commit 913f49c
Show file tree
Hide file tree
Showing 4 changed files with 508 additions and 448 deletions.
21 changes: 7 additions & 14 deletions include/mbgl/storage/default_file_source.hpp
Original file line number Diff line number Diff line change
@@ -1,32 +1,25 @@
#ifndef MBGL_STORAGE_DEFAULT_DEFAULT_FILE_SOURCE
#define MBGL_STORAGE_DEFAULT_DEFAULT_FILE_SOURCE
#ifndef MBGL_STORAGE_DEFAULT_FILE_SOURCE
#define MBGL_STORAGE_DEFAULT_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 FileCache;

class DefaultFileSource : public FileSource {
public:
DefaultFileSource(FileCache *cache, const std::string &root = "");
DefaultFileSource(FileCache*, const std::string& root = "");
~DefaultFileSource() override;

void setAccessToken(const std::string& t) { accessToken = t; }
std::string getAccessToken() const { return accessToken; }
void setAccessToken(const std::string&);
std::string getAccessToken() const;

std::unique_ptr<FileRequest> request(const Resource&, Callback) override;

private:
friend class DefaultFileRequest;
void cancel(const Resource&, FileRequest*);

class Impl;
const std::unique_ptr<util::Thread<Impl>> thread;
std::string accessToken;
const std::unique_ptr<Impl> impl;
};

} // namespace mbgl
Expand Down
Loading

0 comments on commit 913f49c

Please sign in to comment.