From 07c0424ab95a5e6b963c6a2f387adb9f2aa26c9b Mon Sep 17 00:00:00 2001 From: "Thiago Marcos P. Santos" Date: Fri, 20 Nov 2015 16:01:35 +0200 Subject: [core] Removed libuv dependency from HTTPCurl* Moved the fd watcher to the RunLoop. So far only needs to be implemented by platforms using HTTPCurlRequest et al. --- include/mbgl/util/run_loop.hpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'include/mbgl/util/run_loop.hpp') diff --git a/include/mbgl/util/run_loop.hpp b/include/mbgl/util/run_loop.hpp index 122f90c3d7..85b8b8d665 100644 --- a/include/mbgl/util/run_loop.hpp +++ b/include/mbgl/util/run_loop.hpp @@ -2,6 +2,7 @@ #define MBGL_UTIL_RUN_LOOP #include +#include #include #include @@ -23,6 +24,13 @@ public: New, }; + enum class Event : uint8_t { + None = 0, + Read = 1, + Write = 2, + ReadWrite = Read | Write, + }; + RunLoop(Type type = Type::Default); ~RunLoop(); @@ -33,6 +41,10 @@ public: void runOnce(); void stop(); + // So far only needed by the libcurl backend. + void addWatch(int fd, Event, std::function&& callback); + void removeWatch(int fd); + // Invoke fn(args...) on this RunLoop. template void invoke(Fn&& fn, Args&&... args) { @@ -96,6 +108,8 @@ public: } private: + MBGL_STORE_THREAD(tid) + template class Invoker : public WorkTask { public: -- cgit v1.2.1