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

Unified Diff: runtime/bin/builtin_common.cc

Issue 889443002: Service isolate rework take 2 (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/bin/builtin.dart ('k') | runtime/bin/builtin_impl_sources.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/builtin_common.cc
diff --git a/runtime/bin/builtin_common.cc b/runtime/bin/builtin_common.cc
new file mode 100644
index 0000000000000000000000000000000000000000..da754a5222d0d4842e7764b36fc5848f0c3be614
--- /dev/null
+++ b/runtime/bin/builtin_common.cc
@@ -0,0 +1,37 @@
+// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+#include <stdio.h>
+
+#include "include/dart_api.h"
+
+#include "bin/builtin.h"
+#include "bin/dartutils.h"
+#include "bin/platform.h"
+
+namespace dart {
+namespace bin {
+
+void Builtin::SetLoadPort(Dart_Port port) {
+ load_port_ = port;
+ ASSERT(load_port_ != ILLEGAL_PORT);
+ Dart_Handle field_name = DartUtils::NewString("_loadPort");
+ ASSERT(!Dart_IsError(field_name));
+ Dart_Handle builtin_lib =
+ Builtin::LoadAndCheckLibrary(Builtin::kBuiltinLibrary);
+ ASSERT(!Dart_IsError(builtin_lib));
+ Dart_Handle send_port = Dart_GetField(builtin_lib, field_name);
+ ASSERT(!Dart_IsError(send_port));
+ if (!Dart_IsNull(send_port)) {
+ // Already created and set.
+ return;
+ }
+ send_port = Dart_NewSendPort(load_port_);
+ ASSERT(!Dart_IsError(send_port));
+ Dart_Handle result = Dart_SetField(builtin_lib, field_name, send_port);
+ ASSERT(!Dart_IsError(result));
+}
+
+} // namespace bin
+} // namespace dart
« no previous file with comments | « runtime/bin/builtin.dart ('k') | runtime/bin/builtin_impl_sources.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698