OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart 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 file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 #ifndef BIN_ISOLATE_DATA_H_ | 5 #ifndef BIN_ISOLATE_DATA_H_ |
6 #define BIN_ISOLATE_DATA_H_ | 6 #define BIN_ISOLATE_DATA_H_ |
7 | 7 |
8 #include "include/dart_api.h" | 8 #include "include/dart_api.h" |
9 #include "platform/globals.h" | 9 #include "platform/globals.h" |
10 | 10 |
11 | 11 |
12 namespace dart { | 12 namespace dart { |
13 namespace bin { | 13 namespace bin { |
14 | 14 |
15 // Forward declaration. | 15 // Forward declaration. |
16 class EventHandler; | 16 class EventHandler; |
17 | 17 |
18 // Data associated with every isolate in the standalone VM | 18 // Data associated with every isolate in the standalone VM |
19 // embedding. This is used to free external resources for each isolate | 19 // embedding. This is used to free external resources for each isolate |
20 // when the isolate shuts down. | 20 // when the isolate shuts down. |
21 class IsolateData { | 21 class IsolateData { |
22 public: | 22 public: |
23 explicit IsolateData(const char* url, const char* package_root) | 23 explicit IsolateData(const char* url, const char* package_root) |
24 : script_url(strdup(url)), | 24 : script_url(strdup(url)), |
25 package_root(NULL), | 25 package_root(NULL), |
26 udp_receive_buffer(NULL) { | 26 udp_receive_buffer(NULL), |
| 27 load_async_id(-1) { |
27 if (package_root != NULL) { | 28 if (package_root != NULL) { |
28 this->package_root = strdup(package_root); | 29 this->package_root = strdup(package_root); |
29 } | 30 } |
30 } | 31 } |
31 ~IsolateData() { | 32 ~IsolateData() { |
32 free(script_url); | 33 free(script_url); |
33 free(package_root); | 34 free(package_root); |
34 free(udp_receive_buffer); | 35 free(udp_receive_buffer); |
35 } | 36 } |
36 | 37 |
37 char* script_url; | 38 char* script_url; |
38 char* package_root; | 39 char* package_root; |
39 uint8_t* udp_receive_buffer; | 40 uint8_t* udp_receive_buffer; |
| 41 int64_t load_async_id; |
40 | 42 |
41 private: | 43 private: |
42 DISALLOW_COPY_AND_ASSIGN(IsolateData); | 44 DISALLOW_COPY_AND_ASSIGN(IsolateData); |
43 }; | 45 }; |
44 | 46 |
45 } // namespace bin | 47 } // namespace bin |
46 } // namespace dart | 48 } // namespace dart |
47 | 49 |
48 #endif // BIN_ISOLATE_DATA_H_ | 50 #endif // BIN_ISOLATE_DATA_H_ |
OLD | NEW |