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

Unified Diff: runtime/bin/native_service.cc

Issue 24395013: Merge services into a shared IOService in dart:io, and use a native port. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Finish off native_service Created 7 years, 3 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/native_service.h ('k') | runtime/bin/secure_socket.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/native_service.cc
diff --git a/runtime/bin/native_service.cc b/runtime/bin/native_service.cc
deleted file mode 100644
index 37506aa0948d5e676fdd305d635d9444f84dec78..0000000000000000000000000000000000000000
--- a/runtime/bin/native_service.cc
+++ /dev/null
@@ -1,46 +0,0 @@
-// Copyright (c) 2013, 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 "bin/native_service.h"
-
-#include "platform/globals.h"
-#include "bin/thread.h"
-
-
-namespace dart {
-namespace bin {
-
-NativeService::NativeService(const char* name,
- Dart_NativeMessageHandler handler,
- int number_of_ports)
- : name_(name),
- handler_(handler),
- service_ports_size_(number_of_ports),
- service_ports_index_(0) {
- service_ports_ = new Dart_Port[service_ports_size_];
- for (int i = 0; i < service_ports_size_; i++) {
- service_ports_[i] = ILLEGAL_PORT;
- }
-}
-
-
-NativeService::~NativeService() {
- delete[] service_ports_;
-}
-
-
-Dart_Port NativeService::GetServicePort() {
- MutexLocker lock(&mutex_);
- Dart_Port result = service_ports_[service_ports_index_];
- if (result == ILLEGAL_PORT) {
- result = Dart_NewNativePort(name_, handler_, true);
- ASSERT(result != ILLEGAL_PORT);
- service_ports_[service_ports_index_] = result;
- }
- service_ports_index_ = (service_ports_index_ + 1) % service_ports_size_;
- return result;
-}
-
-} // namespace bin
-} // namespace dart
« no previous file with comments | « runtime/bin/native_service.h ('k') | runtime/bin/secure_socket.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698