Chromium Code Reviews| Index: Source/bindings/core/dart/DartApplicationLoader.cpp |
| diff --git a/Source/bindings/core/dart/DartApplicationLoader.cpp b/Source/bindings/core/dart/DartApplicationLoader.cpp |
| index d5cfc76454a8ad6e79e2060fdad44b2debfe398d..489f57b25c81506643c1d2b9230008242769d40b 100644 |
| --- a/Source/bindings/core/dart/DartApplicationLoader.cpp |
| +++ b/Source/bindings/core/dart/DartApplicationLoader.cpp |
| @@ -372,6 +372,7 @@ void DartApplicationLoader::load(PassRefPtr<DartErrorEventDispatcher> errorEvent |
| // invoked. |
| if (m_state == Ready) { |
| // Call the entry point on the main script URL. |
| + setupVMLibraryHooks(); |
| callEntryPoint(); |
| } |
| } |
| @@ -516,6 +517,21 @@ Dart_Handle DartApplicationLoader::topLevelLibrary() |
| return library; |
| } |
| +void DartApplicationLoader::setupVMLibraryHooks() |
| +{ |
| + Dart_Handle builtin_library = Dart_LookupLibrary(Dart_NewStringFromCString("dart:_builtin")); |
| + RELEASE_ASSERT(!Dart_IsError(builtin_library)); |
|
siva
2017/01/06 21:39:33
Wouldn't need this library if the setup code was a
|
| + |
| + // Call Dartium version of _setupHooks to configure VMLibraryHooks. |
| + Dart_Handle dartium_setup_class = Dart_GetType(builtin_library, Dart_NewStringFromCString("DartiumSetup"), 0, 0); |
| + RELEASE_ASSERT(!Dart_IsError(dartium_setup_class)); |
| + Dart_Handle result = Dart_Invoke(dartium_setup_class, Dart_NewStringFromCString("_setupHooks"), 0, NULL); |
| + if (Dart_IsError(result)) { |
| + reportError("Unable to invoke _setupHooks", "dart:_builtin"); |
| + } |
| +} |
| + |
| + |
| void DartApplicationLoader::findDependences(const String& url, const String& source, intptr_t lineNumber) |
| { |
| ASSERT(m_pendingLibraries.contains(url) || m_pendingSource.contains(url)); |
| @@ -762,7 +778,7 @@ private: |
| ResourcePtr<ScriptResource> m_scriptResource; |
| }; |
| -static String resolveUrl(String mainLibraryURL, const String& url, const String& packageRootOverride) |
| +String DartApplicationLoader::resolveUrl(String mainLibraryURL, const String& url, const String& packageRootOverride) |
| { |
| if (!url.startsWith("package:") || url.startsWith("package://")) |
| return url; |