diff options
author | cpu@chromium.org <cpu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-05-21 01:42:10 +0000 |
---|---|---|
committer | cpu@chromium.org <cpu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-05-21 01:42:10 +0000 |
commit | f12e596a27f6a1df1b4ccd52f9b1b8244bad42bb (patch) | |
tree | 01031d7a9dfe6d058ea30a2539f3d5c8f060a33f /base/metrics | |
parent | 0bea112fc6e383d156f9ba73479dadb485d714ce (diff) | |
download | chromium_src-f12e596a27f6a1df1b4ccd52f9b1b8244bad42bb.zip chromium_src-f12e596a27f6a1df1b4ccd52f9b1b8244bad42bb.tar.gz chromium_src-f12e596a27f6a1df1b4ccd52f9b1b8244bad42bb.tar.bz2 |
Remving global statics from the headers, so we can split-link.
The issue is that the split linker has issues with data exports vs function exports
currently only function exports are supported.
NOTRY=true
TBR=brettw,jam
TEST=none
BUG=237249
Review URL: https://chromiumcodereview.appspot.com/15403002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@201194 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/metrics')
-rw-r--r-- | base/metrics/stats_table.cc | 14 | ||||
-rw-r--r-- | base/metrics/stats_table.h | 6 |
2 files changed, 13 insertions, 7 deletions
diff --git a/base/metrics/stats_table.cc b/base/metrics/stats_table.cc index 9585863..9b7f293f 100644 --- a/base/metrics/stats_table.cc +++ b/base/metrics/stats_table.cc @@ -248,7 +248,7 @@ struct StatsTable::TLSData { }; // We keep a singleton table which can be easily accessed. -StatsTable* StatsTable::global_table_ = NULL; +StatsTable* global_table = NULL; StatsTable::StatsTable(const std::string& name, int max_threads, int max_counters) @@ -281,8 +281,16 @@ StatsTable::~StatsTable() { delete impl_; // If we are the global table, unregister ourselves. - if (global_table_ == this) - global_table_ = NULL; + if (global_table == this) + global_table = NULL; +} + +StatsTable* StatsTable::current() { + return global_table; +} + +void StatsTable::set_current(StatsTable* value) { + global_table = value; } int StatsTable::GetSlot() const { diff --git a/base/metrics/stats_table.h b/base/metrics/stats_table.h index d972e7c..0abc214 100644 --- a/base/metrics/stats_table.h +++ b/base/metrics/stats_table.h @@ -52,10 +52,10 @@ class BASE_EXPORT StatsTable { // For convenience, we create a static table. This is generally // used automatically by the counters. - static StatsTable* current() { return global_table_; } + static StatsTable* current(); // Set the global table for use in this process. - static void set_current(StatsTable* value) { global_table_ = value; } + static void set_current(StatsTable* value); // Get the slot id for the calling thread. Returns 0 if no // slot is assigned. @@ -185,8 +185,6 @@ class BASE_EXPORT StatsTable { CountersMap counters_; ThreadLocalStorage::Slot tls_index_; - static StatsTable* global_table_; - DISALLOW_COPY_AND_ASSIGN(StatsTable); }; |