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

Unified Diff: mojo/shell/loader.cc

Issue 132283003: Mojo: Make the shell's loader log URL fetch errors. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: !is_success Created 6 years, 11 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: mojo/shell/loader.cc
diff --git a/mojo/shell/loader.cc b/mojo/shell/loader.cc
index c5b48b547dc38ad28e43c029f0154234102c13b6..bcee25cce953b13e978c6b12661a285a45ca091d 100644
--- a/mojo/shell/loader.cc
+++ b/mojo/shell/loader.cc
@@ -9,6 +9,8 @@
#include "mojo/shell/switches.h"
#include "net/base/load_flags.h"
#include "net/base/network_delegate.h"
+#include "net/url_request/url_fetcher.h"
+#include "net/url_request/url_request_status.h"
namespace mojo {
namespace shell {
@@ -25,6 +27,15 @@ Loader::Job::~Job() {
}
void Loader::Job::OnURLFetchComplete(const net::URLFetcher* source) {
+ net::URLRequestStatus status = source->GetStatus();
+ if (!status.is_success()) {
+ LOG(ERROR) << "URL fetch didn't succeed: status = " << status.status()
+ << ", error = " << status.error();
+ } else if (source->GetResponseCode() != 200) {
+ LOG(ERROR) << "HTTP response not OK: code = " << source->GetResponseCode();
+ }
+ // TODO: Do something else in the error cases?
+
base::FilePath app_path;
source->GetResponseAsFilePath(true, &app_path);
delegate_->DidCompleteLoad(source->GetURL(), app_path);
« 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