Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2724)

Unified Diff: base/message_loop.h

Issue 14500: Temp experiment to confirm theory in crbug.com/5555.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 12 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | net/proxy/proxy_script_fetcher.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/message_loop.h
===================================================================
--- base/message_loop.h (revision 6995)
+++ base/message_loop.h (working copy)
@@ -269,8 +269,19 @@
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() {
« no previous file with comments | « no previous file | net/proxy/proxy_script_fetcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698