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

Unified Diff: runtime/bin/platform_macos.cc

Issue 1839123003: Begin work on ios secure sockets (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Add comment Created 4 years, 9 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 | « runtime/bin/io_impl_sources.gypi ('k') | runtime/bin/secure_socket_ios.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/platform_macos.cc
diff --git a/runtime/bin/platform_macos.cc b/runtime/bin/platform_macos.cc
index 2641ac1b9a97625dc8676c861f1f45537e8ac9b8..24c83fdb66a79519fd7ca33abf66e6d8d4a994a4 100644
--- a/runtime/bin/platform_macos.cc
+++ b/runtime/bin/platform_macos.cc
@@ -76,14 +76,16 @@ bool Platform::LocalHostname(char *buffer, intptr_t buffer_length) {
char** Platform::Environment(intptr_t* count) {
#if TARGET_OS_IOS
- // TODO(iposva): On Mac (desktop), _NSGetEnviron() is used to access the
- // environ from shared libraries or bundles. This is present in crt_externs.h
- // which is unavailable on iOS. On iOS, everything is statically linked for
- // now. So arguably, accessing the environ directly with a "extern char
- // **environ" will work. But this approach is brittle as the target with this
- // CU could be a dynamic framework (introduced in iOS 8). A more elegant
- // approach needs to be devised.
- return NULL;
+ // TODO(zra,chinmaygarde): On iOS, environment variables are seldom used. Wire
+ // this up if someone needs it. In the meantime, we return an empty array.
+ char** result;
+ result = reinterpret_cast<char**>(Dart_ScopeAllocate(1 * sizeof(*result)));
+ if (result == NULL) {
+ return NULL;
+ }
+ result[0] = NULL;
+ *count = 0;
+ return result;
#else
// Using environ directly is only safe as long as we do not
// provide access to modifying environment variables.
« no previous file with comments | « runtime/bin/io_impl_sources.gypi ('k') | runtime/bin/secure_socket_ios.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698