OLD | NEW |
1 // Copyright (c) 2009, Google Inc. | 1 // Copyright (c) 2009, Google Inc. |
2 // All rights reserved. | 2 // All rights reserved. |
3 // | 3 // |
4 // Redistribution and use in source and binary forms, with or without | 4 // Redistribution and use in source and binary forms, with or without |
5 // modification, are permitted provided that the following conditions are | 5 // modification, are permitted provided that the following conditions are |
6 // met: | 6 // met: |
7 // | 7 // |
8 // * Redistributions of source code must retain the above copyright | 8 // * Redistributions of source code must retain the above copyright |
9 // notice, this list of conditions and the following disclaimer. | 9 // notice, this list of conditions and the following disclaimer. |
10 // * Redistributions in binary form must reproduce the above | 10 // * Redistributions in binary form must reproduce the above |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
165 } | 165 } |
166 | 166 |
167 if (m_domEnabled) { | 167 if (m_domEnabled) { |
168 V8Scope v8scope(DartDOMData::current()); | 168 V8Scope v8scope(DartDOMData::current()); |
169 Dart_Handle mainLibrary = topLevelLibrary(); | 169 Dart_Handle mainLibrary = topLevelLibrary(); |
170 | 170 |
171 // Trampoline to invoke main. | 171 // Trampoline to invoke main. |
172 // FIXME: Use the page library instead. To do this, we need to import ea
ch script tag's library into the page | 172 // FIXME: Use the page library instead. To do this, we need to import ea
ch script tag's library into the page |
173 // with a unique prefix to ensure a secondary script doesn't define a ma
in. | 173 // with a unique prefix to ensure a secondary script doesn't define a ma
in. |
174 String trampolineUrl = m_libraryUrl + "$trampoline"; | 174 String trampolineUrl = m_libraryUrl + "$trampoline"; |
175 Dart_Handle trampoline = Dart_LoadLibrary(DartUtilities::stringToDartStr
ing(trampolineUrl), Dart_NewStringFromCString("")); | 175 Dart_Handle trampoline = Dart_LoadLibrary(DartUtilities::stringToDartStr
ing(trampolineUrl), Dart_NewStringFromCString(""), 0, 0); |
176 Dart_LibraryImportLibrary(trampoline, mainLibrary, Dart_Null()); | 176 Dart_LibraryImportLibrary(trampoline, mainLibrary, Dart_Null()); |
177 | 177 |
178 Dart_Handle result = Dart_FinalizeLoading(false); | 178 Dart_Handle result = Dart_FinalizeLoading(false); |
179 if (Dart_IsError(result)) { | 179 if (Dart_IsError(result)) { |
180 DartUtilities::reportProblem(m_originDocument, result, m_libraryUrl)
; | 180 DartUtilities::reportProblem(m_originDocument, result, m_libraryUrl)
; |
181 } | 181 } |
182 | 182 |
183 // FIXME: Settle on proper behavior here. We have not determined exactly
when | 183 // FIXME: Settle on proper behavior here. We have not determined exactly
when |
184 // or how often we'll call the entry point. | 184 // or how often we'll call the entry point. |
185 Dart_Handle entryPoint = Dart_NewStringFromCString("main"); | 185 Dart_Handle entryPoint = Dart_NewStringFromCString("main"); |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
220 if (failedUrl.startsWith(String("dart:"))) { | 220 if (failedUrl.startsWith(String("dart:"))) { |
221 m_originDocument->logExceptionToConsole(String("The built-in library '")
+ failedUrl + String("' is not available on Dartium."), m_libraryUrl, -1, 0, nu
llptr); | 221 m_originDocument->logExceptionToConsole(String("The built-in library '")
+ failedUrl + String("' is not available on Dartium."), m_libraryUrl, -1, 0, nu
llptr); |
222 } else { | 222 } else { |
223 m_originDocument->logExceptionToConsole(String("Failed to load a file ")
+ failedUrl, m_libraryUrl, -1, 0, nullptr); | 223 m_originDocument->logExceptionToConsole(String("Failed to load a file ")
+ failedUrl, m_libraryUrl, -1, 0, nullptr); |
224 } | 224 } |
225 RELEASE_ASSERT(m_errorEventDispatcher); | 225 RELEASE_ASSERT(m_errorEventDispatcher); |
226 m_errorEventDispatcher->dispatchErrorEvent(); | 226 m_errorEventDispatcher->dispatchErrorEvent(); |
227 } | 227 } |
228 | 228 |
229 } | 229 } |
OLD | NEW |