summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoradamk@chromium.org <adamk@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-02-14 21:25:01 +0000
committeradamk@chromium.org <adamk@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-02-14 21:25:01 +0000
commitb11f26239fb03ebb19bdbb0b60ae68c75eea82d8 (patch)
tree35b175dde331294401844cdefcda7603335646f7
parent3c7b25d3bd9a15c58a4fc19c71c3434f582faa45 (diff)
downloadchromium_src-b11f26239fb03ebb19bdbb0b60ae68c75eea82d8.zip
chromium_src-b11f26239fb03ebb19bdbb0b60ae68c75eea82d8.tar.gz
chromium_src-b11f26239fb03ebb19bdbb0b60ae68c75eea82d8.tar.bz2
Don't use a separate FILE thread in FileSystemURLRequestJobTest.
Instead, just pass FileUtilProxy a MessageLoopProxy pointing to the current thread. This gets rid of a memory leak under Valgrind, and should make the test less flaky in the long run. BUG=72541 Review URL: http://codereview.chromium.org/6474022 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@74854 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--tools/valgrind/memcheck/suppressions.txt11
-rw-r--r--webkit/fileapi/file_system_url_request_job_unittest.cc12
2 files changed, 2 insertions, 21 deletions
diff --git a/tools/valgrind/memcheck/suppressions.txt b/tools/valgrind/memcheck/suppressions.txt
index cec2ab2..ac37b80 100644
--- a/tools/valgrind/memcheck/suppressions.txt
+++ b/tools/valgrind/memcheck/suppressions.txt
@@ -3697,17 +3697,6 @@
fun:_ZN2v88internal11StackTracer5TraceEPNS0_10TickSampleE
}
{
- bug_72541
- Memcheck:Leak
- fun:_Znw*
- fun:_ZN4base21ScopedCallbackFactoryIN7fileapi23FileSystemURLRequestJobEE11NewCallbackINS_17PlatformFileErrorERKNS_16PlatformFileInfoEEEPN9Callback2IT_T0_E4TypeEMS2_FvSA_SB_E
- fun:_ZN7fileapi23FileSystemURLRequestJob14DidGetRootPathEbRK8FilePathRKSs
- fun:_Z16DispatchToMethodIN7fileapi23FileSystemURLRequestJobEMS1_FvbRK8FilePathRKSsEbS4_S6_EvPT_T0_RK6Tuple3IT1_T2_T3_E
- fun:_ZN4base21ScopedCallbackFactoryIN7fileapi23FileSystemURLRequestJobEE12CallbackImplIMS2_FvbRK8FilePathRKSsE6Tuple3IbS7_S9_EE13RunWithParamsERKSD_
- fun:_ZN14CallbackRunnerI6Tuple3IbRK8FilePathRKSsEE3RunIbS1_SsEEvRKT_RKT0_RKT1_
- fun:_ZN7fileapi21FileSystemPathManager25GetFileSystemRootPathTask16DispatchCallbackERK8FilePath
-}
-{
bug_72544
Memcheck:Leak
fun:malloc
diff --git a/webkit/fileapi/file_system_url_request_job_unittest.cc b/webkit/fileapi/file_system_url_request_job_unittest.cc
index c7db1f9..2cdb6d1c 100644
--- a/webkit/fileapi/file_system_url_request_job_unittest.cc
+++ b/webkit/fileapi/file_system_url_request_job_unittest.cc
@@ -18,11 +18,11 @@
#include "base/file_util.h"
#include "base/format_macros.h"
#include "base/message_loop.h"
+#include "base/message_loop_proxy.h"
#include "base/platform_file.h"
#include "base/scoped_temp_dir.h"
#include "base/string_piece.h"
#include "base/stringprintf.h"
-#include "base/threading/thread.h"
#include "base/utf_string_conversions.h"
#include "net/base/load_flags.h"
#include "net/base/net_errors.h"
@@ -77,11 +77,6 @@ class FileSystemURLRequestJobTest : public testing::Test {
&FileSystemURLRequestJobTest::OnGetRootPath));
MessageLoop::current()->RunAllPending();
- file_thread_.reset(
- new base::Thread("FileSystemURLRequestJobTest FILE Thread"));
- base::Thread::Options options(MessageLoop::TYPE_IO, 0);
- file_thread_->StartWithOptions(options);
-
net::URLRequest::RegisterProtocolFactory("filesystem",
&FileSystemURLRequestJobFactory);
}
@@ -90,8 +85,6 @@ class FileSystemURLRequestJobTest : public testing::Test {
// NOTE: order matters, request must die before delegate
request_.reset(NULL);
delegate_.reset(NULL);
-
- file_thread_.reset(NULL);
net::URLRequest::RegisterProtocolFactory("filesystem", NULL);
}
@@ -115,7 +108,7 @@ class FileSystemURLRequestJobTest : public testing::Test {
if (headers)
request_->SetExtraRequestHeaders(*headers);
job_ = new FileSystemURLRequestJob(request_.get(), path_manager_.get(),
- file_thread_->message_loop_proxy());
+ base::MessageLoopProxy::CreateForCurrentThread());
request_->Start();
ASSERT_TRUE(request_->is_pending()); // verify that we're starting async
@@ -146,7 +139,6 @@ class FileSystemURLRequestJobTest : public testing::Test {
scoped_ptr<net::URLRequest> request_;
scoped_ptr<TestDelegate> delegate_;
scoped_ptr<FileSystemPathManager> path_manager_;
- scoped_ptr<base::Thread> file_thread_;
MessageLoop message_loop_;
base::ScopedCallbackFactory<FileSystemURLRequestJobTest> callback_factory_;