summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorericroman@google.com <ericroman@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-12-17 01:55:42 +0000
committerericroman@google.com <ericroman@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-12-17 01:55:42 +0000
commit4ec0cd19d253161aa42d0f9583da8f0886dff7c9 (patch)
treef3e1a80019df96acefa83ab2ed28eaabf02ffa9b
parent4dae50509ea8f29c215e62b351911ecb6d234023 (diff)
downloadchromium_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
-rw-r--r--base/message_loop.h13
-rw-r--r--net/proxy/proxy_script_fetcher.h4
-rw-r--r--net/proxy/proxy_script_fetcher_unittest.cc12
3 files changed, 20 insertions, 9 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() {
diff --git a/net/proxy/proxy_script_fetcher.h b/net/proxy/proxy_script_fetcher.h
index 3792cab..fddbd7b 100644
--- a/net/proxy/proxy_script_fetcher.h
+++ b/net/proxy/proxy_script_fetcher.h
@@ -50,8 +50,8 @@ class ProxyScriptFetcher {
// Testing helpers (only available to unit-tests).
// --------------------------------------------------------------------------
private:
- FRIEND_TEST(ProxyScriptFetcherTest, DISABLED_Hang);
- FRIEND_TEST(ProxyScriptFetcherTest, DISABLED_TooLarge);
+ FRIEND_TEST(ProxyScriptFetcherTest, Hang);
+ FRIEND_TEST(ProxyScriptFetcherTest, TooLarge);
// Sets the maximum duration for a fetch to |timeout_ms|. Returns the previous
// bound.
diff --git a/net/proxy/proxy_script_fetcher_unittest.cc b/net/proxy/proxy_script_fetcher_unittest.cc
index 22cb91e..73476ed 100644
--- a/net/proxy/proxy_script_fetcher_unittest.cc
+++ b/net/proxy/proxy_script_fetcher_unittest.cc
@@ -160,7 +160,7 @@ GURL GetTestFileUrl(const std::string& relpath) {
return GURL(base_url.spec() + "/" + relpath);
}
-TEST(ProxyScriptFetcherTest, DISABLED_FileUrl) {
+TEST(ProxyScriptFetcherTest, FileUrl) {
SynchFetcher pac_fetcher;
{ // Fetch a non-existent file.
@@ -177,7 +177,7 @@ TEST(ProxyScriptFetcherTest, DISABLED_FileUrl) {
// Note that all mime types are allowed for PAC file, to be consistent
// with other browsers.
-TEST(ProxyScriptFetcherTest, DISABLED_HttpMimeType) {
+TEST(ProxyScriptFetcherTest, HttpMimeType) {
TestServer server(kDocRoot);
SynchFetcher pac_fetcher;
@@ -201,7 +201,7 @@ TEST(ProxyScriptFetcherTest, DISABLED_HttpMimeType) {
}
}
-TEST(ProxyScriptFetcherTest, DISABLED_HttpStatusCode) {
+TEST(ProxyScriptFetcherTest, HttpStatusCode) {
TestServer server(kDocRoot);
SynchFetcher pac_fetcher;
@@ -219,7 +219,7 @@ TEST(ProxyScriptFetcherTest, DISABLED_HttpStatusCode) {
}
}
-TEST(ProxyScriptFetcherTest, DISABLED_ContentDisposition) {
+TEST(ProxyScriptFetcherTest, ContentDisposition) {
TestServer server(kDocRoot);
SynchFetcher pac_fetcher;
@@ -231,7 +231,7 @@ TEST(ProxyScriptFetcherTest, DISABLED_ContentDisposition) {
EXPECT_EQ("-downloadable.pac-\n", result.bytes);
}
-TEST(ProxyScriptFetcherTest, DISABLED_TooLarge) {
+TEST(ProxyScriptFetcherTest, TooLarge) {
TestServer server(kDocRoot);
SynchFetcher pac_fetcher;
@@ -264,7 +264,7 @@ TEST(ProxyScriptFetcherTest, DISABLED_TooLarge) {
}
}
-TEST(ProxyScriptFetcherTest, DISABLED_Hang) {
+TEST(ProxyScriptFetcherTest, Hang) {
TestServer server(kDocRoot);
SynchFetcher pac_fetcher;