Chromium Code Reviews| Index: sky/engine/core/script/dart_loader.cc |
| diff --git a/sky/engine/core/script/dart_loader.cc b/sky/engine/core/script/dart_loader.cc |
| index 4345dda3c099db161affa41fedbc171cf2a83df4..cc5fc195d48a40290ecc1ba5770012e61cc16745 100644 |
| --- a/sky/engine/core/script/dart_loader.cc |
| +++ b/sky/engine/core/script/dart_loader.cc |
| @@ -59,7 +59,10 @@ class DartLoader::Job : public DartDependency, |
| private: |
| // MojoFetcher::Client |
| void OnReceivedResponse(mojo::URLResponsePtr response) override { |
| - // TODO(abarth): Handle network errors. |
| + if (response->status_code != 200) { |
| + loader_->DidFailJob(this); |
| + return; |
| + } |
| drainer_ = adoptPtr(new DataPipeDrainer(this, response->body.Pass())); |
| } |
| @@ -175,7 +178,8 @@ class DartLoader::WatcherSignaler { |
| }; |
| DartLoader::DartLoader(DartState* dart_state) |
| - : dart_state_(dart_state->GetWeakPtr()), dependency_catcher_(nullptr) { |
| + : dart_state_(dart_state->GetWeakPtr()), |
| + dependency_catcher_(nullptr) { |
|
abarth-chromium
2015/02/14 00:28:06
git cl format will probably undo this change.
|
| } |
| DartLoader::~DartLoader() { |
| @@ -262,4 +266,17 @@ void DartLoader::DidCompleteSourceJob(SourceJob* job, |
| jobs_.remove(job); |
| } |
| +void DartLoader::DidFailJob(Job* job) { |
| + DCHECK(dart_state_); |
| + DartIsolateScope scope(dart_state_->isolate()); |
| + DartApiScope api_scope; |
| + |
| + WatcherSignaler watcher_signaler(*this, job); |
| + |
| + LOG(ERROR) << "Library Load failed: " << job->url().string().utf8().data(); |
| + // TODO(eseidel): Call Dart_LibraryHandleError in the SourceJob case? |
| + |
| + jobs_.remove(job); |
| +} |
| + |
| } // namespace blink |