| 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 "Request.h" | 8 #include "Request.h" |
| 9 #include "Response.h" | 9 #include "Response.h" |
| 10 | 10 |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 fHandlers.push_back(new ImgHandler); | 32 fHandlers.push_back(new ImgHandler); |
| 33 fHandlers.push_back(new ClipAlphaHandler); | 33 fHandlers.push_back(new ClipAlphaHandler); |
| 34 fHandlers.push_back(new EnableGPUHandler); | 34 fHandlers.push_back(new EnableGPUHandler); |
| 35 fHandlers.push_back(new CmdHandler); | 35 fHandlers.push_back(new CmdHandler); |
| 36 fHandlers.push_back(new InfoHandler); | 36 fHandlers.push_back(new InfoHandler); |
| 37 fHandlers.push_back(new DownloadHandler); | 37 fHandlers.push_back(new DownloadHandler); |
| 38 fHandlers.push_back(new DataHandler); | 38 fHandlers.push_back(new DataHandler); |
| 39 fHandlers.push_back(new BreakHandler); | 39 fHandlers.push_back(new BreakHandler); |
| 40 fHandlers.push_back(new BatchesHandler); | 40 fHandlers.push_back(new BatchesHandler); |
| 41 fHandlers.push_back(new BatchBoundsHandler); | 41 fHandlers.push_back(new BatchBoundsHandler); |
| 42 fHandlers.push_back(new ColorModeHandler); |
| 42 } | 43 } |
| 43 | 44 |
| 44 ~UrlManager() { | 45 ~UrlManager() { |
| 45 for (int i = 0; i < fHandlers.count(); i++) { delete fHandlers[i]; } | 46 for (int i = 0; i < fHandlers.count(); i++) { delete fHandlers[i]; } |
| 46 } | 47 } |
| 47 | 48 |
| 48 // This is clearly not efficient for a large number of urls and handlers | 49 // This is clearly not efficient for a large number of urls and handlers |
| 49 int invoke(Request* request, MHD_Connection* connection, const char* url, co
nst char* method, | 50 int invoke(Request* request, MHD_Connection* connection, const char* url, co
nst char* method, |
| 50 const char* upload_data, size_t* upload_data_size) const { | 51 const char* upload_data, size_t* upload_data_size) const { |
| 51 for (int i = 0; i < fHandlers.count(); i++) { | 52 for (int i = 0; i < fHandlers.count(); i++) { |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 MHD_stop_daemon(daemon); | 112 MHD_stop_daemon(daemon); |
| 112 return 0; | 113 return 0; |
| 113 } | 114 } |
| 114 | 115 |
| 115 #if !defined SK_BUILD_FOR_IOS | 116 #if !defined SK_BUILD_FOR_IOS |
| 116 int main(int argc, char** argv) { | 117 int main(int argc, char** argv) { |
| 117 SkCommandLineFlags::Parse(argc, argv); | 118 SkCommandLineFlags::Parse(argc, argv); |
| 118 return skiaserve_main(); | 119 return skiaserve_main(); |
| 119 } | 120 } |
| 120 #endif | 121 #endif |
| OLD | NEW |