| 1 | // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| 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. |
| 4 | |
| 5 | #ifndef RUNTIME_BIN_VMSERVICE_IMPL_H_ |
| 6 | #define RUNTIME_BIN_VMSERVICE_IMPL_H_ |
| 7 | |
| 8 | #include "include/dart_api.h" |
| 9 | |
| 10 | #include "platform/globals.h" |
| 11 | |
| 12 | namespace dart { |
| 13 | namespace bin { |
| 14 | |
| 15 | class VmService { |
| 16 | public: |
| 17 | static bool Setup(const char* server_ip, |
| 18 | intptr_t server_port, |
| 19 | bool dev_mode_server, |
| 20 | bool auth_codes_disabled, |
| 21 | const char* write_service_info_filename, |
| 22 | bool trace_loading, |
| 23 | bool deterministic, |
| 24 | bool enable_service_port_fallback); |
| 25 | |
| 26 | static void SetNativeResolver(); |
| 27 | |
| 28 | // Error message if startup failed. |
| 29 | static const char* GetErrorMessage(); |
| 30 | |
| 31 | // HTTP Server's address. |
| 32 | static const char* GetServerAddress() { return &server_uri_[0]; } |
| 33 | |
| 34 | private: |
| 35 | static const intptr_t kServerUriStringBufferSize = 1024; |
| 36 | friend void NotifyServerState(Dart_NativeArguments args); |
| 37 | |
| 38 | static void SetServerAddress(const char* server_uri_); |
| 39 | |
| 40 | static const char* error_msg_; |
| 41 | static char server_uri_[kServerUriStringBufferSize]; |
| 42 | |
| 43 | DISALLOW_ALLOCATION(); |
| 44 | DISALLOW_IMPLICIT_CONSTRUCTORS(VmService); |
| 45 | }; |
| 46 | |
| 47 | } // namespace bin |
| 48 | } // namespace dart |
| 49 | |
| 50 | #endif // RUNTIME_BIN_VMSERVICE_IMPL_H_ |
| 51 | |