Index: mojo/shell/loader.cc |
diff --git a/mojo/shell/loader.cc b/mojo/shell/loader.cc |
index c5b48b547dc38ad28e43c029f0154234102c13b6..b98484ad5c35dc1bfa29d35732b76e26b675d495 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.status() != net::URLRequestStatus::SUCCESS) { |
darin (slow to review)
2014/01/09 20:57:19
nit: You could also use |!status.is_success()| her
viettrungluu
2014/01/09 21:02:50
Done.
|
+ 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); |