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 27 matching lines...) Expand all Loading... |
38 fHandlers.push_back(new EnableGPUHandler); | 38 fHandlers.push_back(new EnableGPUHandler); |
39 fHandlers.push_back(new CmdHandler); | 39 fHandlers.push_back(new CmdHandler); |
40 fHandlers.push_back(new InfoHandler); | 40 fHandlers.push_back(new InfoHandler); |
41 fHandlers.push_back(new DownloadHandler); | 41 fHandlers.push_back(new DownloadHandler); |
42 fHandlers.push_back(new DataHandler); | 42 fHandlers.push_back(new DataHandler); |
43 fHandlers.push_back(new BreakHandler); | 43 fHandlers.push_back(new BreakHandler); |
44 fHandlers.push_back(new BatchesHandler); | 44 fHandlers.push_back(new BatchesHandler); |
45 fHandlers.push_back(new BatchBoundsHandler); | 45 fHandlers.push_back(new BatchBoundsHandler); |
46 fHandlers.push_back(new ColorModeHandler); | 46 fHandlers.push_back(new ColorModeHandler); |
47 fHandlers.push_back(new SRGBModeHandler); | 47 fHandlers.push_back(new SRGBModeHandler); |
| 48 fHandlers.push_back(new QuitHandler); |
48 } | 49 } |
49 | 50 |
50 ~UrlManager() { | 51 ~UrlManager() { |
51 for (int i = 0; i < fHandlers.count(); i++) { delete fHandlers[i]; } | 52 for (int i = 0; i < fHandlers.count(); i++) { delete fHandlers[i]; } |
52 } | 53 } |
53 | 54 |
54 // This is clearly not efficient for a large number of urls and handlers | 55 // This is clearly not efficient for a large number of urls and handlers |
55 int invoke(Request* request, MHD_Connection* connection, const char* url, co
nst char* method, | 56 int invoke(Request* request, MHD_Connection* connection, const char* url, co
nst char* method, |
56 const char* upload_data, size_t* upload_data_size) const { | 57 const char* upload_data, size_t* upload_data_size) const { |
57 for (int i = 0; i < fHandlers.count(); i++) { | 58 for (int i = 0; i < fHandlers.count(); i++) { |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 MHD_stop_daemon(daemon); | 119 MHD_stop_daemon(daemon); |
119 return 0; | 120 return 0; |
120 } | 121 } |
121 | 122 |
122 #if !defined SK_BUILD_FOR_IOS | 123 #if !defined SK_BUILD_FOR_IOS |
123 int main(int argc, char** argv) { | 124 int main(int argc, char** argv) { |
124 SkCommandLineFlags::Parse(argc, argv); | 125 SkCommandLineFlags::Parse(argc, argv); |
125 return skiaserve_main(); | 126 return skiaserve_main(); |
126 } | 127 } |
127 #endif | 128 #endif |
OLD | NEW |