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

Side by Side Diff: Source/bindings/core/dart/DartController.cpp

Issue 2543703003: Added setting up VMLibraryHooks for Dartium to support resolvePageUri (Closed)
Patch Set: Added setting up VMLibraryHooks for Dartium to support resolvePageUri 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 unified diff | Download patch
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 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 // FIXME: this should be blinkSnapshotResolver 163 // FIXME: this should be blinkSnapshotResolver
164 Dart_SetNativeResolver(blink, isDOMEnabled ? domIsolateHtmlResolver : pureIs olateResolver, isDOMEnabled ? domIsolateHtmlSymbolizer : pureIsolateSymbolizer); 164 Dart_SetNativeResolver(blink, isDOMEnabled ? domIsolateHtmlResolver : pureIs olateResolver, isDOMEnabled ? domIsolateHtmlSymbolizer : pureIsolateSymbolizer);
165 domData->setBlinkLibrary(Dart_NewPersistentHandle(blink)); 165 domData->setBlinkLibrary(Dart_NewPersistentHandle(blink));
166 166
167 // Fix the html library. 167 // Fix the html library.
168 Dart_Handle html = Dart_LookupLibrary(Dart_NewStringFromCString("dart:html") ); 168 Dart_Handle html = Dart_LookupLibrary(Dart_NewStringFromCString("dart:html") );
169 ASSERT(!Dart_IsError(html)); 169 ASSERT(!Dart_IsError(html));
170 Dart_SetNativeResolver(html, isDOMEnabled ? domIsolateHtmlResolver : pureIso lateResolver, isDOMEnabled ? domIsolateHtmlSymbolizer : pureIsolateSymbolizer); 170 Dart_SetNativeResolver(html, isDOMEnabled ? domIsolateHtmlResolver : pureIso lateResolver, isDOMEnabled ? domIsolateHtmlSymbolizer : pureIsolateSymbolizer);
171 domData->setHtmlLibrary(Dart_NewPersistentHandle(html)); 171 domData->setHtmlLibrary(Dart_NewPersistentHandle(html));
172 172
173 // Lookup native calls referenced in dart:_builtin for _setupHooks() to setu p VMLibraryHooks.
174 Dart_Handle builtin = Dart_LookupLibrary(Dart_NewStringFromCString("dart:_bu iltin"));
175 ASSERT(!Dart_IsError(builtin));
176 Dart_SetNativeResolver(builtin, isDOMEnabled ? domIsolateHtmlResolver : pure IsolateResolver, isDOMEnabled ? domIsolateHtmlSymbolizer : pureIsolateSymbolizer );
177 domData->setBuiltinLibrary(Dart_NewPersistentHandle(builtin));
siva 2017/01/06 21:39:33 Ditto comment about not needing this if the setup
terry 2017/01/09 21:06:02 Right native resolver is removed (code exist in da
178
173 Dart_Handle js = Dart_LookupLibrary(Dart_NewStringFromCString("dart:js")); 179 Dart_Handle js = Dart_LookupLibrary(Dart_NewStringFromCString("dart:js"));
174 ASSERT(!Dart_IsError(js)); 180 ASSERT(!Dart_IsError(js));
175 Dart_SetNativeResolver(js, isDOMEnabled ? JsInterop::resolver : pureIsolateR esolver, 0); 181 Dart_SetNativeResolver(js, isDOMEnabled ? JsInterop::resolver : pureIsolateR esolver, 0);
176 domData->setJsLibrary(Dart_NewPersistentHandle(js)); 182 domData->setJsLibrary(Dart_NewPersistentHandle(js));
177 183
178 Dart_Handle core = Dart_LookupLibrary(Dart_NewStringFromCString("dart:core") ); 184 Dart_Handle core = Dart_LookupLibrary(Dart_NewStringFromCString("dart:core") );
179 ASSERT(!Dart_IsError(core)); 185 ASSERT(!Dart_IsError(core));
180 186
181 domData->setSvgLibrary(0); 187 domData->setSvgLibrary(0);
182 188
(...skipping 554 matching lines...) Expand 10 before | Expand all | Expand 10 after
737 init_params.version = DART_INITIALIZE_PARAMS_CURRENT_VERSION; 743 init_params.version = DART_INITIALIZE_PARAMS_CURRENT_VERSION;
738 init_params.vm_isolate_snapshot = DartUtilities::vmIsolateSnapshot(); 744 init_params.vm_isolate_snapshot = DartUtilities::vmIsolateSnapshot();
739 init_params.create = &createPureIsolateCallback; 745 init_params.create = &createPureIsolateCallback;
740 init_params.file_open = openFileCallback; 746 init_params.file_open = openFileCallback;
741 init_params.file_read = readFileCallback; 747 init_params.file_read = readFileCallback;
742 init_params.file_write = writeFileCallback; 748 init_params.file_write = writeFileCallback;
743 init_params.file_close = closeFileCallback; 749 init_params.file_close = closeFileCallback;
744 init_params.entropy_source = generateEntropy; 750 init_params.entropy_source = generateEntropy;
745 init_params.get_service_assets = GetVMServiceAssetsArchiveCallback; 751 init_params.get_service_assets = GetVMServiceAssetsArchiveCallback;
746 char* error = Dart_Initialize(&init_params); 752 char* error = Dart_Initialize(&init_params);
747 RELEASE_ASSERT_WITH_MESSAGE(!error, error); 753 RELEASE_ASSERT_WITH_MESSAGE(!error, "Dart_Initialize failed");
748 } 754 }
749 755
750 static bool checkForExpiration() 756 static bool checkForExpiration()
751 { 757 {
752 const time_t ExpirationTimeSecsSinceEpoch = 758 const time_t ExpirationTimeSecsSinceEpoch =
753 #include "bindings/dart/ExpirationTimeSecsSinceEpoch.time_t" 759 #include "bindings/dart/ExpirationTimeSecsSinceEpoch.time_t"
754 ; 760 ;
755 const char* override = getenv("DARTIUM_EXPIRATION_TIME"); 761 const char* override = getenv("DARTIUM_EXPIRATION_TIME");
756 time_t expiration; 762 time_t expiration;
757 if (override) { 763 if (override) {
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after
1010 Dart_ExitIsolate(); 1016 Dart_ExitIsolate();
1011 loader->processSingleRequest(isolate, url, callback); 1017 loader->processSingleRequest(isolate, url, callback);
1012 1018
1013 // Restore caller isolate. 1019 // Restore caller isolate.
1014 Dart_EnterIsolate(caller); 1020 Dart_EnterIsolate(caller);
1015 1021
1016 // FIXME: We need some way to return a Dart_Handle to the isolate we just cr eated. 1022 // FIXME: We need some way to return a Dart_Handle to the isolate we just cr eated.
1017 } 1023 }
1018 1024
1019 } 1025 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698