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 "tonic/dart_library_loader.h" | 5 #include "tonic/dart_library_loader.h" |
6 | 6 |
7 #include "base/callback.h" | 7 #include "base/callback.h" |
8 #include "base/trace_event/trace_event.h" | 8 #include "base/trace_event/trace_event.h" |
9 #include "mojo/common/data_pipe_drainer.h" | 9 #include "mojo/common/data_pipe_drainer.h" |
10 #include "tonic/dart_api_scope.h" | 10 #include "tonic/dart_api_scope.h" |
11 #include "tonic/dart_converter.h" | 11 #include "tonic/dart_converter.h" |
12 #include "tonic/dart_dependency_catcher.h" | 12 #include "tonic/dart_dependency_catcher.h" |
13 #include "tonic/dart_error.h" | 13 #include "tonic/dart_error.h" |
14 #include "tonic/dart_isolate_scope.h" | 14 #include "tonic/dart_isolate_scope.h" |
15 #include "tonic/dart_library_provider.h" | 15 #include "tonic/dart_library_provider.h" |
16 #include "tonic/dart_state.h" | 16 #include "tonic/dart_state.h" |
17 | 17 |
18 using mojo::common::DataPipeDrainer; | 18 using mojo::common::DataPipeDrainer; |
19 | 19 |
20 namespace blink { | 20 namespace tonic { |
21 | 21 |
22 namespace { | 22 namespace { |
23 | 23 |
24 // Helper to erase a T* from a container of std::unique_ptr<T>s. | 24 // Helper to erase a T* from a container of std::unique_ptr<T>s. |
25 template<typename T, typename C> | 25 template<typename T, typename C> |
26 void EraseUniquePtr(C& container, T* item) { | 26 void EraseUniquePtr(C& container, T* item) { |
27 std::unique_ptr<T> key = std::unique_ptr<T>(item); | 27 std::unique_ptr<T> key = std::unique_ptr<T>(item); |
28 container.erase(key); | 28 container.erase(key); |
29 key.release(); | 29 key.release(); |
30 } | 30 } |
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
297 DartApiScope api_scope; | 297 DartApiScope api_scope; |
298 | 298 |
299 WatcherSignaler watcher_signaler(*this, job); | 299 WatcherSignaler watcher_signaler(*this, job); |
300 | 300 |
301 LOG(ERROR) << "Library Load failed: " << job->name(); | 301 LOG(ERROR) << "Library Load failed: " << job->name(); |
302 // TODO(eseidel): Call Dart_LibraryHandleError in the SourceJob case? | 302 // TODO(eseidel): Call Dart_LibraryHandleError in the SourceJob case? |
303 | 303 |
304 EraseUniquePtr<Job>(jobs_, job); | 304 EraseUniquePtr<Job>(jobs_, job); |
305 } | 305 } |
306 | 306 |
307 } // namespace blink | 307 } // namespace tonic |
OLD | NEW |