summaryrefslogtreecommitdiff
path: root/include/mbgl/storage/http_request.hpp
blob: 30f7b3aa6db664d7b933aa58139f92fa19c923ec (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#ifndef MBGL_STORAGE_HTTP_REQUEST
#define MBGL_STORAGE_HTTP_REQUEST

#include <mbgl/storage/resource_type.hpp>
#include <mbgl/storage/base_request.hpp>

#include <string>
#include <memory>
#include <cassert>

typedef struct uv_loop_s uv_loop_t;

namespace mbgl {

struct CacheRequestBaton;
struct HTTPRequestBaton;
struct CacheEntry;
class SQLiteStore;

class HTTPRequest : public BaseRequest {
public:
    HTTPRequest(ResourceType type, const std::string &path, uv_loop_t *loop, std::shared_ptr<SQLiteStore> store);
    ~HTTPRequest();

private:
    void loadedCacheEntry(std::unique_ptr<Response> &&response);

private:
    const unsigned long thread_id;
    CacheRequestBaton *cache_baton = nullptr;
    HTTPRequestBaton *http_baton = nullptr;
    std::shared_ptr<SQLiteStore> store;
    const ResourceType type;
};

}

#endif