| 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_UTILS_H_ | 5 #ifndef BIN_UTILS_H_ |
| 6 #define BIN_UTILS_H_ | 6 #define 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 class OSError { | 14 class OSError { |
| 15 public: | 15 public: |
| 16 enum SubSystem { | 16 enum SubSystem { |
| 17 kSystem, | 17 kSystem, |
| 18 kGetAddressInfo, | 18 kGetAddressInfo, |
| 19 kNSS, |
| 19 kUnknown = -1 | 20 kUnknown = -1 |
| 20 }; | 21 }; |
| 21 | 22 |
| 22 OSError(); | 23 OSError(); |
| 23 OSError(int code, const char* message, SubSystem sub_system) { | 24 OSError(int code, const char* message, SubSystem sub_system) { |
| 24 sub_system_ = sub_system; | 25 sub_system_ = sub_system; |
| 25 code_ = code; | 26 code_ = code; |
| 26 message_ = NULL; // SetMessage will free existing message. | 27 message_ = NULL; // SetMessage will free existing message. |
| 27 SetMessage(message); | 28 SetMessage(message); |
| 28 } | 29 } |
| (...skipping 17 matching lines...) Expand all Loading... |
| 46 } | 47 } |
| 47 | 48 |
| 48 SubSystem sub_system_; | 49 SubSystem sub_system_; |
| 49 int code_; | 50 int code_; |
| 50 char* message_; | 51 char* message_; |
| 51 | 52 |
| 52 DISALLOW_COPY_AND_ASSIGN(OSError); | 53 DISALLOW_COPY_AND_ASSIGN(OSError); |
| 53 }; | 54 }; |
| 54 | 55 |
| 55 #endif // BIN_UTILS_H_ | 56 #endif // BIN_UTILS_H_ |
| OLD | NEW |