| 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 RUNTIME_BIN_UTILS_H_ | 5 #ifndef RUNTIME_BIN_UTILS_H_ |
| 6 #define RUNTIME_BIN_UTILS_H_ | 6 #define RUNTIME_BIN_UTILS_H_ |
| 7 | 7 |
| 8 #include <stdlib.h> | 8 #include <stdlib.h> |
| 9 #include <string.h> | 9 #include <string.h> |
| 10 | 10 |
| 11 #include "include/dart_api.h" | 11 #include "include/dart_api.h" |
| 12 #include "platform/globals.h" | 12 #include "platform/globals.h" |
| 13 | 13 |
| 14 namespace dart { | 14 namespace dart { |
| 15 namespace bin { | 15 namespace bin { |
| 16 | 16 |
| 17 class OSError { | 17 class OSError { |
| 18 public: | 18 public: |
| 19 enum SubSystem { | 19 enum SubSystem { kSystem, kGetAddressInfo, kBoringSSL, kUnknown = -1 }; |
| 20 kSystem, | |
| 21 kGetAddressInfo, | |
| 22 kBoringSSL, | |
| 23 kUnknown = -1 | |
| 24 }; | |
| 25 | 20 |
| 26 OSError(); | 21 OSError(); |
| 27 OSError(int code, const char* message, SubSystem sub_system) { | 22 OSError(int code, const char* message, SubSystem sub_system) { |
| 28 sub_system_ = sub_system; | 23 sub_system_ = sub_system; |
| 29 code_ = code; | 24 code_ = code; |
| 30 message_ = NULL; // SetMessage will free existing message. | 25 message_ = NULL; // SetMessage will free existing message. |
| 31 SetMessage(message); | 26 SetMessage(message); |
| 32 } | 27 } |
| 33 virtual ~OSError() { free(message_); } | 28 virtual ~OSError() { free(message_); } |
| 34 | 29 |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 | 112 |
| 118 private: | 113 private: |
| 119 DISALLOW_ALLOCATION(); | 114 DISALLOW_ALLOCATION(); |
| 120 DISALLOW_IMPLICIT_CONSTRUCTORS(TimerUtils); | 115 DISALLOW_IMPLICIT_CONSTRUCTORS(TimerUtils); |
| 121 }; | 116 }; |
| 122 | 117 |
| 123 } // namespace bin | 118 } // namespace bin |
| 124 } // namespace dart | 119 } // namespace dart |
| 125 | 120 |
| 126 #endif // RUNTIME_BIN_UTILS_H_ | 121 #endif // RUNTIME_BIN_UTILS_H_ |
| OLD | NEW |