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

Unified Diff: mojo/fetcher/about_fetcher.cc

Issue 1342093002: Mandoline: let html_viewer handle more contents (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 3 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 | « mojo/fetcher/DEPS ('k') | mojo/fetcher/about_fetcher_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/fetcher/about_fetcher.cc
diff --git a/mojo/fetcher/about_fetcher.cc b/mojo/fetcher/about_fetcher.cc
index ba3fed8396c2c0fb4f2693852f97b37a25117bd8..c09f09d133d5b47715a73e04b07c948936fcca6a 100644
--- a/mojo/fetcher/about_fetcher.cc
+++ b/mojo/fetcher/about_fetcher.cc
@@ -41,14 +41,15 @@ AboutFetcher::AboutFetcher(const GURL& url,
AboutFetcher::~AboutFetcher() {}
void AboutFetcher::BuildResponse() {
- if (url_ != GURL(kAboutBlankURL)) {
- PostToRunCallback(false);
- return;
- }
-
response_ = URLResponse::New();
- response_->url = kAboutBlankURL;
- response_->status_code = 200;
+ response_->url = url_.spec();
+
+ // about: URLs other than about:blank are not supported yet.
+ //
+ // TODO(yzshen): crbug.com/516494 Eventually we need a general solution to
+ // generate error page for network errors/unrecognized app format/etc.
+ response_->status_code = (url_ == GURL(kAboutBlankURL)) ? 200 : 404;
+
response_->mime_type = "text/html";
PostToRunCallback(true);
}
« no previous file with comments | « mojo/fetcher/DEPS ('k') | mojo/fetcher/about_fetcher_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698