Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(115)

Unified Diff: Source/bindings/core/dart/DartApplicationLoader.cpp

Issue 2543703003: Added setting up VMLibraryHooks for Dartium to support resolvePageUri (Closed)
Patch Set: Incorporated Siva suggestion Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/bindings/core/dart/DartApplicationLoader.h ('k') | Source/bindings/core/dart/DartController.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..ac25426c1c31bc578e1cd594af889b0383116bfc 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 blink_library = Dart_LookupLibrary(Dart_NewStringFromCString("dart:_blink"));
+ RELEASE_ASSERT(!Dart_IsError(blink_library));
+
+ Dart_Handle blink_utils_class = Dart_GetType(blink_library, Dart_NewStringFromCString("Blink_Utils"), 0, 0);
+ RELEASE_ASSERT(!Dart_IsError(blink_utils_class));
+
+ Dart_Handle result = Dart_Invoke(blink_utils_class, Dart_NewStringFromCString("_setupHooks"), 0, NULL);
+ if (Dart_IsError(result)) {
+ reportError("Unable to invoke _setupHooks", "dart:_blink");
+ }
+}
+
+
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;
« no previous file with comments | « Source/bindings/core/dart/DartApplicationLoader.h ('k') | Source/bindings/core/dart/DartController.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698