Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(159)

Unified Diff: tools/skiaserve/urlhandlers/CmdHandler.cpp

Issue 1737323002: Wire up /batches in skiaserve (Closed) Base URL: https://skia.googlesource.com/skia@skiaserve-1
Patch Set: minor tweak Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/skiaserve/urlhandlers/BatchesHandler.cpp ('k') | tools/skiaserve/urlhandlers/UrlHandler.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/skiaserve/urlhandlers/CmdHandler.cpp
diff --git a/tools/skiaserve/urlhandlers/CmdHandler.cpp b/tools/skiaserve/urlhandlers/CmdHandler.cpp
index c741eb9a4315a84cde6d20f5bc2ba357751264a3..1699bcbcfc923f4a0889c34702920d6c6759b65d 100644
--- a/tools/skiaserve/urlhandlers/CmdHandler.cpp
+++ b/tools/skiaserve/urlhandlers/CmdHandler.cpp
@@ -24,7 +24,7 @@ int CmdHandler::handle(Request* request, MHD_Connection* connection,
SkTArray<SkString> commands;
SkStrSplit(url, "/", &commands);
- if (!request->fPicture.get() || commands.count() > 3) {
+ if (!request->hasPicture() || commands.count() > 3) {
return MHD_NO;
}
@@ -32,11 +32,13 @@ int CmdHandler::handle(Request* request, MHD_Connection* connection,
if (0 == strcmp(method, MHD_HTTP_METHOD_GET)) {
int n;
if (commands.count() == 1) {
- n = request->fDebugCanvas->getSize() - 1;
+ n = request->getLastOp();
} else {
sscanf(commands[1].c_str(), "%d", &n);
}
- return SendJSON(connection, request, n);
+
+ SkAutoTUnref<SkData> data(request->getJsonOps(n));
+ return SendData(connection, data, "application/json");
}
// /cmd/N, for now only delete supported
« no previous file with comments | « tools/skiaserve/urlhandlers/BatchesHandler.cpp ('k') | tools/skiaserve/urlhandlers/UrlHandler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698