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_controller.h" | 6 #include "sky/engine/core/script/dart_controller.h" |
7 | 7 |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/single_thread_task_runner.h" | 10 #include "base/single_thread_task_runner.h" |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
147 if (!Dart_IsFunction(entry)) | 147 if (!Dart_IsFunction(entry)) |
148 return; | 148 return; |
149 | 149 |
150 Dart_Handle args[] = { | 150 Dart_Handle args[] = { |
151 ToDart(script), | 151 ToDart(script), |
152 }; | 152 }; |
153 DartInvokeAppField(library, ToDart(name), arraysize(args), args); | 153 DartInvokeAppField(library, ToDart(name), arraysize(args), args); |
154 } | 154 } |
155 | 155 |
156 static void UnhandledExceptionCallback(Dart_Handle error) { | 156 static void UnhandledExceptionCallback(Dart_Handle error) { |
157 DCHECK(!Dart_IsError(error)); | |
158 LOG(ERROR) << Dart_GetError(error); | 157 LOG(ERROR) << Dart_GetError(error); |
159 } | 158 } |
160 | 159 |
161 static Dart_Handle LibraryTagHandler(Dart_LibraryTag tag, | 160 static Dart_Handle LibraryTagHandler(Dart_LibraryTag tag, |
162 Dart_Handle library, | 161 Dart_Handle library, |
163 Dart_Handle url) { | 162 Dart_Handle url) { |
164 return DartLoader::HandleLibraryTag(tag, library, url); | 163 return DartLoader::HandleLibraryTag(tag, library, url); |
165 } | 164 } |
166 | 165 |
167 static void IsolateShutdownCallback(void* callback_data) { | 166 static void IsolateShutdownCallback(void* callback_data) { |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
301 | 300 |
302 CHECK(Dart_SetVMFlags(argc, argv)); | 301 CHECK(Dart_SetVMFlags(argc, argv)); |
303 CHECK(Dart_Initialize(IsolateCreateCallback, | 302 CHECK(Dart_Initialize(IsolateCreateCallback, |
304 nullptr, // Isolate interrupt callback. | 303 nullptr, // Isolate interrupt callback. |
305 UnhandledExceptionCallback, IsolateShutdownCallback, | 304 UnhandledExceptionCallback, IsolateShutdownCallback, |
306 // File IO callbacks. | 305 // File IO callbacks. |
307 nullptr, nullptr, nullptr, nullptr, nullptr)); | 306 nullptr, nullptr, nullptr, nullptr, nullptr)); |
308 } | 307 } |
309 | 308 |
310 } // namespace blink | 309 } // namespace blink |
OLD | NEW |