| 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 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 Dart_Handle DartApplicationLoader::libraryTagHandlerCallback(Dart_LibraryTag tag
, Dart_Handle library, Dart_Handle urlHandle) | 117 Dart_Handle DartApplicationLoader::libraryTagHandlerCallback(Dart_LibraryTag tag
, Dart_Handle library, Dart_Handle urlHandle) |
| 118 { | 118 { |
| 119 ASSERT(currentApplicationLoader()); | 119 ASSERT(currentApplicationLoader()); |
| 120 return currentApplicationLoader()->libraryTagHandler(tag, library, urlHandle
); | 120 return currentApplicationLoader()->libraryTagHandler(tag, library, urlHandle
); |
| 121 } | 121 } |
| 122 | 122 |
| 123 Dart_Handle DartApplicationLoader::libraryTagHandler(Dart_LibraryTag tag, Dart_H
andle library, Dart_Handle urlHandle) | 123 Dart_Handle DartApplicationLoader::libraryTagHandler(Dart_LibraryTag tag, Dart_H
andle library, Dart_Handle urlHandle) |
| 124 { | 124 { |
| 125 ASSERT(Dart_IsLibrary(library)); | 125 ASSERT(Dart_IsLibrary(library)); |
| 126 | 126 |
| 127 String url = DartUtilities::dartStringToString(urlHandle); | 127 String url = DartUtilities::toString(urlHandle); |
| 128 | 128 |
| 129 Dart_Handle libraryURLHandle = Dart_LibraryUrl(library); | 129 Dart_Handle libraryURLHandle = Dart_LibraryUrl(library); |
| 130 ASSERT(!Dart_IsError(libraryURLHandle)); | 130 ASSERT(!Dart_IsError(libraryURLHandle)); |
| 131 const String libraryURL = DartUtilities::dartStringToString(libraryURLHandle
); | 131 const String libraryURL = DartUtilities::toString(libraryURLHandle); |
| 132 | 132 |
| 133 if (tag == kCanonicalizeUrl) { | 133 if (tag == kCanonicalizeUrl) { |
| 134 if (url.startsWith("package:") && !url.startsWith("package://")) { | 134 if (url.startsWith("package:") && !url.startsWith("package://")) { |
| 135 // FIXME: Print warning on package:// URL. Package is | 135 // FIXME: Print warning on package:// URL. Package is |
| 136 // a Dart convention, not a real URI scheme. | 136 // a Dart convention, not a real URI scheme. |
| 137 url = packageUrl(this, url); | 137 url = packageUrl(this, url); |
| 138 } | 138 } |
| 139 const KURL canonical = KURL(KURL(KURL(), libraryURL), url); | 139 const KURL canonical = KURL(KURL(KURL(), libraryURL), url); |
| 140 return DartUtilities::stringToDartString(canonical.string()); | 140 return DartUtilities::stringToDartString(canonical.string()); |
| 141 } | 141 } |
| (...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 399 ASSERT(!isLoadingMainIsolate()); | 399 ASSERT(!isLoadingMainIsolate()); |
| 400 | 400 |
| 401 // FIXME: propagate flags as well. | 401 // FIXME: propagate flags as well. |
| 402 | 402 |
| 403 ASSERT(m_sources.contains(m_libraryUrl)); | 403 ASSERT(m_sources.contains(m_libraryUrl)); |
| 404 ASSERT(m_applicationLoaded); | 404 ASSERT(m_applicationLoaded); |
| 405 loadMainScript(m_libraryUrl, m_sources.get(m_libraryUrl)); | 405 loadMainScript(m_libraryUrl, m_sources.get(m_libraryUrl)); |
| 406 } | 406 } |
| 407 | 407 |
| 408 } | 408 } |
| OLD | NEW |