aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools/skiaserve/Response.h
diff options
context:
space:
mode:
authorGravatar joshualitt <joshualitt@chromium.org>2016-02-25 11:09:36 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2016-02-25 11:09:36 -0800
commit26cc3f5ad0aacf80bba162bab4b23a2901ffed17 (patch)
tree168101fd5149e573de913509b090a37296039b4c /tools/skiaserve/Response.h
parentb56f92783a5d84347b65f4f01ec3668096649d13 (diff)
Create Response namespace for skiaserve response functions
Diffstat (limited to 'tools/skiaserve/Response.h')
-rw-r--r--tools/skiaserve/Response.h30
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