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

Unified Diff: runtime/vm/dart_api_impl.cc

Issue 9422019: isolates refactor: this change introduces 'dart:isolate' as a library. This is a (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: '' Created 8 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/custom_isolate_test.cc ('k') | runtime/vm/dart_api_impl_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/dart_api_impl.cc
diff --git a/runtime/vm/dart_api_impl.cc b/runtime/vm/dart_api_impl.cc
index 8d48d15f04c0572a080f3a83ce534b65dc27eda1..9d252f51abc6e38dd2df608e322c9d2772419a34 100644
--- a/runtime/vm/dart_api_impl.cc
+++ b/runtime/vm/dart_api_impl.cc
@@ -759,14 +759,17 @@ DART_EXPORT bool Dart_CloseNativePort(Dart_Port native_port_id) {
DART_EXPORT Dart_Handle Dart_NewSendPort(Dart_Port port_id) {
Isolate* isolate = Isolate::Current();
DARTSCOPE(isolate);
- const String& class_name = String::Handle(String::NewSymbol("SendPortImpl"));
+ Library& isolate_lib = Library::Handle(Library::IsolateLibrary());
+ ASSERT(!isolate_lib.IsNull());
+ const String& class_name =
+ String::Handle(isolate_lib.PrivateName("_SendPortImpl"));
const String& function_name = String::Handle(String::NewSymbol("_create"));
const int kNumArguments = 1;
const Array& kNoArgumentNames = Array::Handle();
// TODO(turnidge): Consider adding a helper function to make
// function resolution by class name and function name more concise.
const Function& function = Function::Handle(
- Resolver::ResolveStatic(Library::Handle(Library::CoreLibrary()),
+ Resolver::ResolveStatic(isolate_lib,
class_name,
function_name,
kNumArguments,
@@ -783,14 +786,16 @@ DART_EXPORT Dart_Handle Dart_NewSendPort(Dart_Port port_id) {
DART_EXPORT Dart_Handle Dart_GetReceivePort(Dart_Port port_id) {
Isolate* isolate = Isolate::Current();
DARTSCOPE(isolate);
+ Library& isolate_lib = Library::Handle(Library::IsolateLibrary());
+ ASSERT(!isolate_lib.IsNull());
const String& class_name =
- String::Handle(String::NewSymbol("ReceivePortImpl"));
+ String::Handle(isolate_lib.PrivateName("_ReceivePortImpl"));
const String& function_name =
String::Handle(String::NewSymbol("_get_or_create"));
const int kNumArguments = 1;
const Array& kNoArgumentNames = Array::Handle();
const Function& function = Function::Handle(
- Resolver::ResolveStatic(Library::Handle(Library::CoreLibrary()),
+ Resolver::ResolveStatic(isolate_lib,
class_name,
function_name,
kNumArguments,
« no previous file with comments | « runtime/vm/custom_isolate_test.cc ('k') | runtime/vm/dart_api_impl_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698