| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "sky/engine/config.h" | 5 #include "sky/engine/config.h" |
| 6 #include "sky/engine/core/script/dart_loader.h" | 6 #include "sky/engine/core/script/dart_loader.h" |
| 7 | 7 |
| 8 #include "base/callback.h" | 8 #include "base/callback.h" |
| 9 #include "base/trace_event/trace_event.h" | 9 #include "base/trace_event/trace_event.h" |
| 10 #include "mojo/common/data_pipe_drainer.h" | 10 #include "mojo/common/data_pipe_drainer.h" |
| (...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 232 void DartLoader::WaitForDependencies( | 232 void DartLoader::WaitForDependencies( |
| 233 const HashSet<DartDependency*>& dependencies, | 233 const HashSet<DartDependency*>& dependencies, |
| 234 const base::Closure& callback) { | 234 const base::Closure& callback) { |
| 235 if (dependencies.isEmpty()) | 235 if (dependencies.isEmpty()) |
| 236 return callback.Run(); | 236 return callback.Run(); |
| 237 dependency_watchers_.add( | 237 dependency_watchers_.add( |
| 238 adoptPtr(new DependencyWatcher(dependencies, callback))); | 238 adoptPtr(new DependencyWatcher(dependencies, callback))); |
| 239 } | 239 } |
| 240 | 240 |
| 241 void DartLoader::LoadLibrary(const KURL& url, mojo::URLResponsePtr response) { | 241 void DartLoader::LoadLibrary(const KURL& url, mojo::URLResponsePtr response) { |
| 242 if (response && response->status_code >= 400) { |
| 243 LOG(ERROR) << url.string().utf8().data() |
| 244 << " failed with " << response->status_code; |
| 245 } |
| 246 |
| 242 const auto& result = pending_libraries_.add(url.string(), nullptr); | 247 const auto& result = pending_libraries_.add(url.string(), nullptr); |
| 243 if (result.isNewEntry) { | 248 if (result.isNewEntry) { |
| 244 OwnPtr<Job> job = adoptPtr(new ImportJob(this, url)); | 249 OwnPtr<Job> job = adoptPtr(new ImportJob(this, url)); |
| 245 result.storedValue->value = job.get(); | 250 result.storedValue->value = job.get(); |
| 246 jobs_.add(job.release()); | 251 jobs_.add(job.release()); |
| 247 } | 252 } |
| 248 if (dependency_catcher_) | 253 if (dependency_catcher_) |
| 249 dependency_catcher_->AddDependency(result.storedValue->value); | 254 dependency_catcher_->AddDependency(result.storedValue->value); |
| 250 } | 255 } |
| 251 | 256 |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 303 | 308 |
| 304 WatcherSignaler watcher_signaler(*this, job); | 309 WatcherSignaler watcher_signaler(*this, job); |
| 305 | 310 |
| 306 LOG(ERROR) << "Library Load failed: " << job->url().string().utf8().data(); | 311 LOG(ERROR) << "Library Load failed: " << job->url().string().utf8().data(); |
| 307 // TODO(eseidel): Call Dart_LibraryHandleError in the SourceJob case? | 312 // TODO(eseidel): Call Dart_LibraryHandleError in the SourceJob case? |
| 308 | 313 |
| 309 jobs_.remove(job); | 314 jobs_.remove(job); |
| 310 } | 315 } |
| 311 | 316 |
| 312 } // namespace blink | 317 } // namespace blink |
| OLD | NEW |