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

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

Issue 1741043003: A bit more privacy for SkiaServe's Request (Closed) Base URL: https://skia.googlesource.com/skia@master
Patch Set: Created 4 years, 9 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/skiaserve/Request.cpp ('k') | tools/skiaserve/urlhandlers/ClipAlphaHandler.cpp » ('j') | 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 "UrlHandler.h" 8 #include "UrlHandler.h"
9 9
10 #include "microhttpd.h" 10 #include "microhttpd.h"
(...skipping 20 matching lines...) Expand all
31 return result; 31 return result;
32 } 32 }
33 33
34 34
35 int BreakHandler::handle(Request* request, MHD_Connection* connection, 35 int BreakHandler::handle(Request* request, MHD_Connection* connection,
36 const char* url, const char* method, 36 const char* url, const char* method,
37 const char* upload_data, size_t* upload_data_size) { 37 const char* upload_data, size_t* upload_data_size) {
38 SkTArray<SkString> commands; 38 SkTArray<SkString> commands;
39 SkStrSplit(url, "/", &commands); 39 SkStrSplit(url, "/", &commands);
40 40
41 if (!request->fPicture.get() || commands.count() != 4) { 41 if (!request->hasPicture() || commands.count() != 4) {
42 return MHD_NO; 42 return MHD_NO;
43 } 43 }
44 44
45 // /break/<n>/<x>/<y> 45 // /break/<n>/<x>/<y>
46 int n; 46 int n;
47 sscanf(commands[1].c_str(), "%d", &n); 47 sscanf(commands[1].c_str(), "%d", &n);
48 int x; 48 int x;
49 sscanf(commands[2].c_str(), "%d", &x); 49 sscanf(commands[2].c_str(), "%d", &x);
50 int y; 50 int y;
51 sscanf(commands[3].c_str(), "%d", &y); 51 sscanf(commands[3].c_str(), "%d", &y);
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 break; 90 break;
91 } 91 }
92 } 92 }
93 canvas->restoreToCount(saveCount); 93 canvas->restoreToCount(saveCount);
94 SkDynamicMemoryWStream stream; 94 SkDynamicMemoryWStream stream;
95 stream.writeText(Json::FastWriter().write(response).c_str()); 95 stream.writeText(Json::FastWriter().write(response).c_str());
96 SkAutoTUnref<SkData> data(stream.copyToData()); 96 SkAutoTUnref<SkData> data(stream.copyToData());
97 return SendData(connection, data, "application/json"); 97 return SendData(connection, data, "application/json");
98 } 98 }
99 99
OLDNEW
« no previous file with comments | « tools/skiaserve/Request.cpp ('k') | tools/skiaserve/urlhandlers/ClipAlphaHandler.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698