diff options
author | joshualitt <joshualitt@chromium.org> | 2016-02-25 11:09:36 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-02-25 11:09:36 -0800 |
commit | 26cc3f5ad0aacf80bba162bab4b23a2901ffed17 (patch) | |
tree | 168101fd5149e573de913509b090a37296039b4c /tools/skiaserve/Response.h | |
parent | b56f92783a5d84347b65f4f01ec3668096649d13 (diff) |
Create Response namespace for skiaserve response functions
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1739763002
Review URL: https://codereview.chromium.org/1739763002
Diffstat (limited to 'tools/skiaserve/Response.h')
-rw-r--r-- | tools/skiaserve/Response.h | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/tools/skiaserve/Response.h b/tools/skiaserve/Response.h new file mode 100644 index 0000000000..ef115e9d23 --- /dev/null +++ b/tools/skiaserve/Response.h @@ -0,0 +1,30 @@ +/* + * Copyright 2016 Google Inc. + * + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +#ifndef Reponse_DEFINED +#define Reponse_DEFINED + +struct MHD_Connection; +struct Request; +class SkData; + +namespace Response { + // SendOK just sends an empty response with a 200 OK status code. + int SendOK(MHD_Connection* connection); + + int SendError(MHD_Connection* connection, const char* msg); + + int SendData(MHD_Connection* connection, const SkData* data, const char* type, + bool setContentDisposition = false, const char* dispositionString = nullptr); + + int SendJSON(MHD_Connection* connection, Request* request, int n); + + int SendTemplate(MHD_Connection* connection, bool redirect = false, + const char* redirectUrl = nullptr); +} + +#endif |