#ifndef MBGL_PLATFORM_REQUEST #define MBGL_PLATFORM_REQUEST #include #include #include #include #include // Forward definition. typedef struct uv_loop_s uv_loop_t; typedef struct uv_async_s uv_async_t; namespace uv { class loop; } namespace mbgl { namespace platform { struct Response; class Request : public std::enable_shared_from_this, private util::noncopyable { public: Request(const std::string &url, std::function callback, std::shared_ptr loop); ~Request(); void complete(); private: static void complete(uv_async_t *async); public: const std::string url; std::unique_ptr res; std::atomic cancelled; public: uv_async_t *async = nullptr; std::shared_ptr loop; }; } } #endif