10#include "microhttpd.h"
19 static const char* kBasePath =
"/enableGPU/";
20 return 0 == strcmp(method, MHD_HTTP_METHOD_POST) &&
21 0 == strncmp(url, kBasePath, strlen(kBasePath));
25 const char* url,
const char* method,
26 const char* upload_data,
size_t* upload_data_size) {
35 sscanf(
commands[1].c_str(),
"%d", &enable);
37 bool success = request->enableGPU(
SkToBool(enable));
39 return SendError(connection,
"Unable to create GPU surface");
void SkStrSplit(const char *str, const char *delimiters, SkStrSplitMode splitMode, TArray< SkString > *out)
static constexpr bool SkToBool(const T &x)
int handle(Request *request, MHD_Connection *connection, const char *url, const char *method, const char *upload_data, size_t *upload_data_size) override
bool canHandle(const char *method, const char *url) override
int SendOK(MHD_Connection *connection)
int SendError(MHD_Connection *connection, const char *msg)