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 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
205 Builtin::SetNativeResolver(Builtin::kMojoInternalLibrary); | 205 Builtin::SetNativeResolver(Builtin::kMojoInternalLibrary); |
206 } | 206 } |
207 | 207 |
208 Dart_ExitIsolate(); | 208 Dart_ExitIsolate(); |
209 | 209 |
210 CHECK(Dart_IsolateMakeRunnable(isolate)); | 210 CHECK(Dart_IsolateMakeRunnable(isolate)); |
211 return isolate; | 211 return isolate; |
212 } | 212 } |
213 | 213 |
214 static void CallHandleMessage(base::WeakPtr<DartState> dart_state) { | 214 static void CallHandleMessage(base::WeakPtr<DartState> dart_state) { |
| 215 TRACE_EVENT0("sky", "CallHandleMessage"); |
| 216 |
215 if (!dart_state) | 217 if (!dart_state) |
216 return; | 218 return; |
217 | 219 |
218 DartIsolateScope scope(dart_state->isolate()); | 220 DartIsolateScope scope(dart_state->isolate()); |
219 DartApiScope api_scope; | 221 DartApiScope api_scope; |
220 LogIfError(Dart_HandleMessage()); | 222 LogIfError(Dart_HandleMessage()); |
221 } | 223 } |
222 | 224 |
223 static void MessageNotifyCallback(Dart_Isolate dest_isolate) { | 225 static void MessageNotifyCallback(Dart_Isolate dest_isolate) { |
224 DCHECK(Platform::current()); | 226 DCHECK(Platform::current()); |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
303 | 305 |
304 CHECK(Dart_SetVMFlags(argc, argv)); | 306 CHECK(Dart_SetVMFlags(argc, argv)); |
305 CHECK(Dart_Initialize(IsolateCreateCallback, | 307 CHECK(Dart_Initialize(IsolateCreateCallback, |
306 nullptr, // Isolate interrupt callback. | 308 nullptr, // Isolate interrupt callback. |
307 UnhandledExceptionCallback, IsolateShutdownCallback, | 309 UnhandledExceptionCallback, IsolateShutdownCallback, |
308 // File IO callbacks. | 310 // File IO callbacks. |
309 nullptr, nullptr, nullptr, nullptr, nullptr)); | 311 nullptr, nullptr, nullptr, nullptr, nullptr)); |
310 } | 312 } |
311 | 313 |
312 } // namespace blink | 314 } // namespace blink |
OLD | NEW |