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 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 | 128 |
129 Dart_Handle web_sql = Dart_LookupLibrary(Dart_NewStringFromCString("dart:web
_sql")); | 129 Dart_Handle web_sql = Dart_LookupLibrary(Dart_NewStringFromCString("dart:web
_sql")); |
130 ASSERT(!Dart_IsError(web_sql)); | 130 ASSERT(!Dart_IsError(web_sql)); |
131 Dart_SetNativeResolver(web_sql, web_sqlSnapshotResolver); | 131 Dart_SetNativeResolver(web_sql, web_sqlSnapshotResolver); |
132 | 132 |
133 // Import html library into core to make it all available to the user direct
ly. | 133 // Import html library into core to make it all available to the user direct
ly. |
134 Dart_Handle core = Dart_LookupLibrary(Dart_NewStringFromCString("dart:core")
); | 134 Dart_Handle core = Dart_LookupLibrary(Dart_NewStringFromCString("dart:core")
); |
135 Dart_LibraryImportLibrary(core, html, Dart_Null()); | 135 Dart_LibraryImportLibrary(core, html, Dart_Null()); |
136 | 136 |
137 // Setup configuration closures | 137 // Setup configuration closures |
138 copyValue(html, "_printClosure", "dart:core", 0, "_printClosure"); | 138 copyValue(html, getenv("DART_FORWARDING_PRINT") ? "_forwardingPrintClosure"
: "_printClosure", "dart:core", 0, "_printClosure"); |
139 copyValue(html, "_timerFactoryClosure", "dart:async", "_TimerFactory", "_fac
tory"); | 139 copyValue(html, "_timerFactoryClosure", "dart:async", "_TimerFactory", "_fac
tory"); |
140 | 140 |
141 if (isDOMEnabled) { | 141 if (isDOMEnabled) { |
142 // Create strongly reachable document wrapper. Document wrapper acts as
a | 142 // Create strongly reachable document wrapper. Document wrapper acts as
a |
143 // retainer for in-document node wrappers group. There is no need to des
troy | 143 // retainer for in-document node wrappers group. There is no need to des
troy |
144 // this persistent handle explicitly because we will shutdown the isolat
e on | 144 // this persistent handle explicitly because we will shutdown the isolat
e on |
145 // navigation. | 145 // navigation. |
146 domData->setDocumentWrapper(Dart_NewPersistentHandle(DartDocument::toDar
t(document))); | 146 domData->setDocumentWrapper(Dart_NewPersistentHandle(DartDocument::toDar
t(document))); |
147 | 147 |
148 DartDebugServer::shared().registerIsolate(isolate); | 148 DartDebugServer::shared().registerIsolate(isolate); |
(...skipping 553 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
702 } | 702 } |
703 | 703 |
704 DartController* DartController::retrieve(ScriptExecutionContext* context) | 704 DartController* DartController::retrieve(ScriptExecutionContext* context) |
705 { | 705 { |
706 if (!context || !context->isDocument()) | 706 if (!context || !context->isDocument()) |
707 return 0; | 707 return 0; |
708 return retrieve(static_cast<Document*>(context)->frame()); | 708 return retrieve(static_cast<Document*>(context)->frame()); |
709 } | 709 } |
710 | 710 |
711 } | 711 } |
OLD | NEW |