Bug 680864 - Part B - Remove IPC_MESSAGE_ENABLE_RPC/BASE_API defines + histogrammer leftovers; r=cjones

This commit is contained in:
Ed Morley 2011-08-23 11:43:04 +01:00
Родитель 3f11726bf8
Коммит 779c32d144
4 изменённых файлов: 6 добавлений и 57 удалений

Просмотреть файл

@ -45,7 +45,6 @@
#include <string>
#include <vector>
#define BASE_API
#include "testing/gtest/include/gtest/gtest_prod.h"
#include "base/time.h"
#include "base/lock.h"
@ -260,7 +259,7 @@ class CustomHistogram;
class Histogram;
class LinearHistogram;
class BASE_API Histogram {
class Histogram {
public:
typedef int Sample; // Used for samples (and ranges of samples).
typedef int Count; // Used to count samples in a bucket.
@ -319,7 +318,7 @@ class BASE_API Histogram {
//----------------------------------------------------------------------------
// Statistic values, developed over the life of the histogram.
class BASE_API SampleSet {
class SampleSet {
public:
explicit SampleSet();
~SampleSet();
@ -578,7 +577,7 @@ class BASE_API Histogram {
// LinearHistogram is a more traditional histogram, with evenly spaced
// buckets.
class BASE_API LinearHistogram : public Histogram {
class LinearHistogram : public Histogram {
public:
virtual ~LinearHistogram();
@ -634,7 +633,7 @@ class BASE_API LinearHistogram : public Histogram {
//------------------------------------------------------------------------------
// BooleanHistogram is a histogram for booleans.
class BASE_API BooleanHistogram : public LinearHistogram {
class BooleanHistogram : public LinearHistogram {
public:
static Histogram* FactoryGet(const std::string& name, Flags flags);
@ -651,7 +650,7 @@ class BASE_API BooleanHistogram : public LinearHistogram {
//------------------------------------------------------------------------------
// CustomHistogram is a histogram for a set of custom integers.
class BASE_API CustomHistogram : public Histogram {
class CustomHistogram : public Histogram {
public:
static Histogram* FactoryGet(const std::string& name,
@ -677,7 +676,7 @@ class BASE_API CustomHistogram : public Histogram {
// general place for histograms to register, and supports a global API for
// accessing (i.e., dumping, or graphing) the data in all the histograms.
class BASE_API StatisticsRecorder {
class StatisticsRecorder {
public:
typedef std::vector<Histogram*> Histograms;

Просмотреть файл

@ -315,7 +315,6 @@ void MessageLoop::RunTask(Task* task) {
// Execute the task and assume the worst: It is probably not reentrant.
nestable_tasks_allowed_ = false;
HistogramEvent(kTaskRunEvent);
task->Run();
delete task;
@ -507,36 +506,6 @@ bool MessageLoop::PendingTask::operator<(const PendingTask& other) const {
return (sequence_num - other.sequence_num) > 0;
}
//------------------------------------------------------------------------------
// Method and data for histogramming events and actions taken by each instance
// on each thread.
// static
void MessageLoop::EnableHistogrammer(bool enable) {
}
void MessageLoop::StartHistogrammer() {
}
void MessageLoop::HistogramEvent(int event) {
}
// Provide a macro that takes an expression (such as a constant, or macro
// constant) and creates a pair to initalize an array of pairs. In this case,
// our pair consists of the expressions value, and the "stringized" version
// of the expression (i.e., the exrpression put in quotes). For example, if
// we have:
// #define FOO 2
// #define BAR 5
// then the following:
// VALUE_TO_NUMBER_AND_NAME(FOO + BAR)
// will expand to:
// {7, "FOO + BAR"}
// We use the resulting array as an argument to our histogram, which reads the
// number as a bucket identifier, and proceeds to use the corresponding name
// in the pair (i.e., the quoted string) when printing out a histogram.
#define VALUE_TO_NUMBER_AND_NAME(name) {name, #name},
//------------------------------------------------------------------------------
// MessageLoopForUI

Просмотреть файл

@ -70,8 +70,6 @@ class MessageLoop : public base::MessagePump::Delegate {
friend class mozilla::ipc::DoWorkRunnable;
public:
static void EnableHistogrammer(bool enable_histogrammer);
// A DestructionObserver is notified when the current MessageLoop is being
// destroyed. These obsevers are notified prior to MessageLoop::current()
// being changed to return NULL. This gives interested parties the chance to
@ -371,15 +369,6 @@ public:
virtual bool DoDelayedWork(base::Time* next_delayed_work_time);
virtual bool DoIdleWork();
// Start recording histogram info about events and action IF it was enabled
// and IF the statistics recorder can accept a registration of our histogram.
void StartHistogrammer();
// Add occurence of event to our histogram, so that we can see what is being
// done in a specific MessageLoop instance (i.e., specific thread).
// If message_histogram_ is NULL, this is a no-op.
void HistogramEvent(int event);
Type type_;
// A list of tasks that need to be processed by this instance. Note that

Просмотреть файл

@ -18,8 +18,6 @@
#include "base/ref_counted.h"
#endif
#define IPC_MESSAGE_ENABLE_RPC
namespace base {
class FileDescriptor;
}
@ -82,12 +80,10 @@ class Message : public Pickle {
return (header()->flags & SYNC_BIT) != 0;
}
#if defined(IPC_MESSAGE_ENABLE_RPC)
// True if this is a synchronous message.
bool is_rpc() const {
return (header()->flags & RPC_BIT) != 0;
}
#endif
// Set this on a reply to a synchronous message.
void set_reply() {
@ -250,11 +246,9 @@ class Message : public Pickle {
header()->flags |= SYNC_BIT;
}
#if defined(IPC_MESSAGE_ENABLE_RPC)
void set_rpc() {
header()->flags |= RPC_BIT;
}
#endif
#if !defined(OS_MACOSX)
protected:
@ -269,9 +263,7 @@ class Message : public Pickle {
UNBLOCK_BIT = 0x0020,
PUMPING_MSGS_BIT= 0x0040,
HAS_SENT_TIME_BIT = 0x0080,
#if defined(IPC_MESSAGE_ENABLE_RPC)
RPC_BIT = 0x0100,
#endif
};
#pragma pack(push, 2)