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

Unified Diff: runtime/vm/object.h

Issue 243973002: - Add a minimal implementation of Capability. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 8 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/message_handler_test.cc ('k') | runtime/vm/object.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/object.h
===================================================================
--- runtime/vm/object.h (revision 35287)
+++ runtime/vm/object.h (working copy)
@@ -6469,6 +6469,55 @@
};
+class Capability : public Instance {
+ public:
+ uint64_t Id() const { return raw_ptr()->id_; }
+
+ static intptr_t InstanceSize() {
+ return RoundedAllocationSize(sizeof(RawCapability));
+ }
+ static RawCapability* New(uint64_t id, Heap::Space space = Heap::kNew);
+
+ private:
+ FINAL_HEAP_OBJECT_IMPLEMENTATION(Capability, Instance);
+ friend class Class;
+};
+
+
+class ReceivePort : public Instance {
+ public:
+ RawSendPort* send_port() const { return raw_ptr()->send_port_; }
+ Dart_Port Id() const { return send_port()->ptr()->id_; }
+
+ RawInstance* handler() const { return raw_ptr()->handler_; }
+ void set_handler(const Instance& value) const;
+
+ static intptr_t InstanceSize() {
+ return RoundedAllocationSize(sizeof(RawReceivePort));
+ }
+ static RawReceivePort* New(Dart_Port id, Heap::Space space = Heap::kNew);
+
+ private:
+ FINAL_HEAP_OBJECT_IMPLEMENTATION(ReceivePort, Instance);
+ friend class Class;
+};
+
+
+class SendPort : public Instance {
+ public:
+ Dart_Port Id() const { return raw_ptr()->id_; }
+
+ static intptr_t InstanceSize() {
+ return RoundedAllocationSize(sizeof(RawSendPort));
+ }
+ static RawSendPort* New(Dart_Port id, Heap::Space space = Heap::kNew);
+
+ private:
+ FINAL_HEAP_OBJECT_IMPLEMENTATION(SendPort, Instance);
+ friend class Class;
+};
+
+
// Internal stacktrace object used in exceptions for printing stack traces.
class Stacktrace : public Instance {
public:
« no previous file with comments | « runtime/vm/message_handler_test.cc ('k') | runtime/vm/object.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698