From 50fe38e72a65a8b2ae8de05249781f2b3fbfdbba Mon Sep 17 00:00:00 2001 From: jcgregorio Date: Thu, 25 Feb 2016 07:02:13 -0800 Subject: use the favicon on debugger.skia.org BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1734913002 Review URL: https://codereview.chromium.org/1734913002 --- tools/skiaserve/skiaserve.cpp | 30 +++--------------------------- 1 file changed, 3 insertions(+), 27 deletions(-) (limited to 'tools') diff --git a/tools/skiaserve/skiaserve.cpp b/tools/skiaserve/skiaserve.cpp index 427ce4b8f3..5f6d35fa27 100644 --- a/tools/skiaserve/skiaserve.cpp +++ b/tools/skiaserve/skiaserve.cpp @@ -30,14 +30,12 @@ __SK_FORCE_IMAGE_DECODER_LINKING; DEFINE_string(source, "https://debugger.skia.org", "Where to load the web UI from."); -DEFINE_string(faviconDir, "tools/skiaserve", "The directory of the favicon"); DEFINE_int32(port, 8888, "The port to listen on."); // TODO probably want to make this configurable static const int kImageWidth = 1920; static const int kImageHeight = 1080; -// TODO move to template file SkString generateTemplate(SkString source) { SkString debuggerTemplate; debuggerTemplate.appendf( @@ -49,7 +47,8 @@ SkString generateTemplate(SkString source) { " \n" " \n" " \n" - " \n" + " \n" + " " "\n" "\n" " This is the app." @@ -67,7 +66,7 @@ struct UploadContext { }; struct Request { - Request(SkString rootUrl) + Request(SkString rootUrl) : fUploadContext(nullptr) , fUrlDataManager(rootUrl) , fGPUEnabled(false) {} @@ -680,28 +679,6 @@ public: } }; -class FaviconHandler : public UrlHandler { -public: - bool canHandle(const char* method, const char* url) override { - return 0 == strcmp(method, MHD_HTTP_METHOD_GET) && - 0 == strcmp(url, "/favicon.ico"); - } - - int handle(Request* request, MHD_Connection* connection, - const char* url, const char* method, - const char* upload_data, size_t* upload_data_size) override { - SkString dir(FLAGS_faviconDir[0]); - dir.append("/favicon.ico"); - FILE* ico = fopen(dir.c_str(), "r"); - - SkAutoTUnref data(SkData::NewFromFILE(ico)); - int ret = SendData(connection, data, "image/vnd.microsoft.icon"); - fclose(ico); - return ret; - } -}; - - class RootHandler : public UrlHandler { public: bool canHandle(const char* method, const char* url) override { @@ -729,7 +706,6 @@ public: fHandlers.push_back(new InfoHandler); fHandlers.push_back(new DownloadHandler); fHandlers.push_back(new DataHandler); - fHandlers.push_back(new FaviconHandler); fHandlers.push_back(new BreakHandler); } -- cgit v1.2.3