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

Side by Side Diff: Source/bindings/dart/DartApplicationLoader.cpp

Issue 428783004: Pass line offsets to Dart_LoadLibrary and Dart_LoadSource. (Closed) Base URL: svn://svn.chromium.org/blink/branches/dart/dartium
Patch Set: Created 6 years, 4 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | Source/bindings/dart/DartAsyncLoader.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « no previous file | Source/bindings/dart/DartAsyncLoader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698