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

Unified Diff: runtime/vm/dart_api_impl.cc

Issue 9325022: Decode the Dart message into a Dart_CMessage structure before calling the native port callback (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Addressed review comments from asiva@ 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/dart_api_impl.h ('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 b282bf2fd913c338eba9f83747b290160c139391..e7d538c024a0844926a9752fe806ac8b2068451d 100644
--- a/runtime/vm/dart_api_impl.cc
+++ b/runtime/vm/dart_api_impl.cc
@@ -28,6 +28,8 @@
namespace dart {
+ThreadLocalKey Api::api_native_key_ = Thread::kUnsetThreadLocalKey;
+
const char* CanonicalFunction(const char* func) {
if (strncmp(func, "dart::", 6) == 0) {
return func + 6;
@@ -237,6 +239,13 @@ uword Api::Reallocate(uword ptr, intptr_t old_size, intptr_t new_size) {
}
+void Api::InitOnce() {
+ ASSERT(api_native_key_ == Thread::kUnsetThreadLocalKey);
+ api_native_key_ = Thread::CreateThreadLocal();
+ ASSERT(api_native_key_ != Thread::kUnsetThreadLocalKey);
+}
+
+
// --- Handles ---
@@ -2437,5 +2446,4 @@ DART_EXPORT void Dart_GetPprofSymbolInfo(void** buffer, int* buffer_size) {
}
}
-
} // namespace dart
« no previous file with comments | « runtime/vm/dart_api_impl.h ('k') | runtime/vm/dart_api_impl_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698