mirror of
https://github.com/dart-lang/sdk
synced 2024-09-05 16:41:07 +00:00
[VM/Service] Define vmservice entry points only under non product mode
TEST=ci Change-Id: I2d72d4c786e3725434c552a317da6b50a08646c5 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/353228 Commit-Queue: Siva Annamalai <asiva@google.com> Reviewed-by: Ben Konyi <bkonyi@google.com>
This commit is contained in:
parent
0d9d7f4e75
commit
ac39be3eed
|
@ -18,6 +18,8 @@
|
|||
namespace dart {
|
||||
namespace bin {
|
||||
|
||||
#if !defined(PRODUCT)
|
||||
|
||||
#define RETURN_ERROR_HANDLE(handle) \
|
||||
if (Dart_IsError(handle)) { \
|
||||
return handle; \
|
||||
|
@ -254,5 +256,7 @@ void VmService::SetServerAddress(const char* server_uri) {
|
|||
server_uri_[kServerUriStringBufferSize - 1] = '\0';
|
||||
}
|
||||
|
||||
#endif // !defined(PRODUCT)
|
||||
|
||||
} // namespace bin
|
||||
} // namespace dart
|
||||
|
|
|
@ -14,6 +14,32 @@ namespace bin {
|
|||
|
||||
class VmService {
|
||||
public:
|
||||
#if defined(PRODUCT)
|
||||
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_observatory) {
|
||||
return false;
|
||||
}
|
||||
|
||||
static void SetNativeResolver() {}
|
||||
|
||||
// Error message if startup failed.
|
||||
static const char* GetErrorMessage() {
|
||||
return "VM Service not suppported in Product mode";
|
||||
}
|
||||
|
||||
// HTTP Server's address.
|
||||
static const char* GetServerAddress() { return nullptr; }
|
||||
|
||||
private:
|
||||
#else // defined(PRODUCT)
|
||||
static bool Setup(const char* server_ip,
|
||||
intptr_t server_port,
|
||||
bool dev_mode_server,
|
||||
|
@ -41,7 +67,7 @@ class VmService {
|
|||
|
||||
static const char* error_msg_;
|
||||
static char server_uri_[kServerUriStringBufferSize];
|
||||
|
||||
#endif // defined(PRODUCT)
|
||||
DISALLOW_ALLOCATION();
|
||||
DISALLOW_IMPLICIT_CONSTRUCTORS(VmService);
|
||||
};
|
||||
|
|
|
@ -12,34 +12,47 @@ import 'dart:_vmservice';
|
|||
part 'vmservice_server.dart';
|
||||
|
||||
// The TCP ip/port that the HTTP server listens on.
|
||||
@pragma('vm:entry-point')
|
||||
@pragma('vm:entry-point', !const bool.fromEnvironment('dart.vm.product'))
|
||||
int _port = 0;
|
||||
@pragma('vm:entry-point')
|
||||
|
||||
@pragma('vm:entry-point', !const bool.fromEnvironment('dart.vm.product'))
|
||||
String _ip = '';
|
||||
|
||||
// Should the HTTP server auto start?
|
||||
@pragma('vm:entry-point')
|
||||
@pragma('vm:entry-point', !const bool.fromEnvironment('dart.vm.product'))
|
||||
bool _autoStart = false;
|
||||
|
||||
// Should the HTTP server require an auth code?
|
||||
@pragma('vm:entry-point')
|
||||
@pragma('vm:entry-point', !const bool.fromEnvironment('dart.vm.product'))
|
||||
bool _authCodesDisabled = false;
|
||||
|
||||
// Should the HTTP server run in devmode?
|
||||
@pragma('vm:entry-point')
|
||||
@pragma('vm:entry-point', !const bool.fromEnvironment('dart.vm.product'))
|
||||
bool _originCheckDisabled = false;
|
||||
|
||||
// Location of file to output VM service connection info.
|
||||
@pragma('vm:entry-point')
|
||||
@pragma('vm:entry-point', !const bool.fromEnvironment('dart.vm.product'))
|
||||
String? _serviceInfoFilename;
|
||||
@pragma('vm:entry-point')
|
||||
|
||||
@pragma('vm:entry-point', !const bool.fromEnvironment('dart.vm.product'))
|
||||
bool _isWindows = false;
|
||||
@pragma('vm:entry-point')
|
||||
|
||||
@pragma('vm:entry-point', !const bool.fromEnvironment('dart.vm.product'))
|
||||
bool _isFuchsia = false;
|
||||
@pragma('vm:entry-point')
|
||||
|
||||
@pragma('vm:entry-point', !const bool.fromEnvironment('dart.vm.product'))
|
||||
Stream<ProcessSignal> Function(ProcessSignal signal)? _signalWatch;
|
||||
|
||||
@pragma('vm:entry-point', !const bool.fromEnvironment('dart.vm.product'))
|
||||
StreamSubscription<ProcessSignal>? _signalSubscription;
|
||||
@pragma("vm:entry-point")
|
||||
|
||||
@pragma('vm:entry-point', !const bool.fromEnvironment('dart.vm.product'))
|
||||
bool _enableServicePortFallback = false;
|
||||
@pragma("vm:entry-point")
|
||||
|
||||
@pragma('vm:entry-point', !const bool.fromEnvironment('dart.vm.product'))
|
||||
bool _waitForDdsToAdvertiseService = false;
|
||||
@pragma("vm:entry-point", !const bool.fromEnvironment('dart.vm.product'))
|
||||
|
||||
@pragma('vm:entry-point', !const bool.fromEnvironment('dart.vm.product'))
|
||||
bool _serveObservatory = false;
|
||||
|
||||
// HTTP server.
|
||||
|
|
Loading…
Reference in a new issue