Added aliases for std::chrono typedefs (eg. 'Seconds' for std::chrono::seconds). These aliases are used together with templated helper functions to replace time_t with std::chrono::seconds for most cases, in particular for 'modified' and 'expires' values in Response.
28 lines
627 B
C++
28 lines
627 B
C++
#ifndef MBGL_STORAGE_HTTP_REQUEST_BASE
|
|
#define MBGL_STORAGE_HTTP_REQUEST_BASE
|
|
|
|
#include <mbgl/storage/request_base.hpp>
|
|
#include <mbgl/util/chrono.hpp>
|
|
|
|
namespace mbgl {
|
|
|
|
class HTTPRequestBase : public RequestBase {
|
|
public:
|
|
HTTPRequestBase(const Resource& resource_, Callback notify_)
|
|
: RequestBase(resource_, notify_)
|
|
, cancelled(false) {
|
|
}
|
|
|
|
virtual ~HTTPRequestBase() = default;
|
|
virtual void cancel() override { cancelled = true; };
|
|
|
|
protected:
|
|
static Seconds parseCacheControl(const char *value);
|
|
|
|
bool cancelled;
|
|
};
|
|
|
|
} // namespace mbgl
|
|
|
|
#endif // MBGL_STORAGE_HTTP_REQUEST_BASE
|