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

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
Index: runtime/vm/object.h
===================================================================
--- runtime/vm/object.h (revision 35191)
+++ runtime/vm/object.h (working copy)
@@ -6469,6 +6469,56 @@
};
+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 {
Cutch 2014/04/22 20:15:22 missing space before :
Ivan Posva 2014/04/22 21:28:30 Done.
+ public:
+ Dart_Port Id() const { return raw_ptr()->send_port_->ptr()->id_; }
siva 2014/04/23 00:20:31 maybe send_port()->ptr()->id_;
+
+ RawSendPort* send_port() const { return raw_ptr()->send_port_; }
+
+ RawInstance* handler() const { return raw_ptr()->handler_; }
+ void set_handler(const Instance& value);
siva 2014/04/23 00:20:31 where is set_handler implemented ? maybe it should
+
+ 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:

Powered by Google App Engine
This is Rietveld 408576698