OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |