Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(668)

Unified Diff: runtime/bin/vmservice_dartium.cc

Issue 2944303003: Support for IPV6 for observatory in Dartium. (Closed)
Patch Set: Incorporated Ryan's suggestions Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/vmservice_dartium.cc
diff --git a/runtime/bin/vmservice_dartium.cc b/runtime/bin/vmservice_dartium.cc
index c0e6f789c17acb02547d9e9271597350ecdf6ca2..2b674d2193abeb69406a4df420fec05fce412b0c 100644
--- a/runtime/bin/vmservice_dartium.cc
+++ b/runtime/bin/vmservice_dartium.cc
@@ -24,10 +24,17 @@ namespace bin {
return 0; \
}
-
-static const char* DEFAULT_VM_SERVICE_SERVER_IP = "127.0.0.1";
+static const char* DART_IPV6_ONLY_FLAG = "DART_IPV6_ONLY";
+static const char* DEFAULT_VM_SERVICE_SERVER_IP_V6 = "::1";
+static const char* DEFAULT_VM_SERVICE_SERVER_IP_V4 = "127.0.0.1";
static const int DEFAULT_VM_SERVICE_SERVER_PORT = 0;
+static bool IsIpv6Only() {
+ char* v = getenv(DART_IPV6_ONLY_FLAG);
+ if (!v) return 0;
+ return v[0] == '1';
+}
+
void VmServiceServer::Bootstrap() {
if (!Platform::Initialize()) {
fprintf(stderr, "Platform::Initialize() failed\n");
@@ -59,7 +66,9 @@ Dart_Isolate VmServiceServer::CreateIsolate(const uint8_t* snapshot_buffer) {
ASSERT(Dart_IsServiceIsolate(isolate));
if (!VmService::Setup(
- DEFAULT_VM_SERVICE_SERVER_IP, DEFAULT_VM_SERVICE_SERVER_PORT,
+ IsIpv6Only() ? DEFAULT_VM_SERVICE_SERVER_IP_V6 :
+ DEFAULT_VM_SERVICE_SERVER_IP_V4,
+ DEFAULT_VM_SERVICE_SERVER_PORT,
false /* running_precompiled */, false /* disable origin checks */,
false /* trace_loading */)) {
fprintf(stderr, "Vmservice::Setup failed: %s\n",
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698