Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
vmservice_impl.h
Go to the documentation of this file.
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
12namespace dart {
13namespace bin {
14
15class VmService {
16 public:
17#if defined(PRODUCT)
18 static bool Setup(const char* server_ip,
19 intptr_t server_port,
20 bool dev_mode_server,
21 bool auth_codes_disabled,
22 const char* write_service_info_filename,
23 bool trace_loading,
24 bool deterministic,
25 bool enable_service_port_fallback,
26 bool wait_for_dds_to_advertise_service,
27 bool serve_devtools,
28 bool serve_observatory,
29 bool print_dtd) {
30 return false;
31 }
32
33 static void SetNativeResolver() {}
34
35 // Error message if startup failed.
36 static const char* GetErrorMessage() {
37 return "VM Service not suppported in Product mode";
38 }
39
40 // HTTP Server's address.
41 static const char* GetServerAddress() { return nullptr; }
42
43 private:
44#else // defined(PRODUCT)
45 static bool Setup(const char* server_ip,
46 intptr_t server_port,
47 bool dev_mode_server,
48 bool auth_codes_disabled,
49 const char* write_service_info_filename,
50 bool trace_loading,
51 bool deterministic,
52 bool enable_service_port_fallback,
53 bool wait_for_dds_to_advertise_service,
54 bool serve_devtools,
55 bool serve_observatory,
56 bool print_dtd);
57
58 static void SetNativeResolver();
59
60 // Error message if startup failed.
61 static const char* GetErrorMessage();
62
63 // HTTP Server's address.
64 static const char* GetServerAddress() { return &server_uri_[0]; }
65
66 private:
67 static constexpr intptr_t kServerUriStringBufferSize = 1024;
69
70 static void SetServerAddress(const char* server_uri_);
71
72 static const char* error_msg_;
73 static char server_uri_[kServerUriStringBufferSize];
74#endif // defined(PRODUCT)
75 DISALLOW_ALLOCATION();
77};
78
79} // namespace bin
80} // namespace dart
81
82#endif // RUNTIME_BIN_VMSERVICE_IMPL_H_
static const char * GetErrorMessage()
static const char * GetServerAddress()
static void SetNativeResolver()
static bool Setup(const char *server_ip, intptr_t server_port, bool dev_mode_server, bool auth_codes_disabled, const char *write_service_info_filename, bool trace_loading, bool deterministic, bool enable_service_port_fallback, bool wait_for_dds_to_advertise_service, bool serve_devtools, bool serve_observatory, bool print_dtd)
friend void NotifyServerState(Dart_NativeArguments args)
struct _Dart_NativeArguments * Dart_NativeArguments
Definition dart_api.h:3010
G_BEGIN_DECLS G_MODULE_EXPORT FlValue * args
#define DISALLOW_IMPLICIT_CONSTRUCTORS(TypeName)
Definition globals.h:593