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

Unified Diff: tools/skiaserve/skiaserve.cpp

Issue 1734913002: Move the favicon to debugger.skia.org. (Closed) Base URL: https://skia.googlesource.com/skia@master
Patch Set: rebase Created 4 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/skiaserve/skiaserve.cpp
diff --git a/tools/skiaserve/skiaserve.cpp b/tools/skiaserve/skiaserve.cpp
index 70d93e93d8d6508bca270c86e770fb2493ba4668..96760b91aaba52db157aaeefd63211de3cda4876 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);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698