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

Unified Diff: base/stats_table.cc

Issue 126100: Fix StatsTable::RegisterThread so that it doesn't crash if shared memory... (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 11 years, 6 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 | « no previous file | base/stats_table_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/stats_table.cc
===================================================================
--- base/stats_table.cc (revision 18166)
+++ base/stats_table.cc (working copy)
@@ -287,6 +287,8 @@
int StatsTable::RegisterThread(const std::string& name) {
int slot = 0;
+ if (!impl_)
+ return 0;
// Registering a thread requires that we lock the shared memory
// so that two threads don't grab the same slot. Fortunately,
@@ -298,8 +300,6 @@
return 0;
}
- DCHECK(impl_);
-
// We have space, so consume a column in the table.
std::string thread_name = name;
if (name.empty())
@@ -448,8 +448,6 @@
}
int StatsTable::AddCounter(const std::string& name) {
- DCHECK(impl_);
-
if (!impl_)
return 0;
« no previous file with comments | « no previous file | base/stats_table_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698