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

Issue 4079: Porting refactoring changes:... (Closed)

Created:
12 years, 3 months ago by please use my chromium address
Modified:
5 years, 1 month ago
CC:
chromium-reviews_googlegroups.com
Visibility:
Public.

Description

Porting refactoring changes: - move env_util into base/sys_info - move rand_util to base and simplify its public interface Please test it on Windows. I had to touch some files which are not yet included in Linux build. The changes are basically find/replace in them, but mistakes may happen. This is related to http://codereview.chromium.org/4247 (porting in browser/ )

Patch Set 1 #

Patch Set 2 : '' #

Patch Set 3 : '' #

Patch Set 4 : '' #

Patch Set 5 : '' #

Patch Set 6 : '' #

Patch Set 7 : '' #

Patch Set 8 : '' #

Patch Set 9 : '' #

Patch Set 10 : '' #

Patch Set 11 : '' #

Patch Set 12 : '' #

Unified diffs Side-by-side diffs Delta from patch set Stats (+354 lines, -199 lines) Patch
M base/SConscript View 1 2 3 4 5 6 4 chunks +4 lines, -0 lines 1 comment Download
M base/build/base.vcproj View 1 2 3 4 5 8 1 chunk +12 lines, -0 lines 2 comments Download
M base/build/base_unittests.vcproj View 1 chunk +4 lines, -0 lines 0 comments Download
A base/rand_util.h View 1 2 3 4 5 6 1 chunk +24 lines, -0 lines 1 comment Download
A base/rand_util.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +47 lines, -0 lines 2 comments Download
A base/rand_util_posix.cc View 2 3 4 5 6 1 chunk +27 lines, -0 lines 0 comments Download
A base/rand_util_unittest.cc View 7 8 9 10 1 chunk +22 lines, -0 lines 0 comments Download
A base/rand_util_win.cc View 2 3 4 5 6 1 chunk +30 lines, -0 lines 1 comment Download
M base/sys_info.h View 1 2 3 4 5 1 chunk +25 lines, -0 lines 0 comments Download
M base/sys_info_posix.cc View 1 2 3 4 5 2 chunks +57 lines, -0 lines 0 comments Download
M base/sys_info_unittest.cc View 1 1 chunk +10 lines, -0 lines 1 comment Download
M base/sys_info_win.cc View 1 2 3 4 5 6 2 chunks +58 lines, -0 lines 2 comments Download
M chrome/browser/browser_main.cc View 1 chunk +0 lines, -1 line 0 comments Download
M chrome/browser/cache_manager_host.cc View 1 chunk +0 lines, -1 line 0 comments Download
M chrome/browser/importer/importer_unittest.cc View 2 chunks +0 lines, -5 lines 0 comments Download
M chrome/browser/metrics_log.cc View 1 2 3 4 5 3 chunks +5 lines, -6 lines 0 comments Download
M chrome/browser/render_process_host.h View 1 2 3 3 chunks +3 lines, -2 lines 0 comments Download
M chrome/browser/render_process_host.cc View 3 chunks +2 lines, -2 lines 0 comments Download
M chrome/browser/safe_browsing/bloom_filter_unittest.cc View 1 2 3 4 5 1 chunk +2 lines, -2 lines 1 comment Download
M chrome/browser/safe_browsing/protocol_manager.cc View 1 2 3 4 5 4 chunks +6 lines, -6 lines 3 comments Download
M chrome/browser/views/bug_report_view.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/common/SConscript View 2 chunks +0 lines, -2 lines 0 comments Download
M chrome/common/common.vcproj View 2 chunks +0 lines, -16 lines 0 comments Download
D chrome/common/env_util.h View 1 chunk +0 lines, -40 lines 0 comments Download
D chrome/common/env_util.cc View 1 chunk +0 lines, -46 lines 0 comments Download
M chrome/common/logging_chrome.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M chrome/common/process_watcher.cc View 1 2 3 4 5 2 chunks +4 lines, -4 lines 0 comments Download
D chrome/common/rand_util.h View 1 chunk +0 lines, -24 lines 0 comments Download
D chrome/common/rand_util.cc View 1 chunk +0 lines, -29 lines 0 comments Download
M chrome/renderer/renderer_main.cc View 1 chunk +0 lines, -1 line 0 comments Download
M chrome/test/automated_ui_tests/automated_ui_tests.cc View 1 2 3 4 5 4 chunks +7 lines, -7 lines 0 comments Download
M chrome/test/selenium/selenium_test.cc View 2 chunks +2 lines, -2 lines 0 comments Download

Messages

Total messages: 20 (0 generated)
Dean McNamee
Overall looks good. Might want to mention something about thread safety for RandInt, and maybe ...
12 years, 3 months ago (2008-09-25 12:46:44 UTC) #1
Mark Mentovai
This mostly looks good, just a few comments. http://codereview.chromium.org/4079/diff/1/9 File base/rand_util.h (right): http://codereview.chromium.org/4079/diff/1/9#newcode11 Line 11: ...
12 years, 3 months ago (2008-09-25 14:00:23 UTC) #2
please use my chromium address
http://codereview.chromium.org/4079/diff/1/7 File base/rand_util.cc (right): http://codereview.chromium.org/4079/diff/1/7#newcode19 Line 19: #if defined(OS_WIN) On 2008/09/25 12:46:44, deanm wrote: > ...
12 years, 3 months ago (2008-09-25 15:25:20 UTC) #3
sgk
SCons lgtm
12 years, 3 months ago (2008-09-25 20:04:10 UTC) #4
please use my chromium address
*ping* - please review my updates (SCons is LGTM-ed).
12 years, 2 months ago (2008-09-26 15:37:36 UTC) #5
Dean McNamee
Overall looks really good. A bunch of comments. I will need to look at the ...
12 years, 2 months ago (2008-09-26 15:58:57 UTC) #6
please use my chromium address
On 2008/09/26 15:58:57, deanm wrote: \> http://codereview.chromium.org/4079/diff/69/277#newcode12 > Line 12: return static_cast<float>(base::RandInt(1, INT_MAX)) / INT_MAX; ...
12 years, 2 months ago (2008-09-26 18:20:58 UTC) #7
eroman
Cool, thanks for doing this. I also need rand_util to be in base/, so that ...
12 years, 2 months ago (2008-09-27 02:24:06 UTC) #8
please use my chromium address
On 2008/09/27 02:24:06, eroman wrote: > http://codereview.chromium.org/4079/diff/406/414 > File base/rand_util.h (right): > > http://codereview.chromium.org/4079/diff/406/414#newcode6 > ...
12 years, 2 months ago (2008-09-27 06:41:54 UTC) #9
Mark Mentovai
http://codereview.chromium.org/4079/diff/439/605 File base/build/base.vcproj (right): http://codereview.chromium.org/4079/diff/439/605#newcode565 Line 565: RelativePath=".\rand_util_posix.cc" This is the vcproj, which is only ...
12 years, 2 months ago (2008-09-27 19:50:17 UTC) #10
Dean McNamee
Oh man, Mark pointed out a really good issue on the distribution. I also agree ...
12 years, 2 months ago (2008-09-28 13:31:51 UTC) #11
cpu_(ooo_6.6-7.5)
One thing, in windows we rely on the rand to be crypto strong, the reason ...
12 years, 2 months ago (2008-09-29 00:21:36 UTC) #12
please use my chromium address
On 2008/09/27 19:50:17, Mark Mentovai wrote: > http://codereview.chromium.org/4079/diff/439/605 > File base/build/base.vcproj (right): > > http://codereview.chromium.org/4079/diff/439/605#newcode565 ...
12 years, 2 months ago (2008-09-29 12:01:36 UTC) #13
Mark Mentovai
http://codereview.chromium.org/4079/diff/476/836 File base/rand_util.cc (right): http://codereview.chromium.org/4079/diff/476/836#newcode23 Line 23: return min + base::RandDouble() * (max - min); ...
12 years, 2 months ago (2008-09-29 14:13:09 UTC) #14
please use my chromium address
On 2008/09/29 14:13:09, Mark Mentovai wrote: > http://codereview.chromium.org/4079/diff/476/836 > File base/rand_util.cc (right): > > http://codereview.chromium.org/4079/diff/476/836#newcode23 ...
12 years, 2 months ago (2008-09-29 16:47:41 UTC) #15
please use my chromium address
Added rand_util to the Windows build. Sorry for some noise it generated. :-/
12 years, 2 months ago (2008-09-29 16:53:35 UTC) #16
Mark Mentovai
I think this looks good with the one major bit here addressed. Let's freeze this ...
12 years, 2 months ago (2008-09-29 18:08:18 UTC) #17
please use my chromium address
On 2008/09/29 18:08:18, Mark Mentovai wrote: > http://codereview.chromium.org/4079/diff/574/1329#newcode30 > Line 30: (static_cast<int64>(max) - min + ...
12 years, 2 months ago (2008-09-29 19:05:19 UTC) #18
Mark Mentovai
LGTM with additional changes noted below for the Windows build. Committed at r2697. Please look ...
12 years, 2 months ago (2008-09-29 22:20:05 UTC) #19
please use my chromium address
12 years, 2 months ago (2008-09-30 06:51:31 UTC) #20
On 2008/09/29 22:20:05, Mark Mentovai wrote:
> LGTM with additional changes noted below for the Windows build.  Committed at
> r2697.  Please look over the changes I made and make sure you're OK with them.

Thanks a lot. Compiles fine, passes tests, looks good.

> This was a biggie, I think we'd all be better served in the future if things
> were broken up a little bit more if possible.  I know that sometimes that's
not
> possible, but in this case, at least the random parts and the environment
> variable parts could have been broken up into different changes.

OK. Sorry for making this more difficult to review.

> http://codereview.chromium.org/4079/diff/701/709#newcode9
> Line 9: TEST(SysInfoTest, NumProcs) {
> I moved these to TEST_F in r2603, I've updated the two new TESTs below to
TEST_F
> as well.
> 
> r2603 was from September 25, in the future, it might be a good idea to sync
your
> tree periodically to ensure that your changes still work with the
ever-changing
> state of the world.

Yeah. At some point I got frustrated at build errors after syncing so I reverted
to a known-good revision... I could probably re-sync later. I will try more
often next time.

> http://codereview.chromium.org/4079/diff/701/717#newcode375
> Line 375: if (base::SysInfo::HasEnvironmentVariable(env_vars::kHeadless))
> env_vars::kHeadless is a const wchar_t*, but HasEnvVar accepts a const char*. 
> The same goes for the other env_vars constants.  I had to update GetEnvVar and
> HasEnvVar to use a wchar_t* parameter, update the Windows and POSIX
> implementations, and update the test.  These changes were all in
> base/sys_info.*.  Sucky as it is, that's how our current strings picture
looks. 
> This was the least invasive fix, and we were already using wstrings for output
> anyway.

Thanks again. I suspected something will happen on Windows with this wchar
handling.

Powered by Google App Engine
This is Rietveld 408576698