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

Issue 3076042: Use Environment::SetVar in more places. (Closed)

Created:
10 years, 4 months ago by tfarina
Modified:
9 years, 7 months ago
Reviewers:
Lei Zhang, amit
CC:
chromium-reviews, Paweł Hajdan Jr., ben+cc_chromium.org, cbentzel+watch_chromium.org, nkostylev+cc_chromium.org, stuartmorgan+watch_chromium.org, Erik does not do reviews, jam, Aaron Boodman, pam+watch_chromium.org, kuchhal, darin-cc_chromium.org, davemoore+watch_chromium.org, amit
Base URL:
git://git.chromium.org/chromium.git
Visibility:
Public.

Description

Use Environment::SetVar in more places. Make use of Environment::SetVar API to replace the calls to the Windows function SetEnvironmentVariable. BUG=None TEST=trybots Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=55993

Patch Set 1 #

Patch Set 2 : fix trybots #

Patch Set 3 : include fix #

Patch Set 4 : more fixes #

Patch Set 5 : fix typo #

Patch Set 6 : WideToUTF8 #

Patch Set 7 : fix macro expansion #

Patch Set 8 : add missing include #

Total comments: 5

Patch Set 9 : rebased to ToT #

Unified diffs Side-by-side diffs Delta from patch set Stats (+67 lines, -45 lines) Patch
M chrome/app/breakpad_win.cc View 1 3 chunks +7 lines, -5 lines 0 comments Download
M chrome/app/client_util.cc View 1 2 3 4 5 6 7 8 3 chunks +9 lines, -5 lines 0 comments Download
M chrome/browser/browser_main_win.cc View 1 3 chunks +6 lines, -6 lines 0 comments Download
M chrome/browser/first_run/first_run_win.cc View 3 chunks +5 lines, -3 lines 0 comments Download
M chrome/test/tab_switching/tab_switching_test.cc View 1 2 3 4 5 6 7 8 2 chunks +5 lines, -4 lines 0 comments Download
M chrome_frame/crash_reporting/crash_dll.h View 2 3 1 chunk +8 lines, -6 lines 0 comments Download
M chrome_frame/crash_reporting/crash_dll.cc View 2 3 3 chunks +6 lines, -6 lines 0 comments Download
M chrome_frame/crash_reporting/nt_loader_unittest.cc View 1 2 3 5 chunks +13 lines, -6 lines 0 comments Download
M chrome_frame/crash_reporting/vectored_handler_unittest.cc View 1 2 3 4 5 6 2 chunks +8 lines, -4 lines 0 comments Download

Messages

Total messages: 14 (0 generated)
tfarina
10 years, 4 months ago (2010-08-07 04:45:35 UTC) #1
tfarina
On 2010/08/07 04:45:35, tfarina wrote: > friendly ping.
10 years, 4 months ago (2010-08-12 02:58:20 UTC) #2
Lei Zhang
Whoops, missed this one. http://codereview.chromium.org/3076042/diff/22001/23006 File chrome_frame/crash_reporting/crash_dll.cc (right): http://codereview.chromium.org/3076042/diff/22001/23006#newcode26 chrome_frame/crash_reporting/crash_dll.cc:26: DWORD ret = ::GetEnvironmentVariable(name, value, ...
10 years, 4 months ago (2010-08-12 21:05:01 UTC) #3
amit
http://codereview.chromium.org/3076042/diff/22001/23001 File chrome/app/breakpad_win.cc (right): http://codereview.chromium.org/3076042/diff/22001/23001#newcode209 chrome/app/breakpad_win.cc:209: if (!env->HasVar(env_vars::kRestartInfo)) { This looks odd and expensive, considering ...
10 years, 4 months ago (2010-08-12 21:14:13 UTC) #4
Lei Zhang
http://codereview.chromium.org/3076042/diff/22001/23001 File chrome/app/breakpad_win.cc (right): http://codereview.chromium.org/3076042/diff/22001/23001#newcode209 chrome/app/breakpad_win.cc:209: if (!env->HasVar(env_vars::kRestartInfo)) { On 2010/08/12 21:14:13, amit wrote: > ...
10 years, 4 months ago (2010-08-12 21:27:10 UTC) #5
amit
On Thu, Aug 12, 2010 at 2:27 PM, <thestig@chromium.org> wrote: > > http://codereview.chromium.org/3076042/diff/22001/23001 > File ...
10 years, 4 months ago (2010-08-12 21:52:18 UTC) #6
Lei Zhang
On 2010/08/12 21:52:18, amit wrote: > > In general, does it matter? None of these ...
10 years, 4 months ago (2010-08-12 22:02:49 UTC) #7
amit
On Thu, Aug 12, 2010 at 3:02 PM, <thestig@chromium.org> wrote: > On 2010/08/12 21:52:18, amit ...
10 years, 4 months ago (2010-08-12 22:20:28 UTC) #8
tfarina
http://codereview.chromium.org/3076042/diff/22001/23009 File chrome_frame/crash_reporting/vectored_handler_unittest.cc (right): http://codereview.chromium.org/3076042/diff/22001/23009#newcode145 chrome_frame/crash_reporting/vectored_handler_unittest.cc:145: EXPECT_TRUE(env->SetVar(WideToUTF8(kCrashOnLoadMode).c_str(), "1")); On 2010/08/12 21:05:01, Lei Zhang wrote: > ...
10 years, 4 months ago (2010-08-13 01:18:42 UTC) #9
Lei Zhang
On 2010/08/13 01:18:42, tfarina wrote: > http://codereview.chromium.org/3076042/diff/22001/23009 > File chrome_frame/crash_reporting/vectored_handler_unittest.cc (right): > > http://codereview.chromium.org/3076042/diff/22001/23009#newcode145 > ...
10 years, 4 months ago (2010-08-13 01:38:43 UTC) #10
tfarina
On Thu, Aug 12, 2010 at 10:38 PM, <thestig@chromium.org> wrote: > On 2010/08/13 01:18:42, tfarina ...
10 years, 4 months ago (2010-08-13 01:44:51 UTC) #11
Lei Zhang
On 2010/08/13 01:44:51, tfarina wrote: > Yeah, I looked again at the gyp file and ...
10 years, 4 months ago (2010-08-13 01:46:30 UTC) #12
tfarina
On Thu, Aug 12, 2010 at 10:46 PM, <thestig@chromium.org> wrote: > On 2010/08/13 01:44:51, tfarina ...
10 years, 4 months ago (2010-08-13 01:48:32 UTC) #13
tfarina
10 years, 4 months ago (2010-08-13 19:25:00 UTC) #14
On Thu, Aug 12, 2010 at 6:14 PM,  <amit@chromium.org> wrote:
>
> http://codereview.chromium.org/3076042/diff/22001/23001
> File chrome/app/breakpad_win.cc (right):
>
> http://codereview.chromium.org/3076042/diff/22001/23001#newcode209
> chrome/app/breakpad_win.cc:209: if
> (!env->HasVar(env_vars::kRestartInfo)) {
> This looks odd and expensive, considering that this is just a
> replacement for a single ::GetEnvironmentVariableW (or similar flavor on
> other OSs) API.
> Is there a better way to write this without having to incur
> allocation/deallocation? Perhaps as EnvironmentTraits with static
> methods like the following:
>
> class Win32EnvTraits {
>  static bool HasVar(...);
>  static bool SetVar(...);
>  static bool GetVar(...);
> };
>
> class OSXEnvTraits {
> ...
> };
>
> #ifdef WIN32
> typedef Win32EnvTraits Environment;
> #else if ....
> ...
> #endif
>

I like this idea, that could help in situations like this (having to
alloc each time doesn't make much sense in these cases):

http://git.chromium.org/cgi-bin/gitweb.cgi?p=chromium.git;a=blob;f=net/test/t...
http://git.chromium.org/cgi-bin/gitweb.cgi?p=chromium.git;a=blob;f=media/audi...

-- 
A: Because it messes up the order in which people normally read text.
 See http://en.wikipedia.org/wiki/Posting_style
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?

-Thiago

Powered by Google App Engine
This is Rietveld 408576698