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

Side by Side Diff: tools/skiaserve/skiaserve.cpp

Issue 1692683002: fixed off-by-one error in skiaserve /cmd (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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 unified diff | Download patch
« no previous file with comments | « tools/debugger/SkDebugCanvas.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2016 Google Inc. 2 * Copyright 2016 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "GrCaps.h" 8 #include "GrCaps.h"
9 #include "GrContextFactory.h" 9 #include "GrContextFactory.h"
10 #include "SkCanvas.h" 10 #include "SkCanvas.h"
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after
226 SkStrSplit(url, "/", &commands); 226 SkStrSplit(url, "/", &commands);
227 227
228 if (!request->fPicture.get() || commands.count() > 3) { 228 if (!request->fPicture.get() || commands.count() > 3) {
229 return MHD_NO; 229 return MHD_NO;
230 } 230 }
231 231
232 // /cmd or /cmd/N 232 // /cmd or /cmd/N
233 if (0 == strcmp(method, MHD_HTTP_METHOD_GET)) { 233 if (0 == strcmp(method, MHD_HTTP_METHOD_GET)) {
234 int n; 234 int n;
235 if (commands.count() == 1) { 235 if (commands.count() == 1) {
236 n = request->fDebugCanvas->getSize() - 1; 236 n = request->fDebugCanvas->getSize();
237 } else { 237 } else {
238 sscanf(commands[1].c_str(), "%d", &n); 238 sscanf(commands[1].c_str(), "%d", &n);
239 } 239 }
240 return SendJSON(connection, request->fDebugCanvas, &request->fUrlDat aManager, n); 240 return SendJSON(connection, request->fDebugCanvas, &request->fUrlDat aManager, n);
241 } 241 }
242 242
243 // /cmd/N, for now only delete supported 243 // /cmd/N, for now only delete supported
244 if (commands.count() == 2 && 0 == strcmp(method, MHD_HTTP_METHOD_DELETE) ) { 244 if (commands.count() == 2 && 0 == strcmp(method, MHD_HTTP_METHOD_DELETE) ) {
245 int n; 245 int n;
246 sscanf(commands[1].c_str(), "%d", &n); 246 sscanf(commands[1].c_str(), "%d", &n);
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after
563 MHD_stop_daemon(daemon); 563 MHD_stop_daemon(daemon);
564 return 0; 564 return 0;
565 } 565 }
566 566
567 #if !defined SK_BUILD_FOR_IOS 567 #if !defined SK_BUILD_FOR_IOS
568 int main(int argc, char** argv) { 568 int main(int argc, char** argv) {
569 SkCommandLineFlags::Parse(argc, argv); 569 SkCommandLineFlags::Parse(argc, argv);
570 return skiaserve_main(); 570 return skiaserve_main();
571 } 571 }
572 #endif 572 #endif
OLDNEW
« no previous file with comments | « tools/debugger/SkDebugCanvas.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698