| OLD | NEW |
| 1 // Copyright (c) 2015, the Dartino project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, the Dartino project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE.md file. | 3 // BSD-style license that can be found in the LICENSE.md file. |
| 4 | 4 |
| 5 #ifndef SRC_VM_SERVICE_API_IMPL_H_ | 5 #ifndef SRC_VM_SERVICE_API_IMPL_H_ |
| 6 #define SRC_VM_SERVICE_API_IMPL_H_ | 6 #define SRC_VM_SERVICE_API_IMPL_H_ |
| 7 | 7 |
| 8 #include "include/service_api.h" | 8 #include "include/service_api.h" |
| 9 | 9 |
| 10 namespace fletch { | 10 namespace dartino { |
| 11 | 11 |
| 12 class Monitor; | 12 class Monitor; |
| 13 class Port; | 13 class Port; |
| 14 struct ServiceRequest; | 14 struct ServiceRequest; |
| 15 | 15 |
| 16 // TODO(ager): Instead of making this accessible, we should | 16 // TODO(ager): Instead of making this accessible, we should |
| 17 // probably post a callback into dart? Fix the service param; | 17 // probably post a callback into dart? Fix the service param; |
| 18 // for now it is a pointer to a pointer so we can post something | 18 // for now it is a pointer to a pointer so we can post something |
| 19 // into dart that dart can free. | 19 // into dart that dart can free. |
| 20 FLETCH_EXPORT | 20 DARTINO_EXPORT |
| 21 void PostResultToService(char* buffer); | 21 void PostResultToService(char* buffer); |
| 22 | 22 |
| 23 class Service { | 23 class Service { |
| 24 public: | 24 public: |
| 25 // The name is assumed to be allocated with malloc and the | 25 // The name is assumed to be allocated with malloc and the |
| 26 // service takes ownership of the name and deallocates it | 26 // service takes ownership of the name and deallocates it |
| 27 // with free on service destruction. | 27 // with free on service destruction. |
| 28 Service(char* name, Port* port); | 28 Service(char* name, Port* port); |
| 29 ~Service(); | 29 ~Service(); |
| 30 | 30 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 43 void NotifyResult(ServiceRequest* request); | 43 void NotifyResult(ServiceRequest* request); |
| 44 void WaitForResult(ServiceRequest* request); | 44 void WaitForResult(ServiceRequest* request); |
| 45 | 45 |
| 46 Monitor* const result_monitor_; | 46 Monitor* const result_monitor_; |
| 47 | 47 |
| 48 char* const name_; | 48 char* const name_; |
| 49 Port* const port_; | 49 Port* const port_; |
| 50 Service* next_; | 50 Service* next_; |
| 51 }; | 51 }; |
| 52 | 52 |
| 53 } // namespace fletch | 53 } // namespace dartino |
| 54 | 54 |
| 55 #endif // SRC_VM_SERVICE_API_IMPL_H_ | 55 #endif // SRC_VM_SERVICE_API_IMPL_H_ |
| OLD | NEW |