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

Issue 10127008: Support passing an environment variable map to child processes. (Closed)

Created:
8 years, 8 months ago by Mads Ager (google)
Modified:
8 years, 8 months ago
Reviewers:
Søren Gjesse
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Support passing an environment variable map to child processes. Fix minor type warning in test. R=sgjesse@google.com BUG=dartbug.com/2193 TEST= Committed: https://code.google.com/p/dart/source/detail?r=6794

Patch Set 1 #

Total comments: 8

Patch Set 2 : Address comments. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+246 lines, -46 lines) Patch
M runtime/bin/builtin_natives.cc View 1 chunk +1 line, -1 line 0 comments Download
M runtime/bin/process.h View 1 chunk +2 lines, -0 lines 0 comments Download
M runtime/bin/process.cc View 5 chunks +65 lines, -34 lines 0 comments Download
M runtime/bin/process.dart View 1 1 chunk +10 lines, -0 lines 0 comments Download
M runtime/bin/process_impl.dart View 1 4 chunks +22 lines, -0 lines 0 comments Download
M runtime/bin/process_linux.cc View 3 chunks +24 lines, -4 lines 0 comments Download
M runtime/bin/process_macos.cc View 3 chunks +24 lines, -4 lines 0 comments Download
M runtime/bin/process_win.cc View 1 3 chunks +31 lines, -2 lines 0 comments Download
A tests/standalone/src/io/PrintEnv.dart View 1 chunk +9 lines, -0 lines 0 comments Download
A tests/standalone/src/io/ProcessEnvironmentTest.dart View 1 chunk +57 lines, -0 lines 0 comments Download
M tests/standalone/src/io/TestingServer.dart View 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 3 (0 generated)
Mads Ager (google)
8 years, 8 months ago (2012-04-19 12:30:06 UTC) #1
Søren Gjesse
lgtm https://chromiumcodereview.appspot.com/10127008/diff/1/runtime/bin/process_impl.dart File runtime/bin/process_impl.dart (right): https://chromiumcodereview.appspot.com/10127008/diff/1/runtime/bin/process_impl.dart#newcode78 runtime/bin/process_impl.dart:78: if (key is !String || value is !String) ...
8 years, 8 months ago (2012-04-19 12:45:54 UTC) #2
Mads Ager (google)
8 years, 8 months ago (2012-04-20 12:24:51 UTC) #3
https://chromiumcodereview.appspot.com/10127008/diff/1/runtime/bin/process_im...
File runtime/bin/process_impl.dart (right):

https://chromiumcodereview.appspot.com/10127008/diff/1/runtime/bin/process_im...
runtime/bin/process_impl.dart:78: if (key is !String || value is !String) {
On 2012/04/19 12:45:55, Søren Gjesse wrote:
> Maybe we should allow any type on value and just rely on tpString. E.g.
numbers
> makes sense.

I would like to start out requiring this to be a Map<String, String>. toString
is not guaranteed to return a string so these checks are needed anyway. We can
of course perform toString and then check the result but I think it is fair to
force the programmer to make environment-variable values strings.

https://chromiumcodereview.appspot.com/10127008/diff/1/runtime/bin/process_im...
runtime/bin/process_impl.dart:78: if (key is !String || value is !String) {
On 2012/04/19 12:45:55, Søren Gjesse wrote:
> Check that the key does not contain illegal charcters e.g. =.

An early check for that would make sense, thanks. Added.

https://chromiumcodereview.appspot.com/10127008/diff/1/runtime/bin/process_im...
runtime/bin/process_impl.dart:78: if (key is !String || value is !String) {
On 2012/04/19 12:45:55, Søren Gjesse wrote:
> For both key and value.toString() is there any charset restriction?

Yes, at this point if you go out of ASCII range the Windows implementation will
not like that. I will add a note on that. The VM does not behave nicely in this
situation. It does not return an error when Dart_NewString() is passed invalid
utf8 data. I have filed issue 2663 on that. When that is fixed it should fail
somewhat gracefully.

https://chromiumcodereview.appspot.com/10127008/diff/1/runtime/bin/process_wi...
File runtime/bin/process_win.cc (right):

https://chromiumcodereview.appspot.com/10127008/diff/1/runtime/bin/process_wi...
runtime/bin/process_win.cc:602: printf("%s\n", environment[i]);
On 2012/04/19 12:45:55, Søren Gjesse wrote:
> Debugging print

Removed.

Powered by Google App Engine
This is Rietveld 408576698