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

Unified Diff: runtime/bin/loader.cc

Issue 2666063002: VM: [Kernel] Revert changes to the native ports that introduced peers. (Closed)
Patch Set: 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/bin/loader.h ('k') | runtime/include/dart_native_api.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/loader.cc
diff --git a/runtime/bin/loader.cc b/runtime/bin/loader.cc
index f92d13dfd88f519de169407c44f13157403dbd87..70ee44471d6628f2a7a1892515fe274d6a771c2b 100644
--- a/runtime/bin/loader.cc
+++ b/runtime/bin/loader.cc
@@ -34,8 +34,7 @@ Loader::Loader(IsolateData* isolate_data)
payload_length_(0) {
monitor_ = new Monitor();
ASSERT(isolate_data_ != NULL);
- port_ =
- Dart_NewNativePort("Loader", Loader::NativeMessageHandler, false, this);
+ port_ = Dart_NewNativePort("Loader", Loader::NativeMessageHandler, false);
isolate_data_->set_loader(this);
AddLoader(port_, isolate_data_);
}
@@ -818,10 +817,13 @@ Loader* Loader::LoaderFor(Dart_Port port) {
void Loader::NativeMessageHandler(Dart_Port dest_port_id,
- Dart_CObject* message,
- void* peer) {
+ Dart_CObject* message) {
MutexLocker ml(loader_infos_lock_);
- static_cast<Loader*>(peer)->QueueMessage(message);
+ Loader* loader = LoaderForLocked(dest_port_id);
+ if (loader == NULL) {
+ return;
+ }
+ loader->QueueMessage(message);
}
} // namespace bin
« no previous file with comments | « runtime/bin/loader.h ('k') | runtime/include/dart_native_api.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698