summaryrefslogtreecommitdiffstats
path: root/base
diff options
context:
space:
mode:
authorpaulg@google.com <paulg@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-08-08 20:03:42 +0000
committerpaulg@google.com <paulg@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-08-08 20:03:42 +0000
commit764be58b4a7cc20271571be59118d260aad13966 (patch)
tree3d9d35e2ad584e0ce12893e4eb1d1f3230153642 /base
parent9bc6ce1d3c1a78b8a6997e67cd8bbd3497f081fb (diff)
downloadchromium_src-764be58b4a7cc20271571be59118d260aad13966.zip
chromium_src-764be58b4a7cc20271571be59118d260aad13966.tar.gz
chromium_src-764be58b4a7cc20271571be59118d260aad13966.tar.bz2
Stub out unused Windows specific code.
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@588 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base')
-rw-r--r--base/tracked_objects.cc22
-rw-r--r--base/tracked_objects.h9
2 files changed, 22 insertions, 9 deletions
diff --git a/base/tracked_objects.cc b/base/tracked_objects.cc
index 61c3639..8694bfd 100644
--- a/base/tracked_objects.cc
+++ b/base/tracked_objects.cc
@@ -301,6 +301,7 @@ void ThreadData::SnapshotDeathMap(DeathMap *output) const {
(*output)[it->first] = it->second;
}
+#ifdef OS_WIN
void ThreadData::RunOnAllThreads(void (*function)()) {
ThreadData* list = first(); // Get existing list.
@@ -327,6 +328,7 @@ void ThreadData::RunOnAllThreads(void (*function)()) {
int ret_val = CloseHandle(completion_handle);
DCHECK(ret_val);
}
+#endif
// static
bool ThreadData::StartTracking(bool status) {
@@ -354,6 +356,7 @@ bool ThreadData::IsActive() {
return status_ == ACTIVE;
}
+#ifdef OS_WIN
// static
void ThreadData::ShutdownMultiThreadTracking() {
// Using lock, guarantee that no new ThreadData instances will be created.
@@ -370,6 +373,7 @@ void ThreadData::ShutdownMultiThreadTracking() {
// MessageLoops, but we won't bother doing cleanup (destruction of data) yet.
return;
}
+#endif
// static
void ThreadData::ShutdownSingleThreadedCleanup() {
@@ -427,7 +431,7 @@ bool ThreadData::ThreadSafeDownCounter::LastCaller() {
}
//------------------------------------------------------------------------------
-
+#ifdef OS_WIN
ThreadData::RunTheStatic::RunTheStatic(FunctionPointer function,
HANDLE completion_handle,
ThreadSafeDownCounter* counter)
@@ -437,11 +441,11 @@ ThreadData::RunTheStatic::RunTheStatic(FunctionPointer function,
}
void ThreadData::RunTheStatic::Run() {
- function_();
- if (counter_->LastCaller())
- SetEvent(completion_handle_);
- }
-
+ function_();
+ if (counter_->LastCaller())
+ SetEvent(completion_handle_);
+}
+#endif
//------------------------------------------------------------------------------
// Individual 3-tuple of birth (place and thread) along with death thread, and
@@ -750,13 +754,13 @@ bool Comparator::Acceptable(const Snapshot& sample) const {
if (required_.size()) {
switch (selector_) {
case BIRTH_THREAD:
- if (sample.birth_thread()->ThreadName().find(required_)
- == std::string.npos)
+ if (sample.birth_thread()->ThreadName().find(required_) ==
+ std::string::npos)
return false;
break;
case DEATH_THREAD:
- if (sample.DeathThreadName().find(required_) == std::string.npos)
+ if (sample.DeathThreadName().find(required_) == std::string::npos)
return false;
break;
diff --git a/base/tracked_objects.h b/base/tracked_objects.h
index 23638e1..62a106a 100644
--- a/base/tracked_objects.h
+++ b/base/tracked_objects.h
@@ -173,7 +173,12 @@ class Snapshot {
class DataCollector {
public:
+#if defined(__GNUC__)
+ // gcc won't compile with 'const Snapshot'.
+ typedef std::vector<Snapshot> Collection;
+#else
typedef std::vector<const Snapshot> Collection;
+#endif
// Construct with a list of how many threads should contribute. This helps us
// determine (in the async case) when we are done with all contributions.
@@ -387,6 +392,7 @@ class ThreadData {
static bool StartTracking(bool status);
static bool IsActive();
+#ifdef OS_WIN
// WARNING: ONLY call this function when all MessageLoops are still intact for
// all registered threads. IF you call it later, you will crash.
// Note: You don't need to call it at all, and you can wait till you are
@@ -398,6 +404,7 @@ class ThreadData {
// it Posts a Task to all registered threads to be sure they are aware that no
// more accumulation can take place.
static void ShutdownMultiThreadTracking();
+#endif
// WARNING: ONLY call this function when you are running single threaded
// (again) and all message loops and threads have terminated. Until that
@@ -432,6 +439,7 @@ class ThreadData {
Lock lock_; // protect access to remaining_count_.
};
+#ifdef OS_WIN
// A Task class that runs a static method supplied, and checks to see if this
// is the last tasks instance (on last thread) that will run the method.
// IF this is the last run, then the supplied event is signalled.
@@ -452,6 +460,7 @@ class ThreadData {
DISALLOW_EVIL_CONSTRUCTORS(RunTheStatic);
};
+#endif
// Each registered thread is called to set status_ to SHUTDOWN.
// This is done redundantly on every registered thread because it is not