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

Issue 126100: Fix StatsTable::RegisterThread so that it doesn't crash if shared memory... (Closed)

Created:
11 years, 6 months ago by Neil Rhodes
Modified:
9 years, 7 months ago
CC:
chromium-reviews_googlegroups.com
Visibility:
Public.

Description

Fix StatsTable::RegisterThread so that it doesn't crash if shared memory couldn't be allocated. Instead, it just returns 0. Also, fix StatsTable::AddCounter so that it's not a fatal error if shared memory couldn't be allocated. Instead, it just returns 0. In StatsTableTest::StatsCounter, we now assert that the counter could be created, rather than just expecting it. Much of the remainder of the test relies on the fact that foo.Pointer() is non-NULL, and would crash if it were NULL. TEST= StatsTableTest.* RenderViewTest.* Didn't test on Linux (still figuring out how to build on that plaform). Instead, tested on Mac OS X by modifying StatsTablePrivate::New to return NULL, and then ran: unit_tests --gtest_filter='Render*' base_unittests --gtest_filter='StatsTableTest.*' Both tests tests crashed. Then, I applied the changes in this CL, reran the tests, and verified the crashing no longer occured. BUG=13193 BUG=13196

Patch Set 1 #

Total comments: 2

Patch Set 2 : '' #

Total comments: 1

Patch Set 3 : '' #

Unified diffs Side-by-side diffs Delta from patch set Stats (+5 lines, -7 lines) Patch
M base/stats_table.cc View 1 2 3 chunks +2 lines, -4 lines 0 comments Download
M base/stats_table_unittest.cc View 2 chunks +3 lines, -3 lines 0 comments Download

Messages

Total messages: 9 (0 generated)
Neil Rhodes
FYI: This is my first patch for Chromium.
11 years, 6 months ago (2009-06-14 15:32:36 UTC) #1
Evan Martin
Mike might be a good reviewer for this. http://codereview.chromium.org/126100/diff/1/2 File AUTHORS (right): http://codereview.chromium.org/126100/diff/1/2#newcode19 Line 19: ...
11 years, 6 months ago (2009-06-15 18:35:32 UTC) #2
Mike Belshe
lgtm http://codereview.chromium.org/126100/diff/1/3 File base/stats_table.cc (right): http://codereview.chromium.org/126100/diff/1/3#newcode295 Line 295: if (!impl_) { I would move this ...
11 years, 6 months ago (2009-06-15 18:41:34 UTC) #3
Evan Martin
Neil: when you upload a new version of the patch, can you also sign the ...
11 years, 6 months ago (2009-06-15 19:16:31 UTC) #4
Neil Rhodes
Here's another version addressing the moving of a couple of lines of code: ready for ...
11 years, 6 months ago (2009-06-16 04:34:31 UTC) #5
Evan Martin
On 2009/06/16 04:34:31, Neil Rhodes wrote: > Here's another version addressing the moving of a ...
11 years, 6 months ago (2009-06-16 17:39:07 UTC) #6
Evan Martin
r18527 http://codereview.chromium.org/126100/diff/1006/1007 File base/stats_table.cc (right): http://codereview.chromium.org/126100/diff/1006/1007#newcode291 Line 291: return 0; BTW, Chrome style is to ...
11 years, 6 months ago (2009-06-16 20:50:05 UTC) #7
Neil Rhodes
Removed the extra curly-braces. Take another look
11 years, 6 months ago (2009-06-17 13:47:28 UTC) #8
Evan Martin
11 years, 6 months ago (2009-06-17 15:41:23 UTC) #9
In my previous mail the "r18527" means I committed it as that svn rev.  Sorry
for the confusion!

Powered by Google App Engine
This is Rietveld 408576698