diff options
author | jcgregorio <jcgregorio@google.com> | 2016-02-25 07:02:13 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-02-25 07:02:13 -0800 |
commit | 50fe38e72a65a8b2ae8de05249781f2b3fbfdbba (patch) | |
tree | f97de1ab4ac19d4fc392d0cbd82ca50dfb031417 /tools/skiaserve/skiaserve.cpp | |
parent | bb5f309bce6d454d71c28d613997490d63d2b73b (diff) |
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
Diffstat (limited to 'tools/skiaserve/skiaserve.cpp')
-rw-r--r-- | tools/skiaserve/skiaserve.cpp | 30 |
1 files changed, 3 insertions, 27 deletions
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) { " <meta http-equiv=\"X-UA-Compatible\" content=\"IE=egde,chrome=1\">\n" " <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n" " <script src=\"%s/res/js/core.js\" type=\"text/javascript\" charset=\"utf-8\"></script>\n" - " <link href=\"%s/res/vul/elements.html\" rel=\"import\" />\n" + " <link href=\"%s/res/vul/elements.html\" rel=\"import\" />\n" + " <link rel='shortcut icon' href='https://debugger.skia.org/res/img/favicon.ico' type='image/x-icon'/ >" "</head>\n" "<body class=\"fullbleed layout vertical\">\n" " <debugger-app-sk>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<SkData> 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); } |