summaryrefslogtreecommitdiffstats
path: root/base/metrics
diff options
context:
space:
mode:
authorcpu@chromium.org <cpu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-05-21 01:42:10 +0000
committercpu@chromium.org <cpu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-05-21 01:42:10 +0000
commitf12e596a27f6a1df1b4ccd52f9b1b8244bad42bb (patch)
tree01031d7a9dfe6d058ea30a2539f3d5c8f060a33f /base/metrics
parent0bea112fc6e383d156f9ba73479dadb485d714ce (diff)
downloadchromium_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.cc14
-rw-r--r--base/metrics/stats_table.h6
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);
};