diff options
author | ericroman@google.com <ericroman@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-12-17 01:55:42 +0000 |
---|---|---|
committer | ericroman@google.com <ericroman@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-12-17 01:55:42 +0000 |
commit | 4ec0cd19d253161aa42d0f9583da8f0886dff7c9 (patch) | |
tree | f3e1a80019df96acefa83ab2ed28eaabf02ffa9b /base/message_loop.h | |
parent | 4dae50509ea8f29c215e62b351911ecb6d234023 (diff) | |
download | chromium_src-4ec0cd19d253161aa42d0f9583da8f0886dff7c9.zip chromium_src-4ec0cd19d253161aa42d0f9583da8f0886dff7c9.tar.gz chromium_src-4ec0cd19d253161aa42d0f9583da8f0886dff7c9.tar.bz2 |
Temp experiment to confirm theory in crbug.com/5555.
The idea is that by using a comparator which has an (initialized) data member, pop() will avoid a sideffect that reads uninitialized data.
Will revert this once it has run on bot.
Review URL: http://codereview.chromium.org/14500
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@7125 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/message_loop.h')
-rw-r--r-- | base/message_loop.h | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/base/message_loop.h b/base/message_loop.h index 6cd0ef4..2e51234 100644 --- a/base/message_loop.h +++ b/base/message_loop.h @@ -269,8 +269,19 @@ class MessageLoop : public base::MessagePump::Delegate { bool operator<(const PendingTask& other) const; }; + // TEMP HACK: This is the same as std::less, except it has a data member. + // This should cause its storage to be initialized, therefore avoiding a + // UMR in pop(). Experiment for crbug.com/5555. + template<class T> + struct LessComparatorHack { + LessComparatorHack() : junk(42) {} + bool operator()(const T& a, const T& b) const { return a < b; } + int junk; + }; + typedef std::queue<PendingTask> TaskQueue; - typedef std::priority_queue<PendingTask> DelayedTaskQueue; + typedef std::priority_queue<PendingTask, std::vector<PendingTask>, + LessComparatorHack<PendingTask> > DelayedTaskQueue; #if defined(OS_WIN) base::MessagePumpWin* pump_win() { |