diff options
-rw-r--r-- | chrome/browser/user_style_sheet_watcher_unittest.cc | 11 | ||||
-rw-r--r-- | content/common/file_path_watcher/file_path_watcher_mac.cc | 2 | ||||
-rw-r--r-- | tools/valgrind/memcheck/suppressions.txt | 24 |
3 files changed, 8 insertions, 29 deletions
diff --git a/chrome/browser/user_style_sheet_watcher_unittest.cc b/chrome/browser/user_style_sheet_watcher_unittest.cc index dd4ad8a..59f52aa 100644 --- a/chrome/browser/user_style_sheet_watcher_unittest.cc +++ b/chrome/browser/user_style_sheet_watcher_unittest.cc @@ -25,16 +25,19 @@ TEST(UserStyleSheetWatcherTest, StyleLoad) { ASSERT_TRUE(file_util::WriteFile(style_sheet_file, css_file_contents.data(), css_file_contents.length())); - scoped_refptr<UserStyleSheetWatcher> style_sheet_watcher( - new UserStyleSheetWatcher(dir.path())); - MessageLoop loop(MessageLoop::TYPE_UI); base::Thread io_thread("UserStyleSheetWatcherTestIOThread"); base::Thread::Options options(MessageLoop::TYPE_IO, 0); - io_thread.StartWithOptions(options); + ASSERT_TRUE(io_thread.StartWithOptions(options)); BrowserThread browser_ui_thread(BrowserThread::UI, &loop); BrowserThread browser_file_thread(BrowserThread::FILE, io_thread.message_loop()); + + // It is important that the creation of |style_sheet_watcher| occur after the + // creation of |browser_ui_thread| because UserStyleSheetWatchers are + // restricted to being deleted only on UI browser threads. + scoped_refptr<UserStyleSheetWatcher> style_sheet_watcher( + new UserStyleSheetWatcher(dir.path())); style_sheet_watcher->Init(); io_thread.Stop(); diff --git a/content/common/file_path_watcher/file_path_watcher_mac.cc b/content/common/file_path_watcher/file_path_watcher_mac.cc index 04531a0..eb72b94 100644 --- a/content/common/file_path_watcher/file_path_watcher_mac.cc +++ b/content/common/file_path_watcher/file_path_watcher_mac.cc @@ -474,7 +474,7 @@ void FilePathWatcherImpl::CancelOnMessageLoopThread() { CloseFileDescriptor(&kqueue_); std::for_each(events_.begin(), events_.end(), ReleaseEvent); events_.clear(); - io_message_loop_.release(); + io_message_loop_ = NULL; MessageLoop::current()->RemoveDestructionObserver(this); delegate_ = NULL; } diff --git a/tools/valgrind/memcheck/suppressions.txt b/tools/valgrind/memcheck/suppressions.txt index 148abe3..b4ab3f6 100644 --- a/tools/valgrind/memcheck/suppressions.txt +++ b/tools/valgrind/memcheck/suppressions.txt @@ -4066,22 +4066,6 @@ obj:* } { - bug_76644a - Memcheck:Leak - fun:_Znw* - fun:_ZN40UserStyleSheetWatcherTest_StyleLoad_Test8TestBodyEv - fun:_ZN7testing8internal38HandleSehExceptionsInMethodIfSupportedINS_4TestEvEET0_PT_MS4_FS3_vEPKc - fun:_ZN7testing8internal35HandleExceptionsInMethodIfSupportedINS_4TestEvEET0_PT_MS4_FS3_vEPKc -} -{ - bug_76644b - Memcheck:Leak - fun:_Znw* - fun:_ZN4base16MessageLoopProxy22CreateForCurrentThreadEv - fun:_ZN12_GLOBAL__N_119FilePathWatcherImpl5WatchERK8FilePathPN15FilePathWatcher8DelegateE - fun:_ZN15FilePathWatcher5WatchERK8FilePathPNS_8DelegateE -} -{ bug_76647 Memcheck:Leak fun:_Znw* @@ -4098,14 +4082,6 @@ fun:_ZN11MessageLoop10RunHandlerEv } { - bug_77042 - Memcheck:Leak - fun:_Znw* - fun:_ZN4base16MessageLoopProxy22CreateForCurrentThreadEv - fun:_ZN19ServiceProcessState10InitializeEv - fun:_ZN39ServiceProcessStateFileManipulationTest5SetUpEv -} -{ bug_77049 Memcheck:Cond fun:_ZN7WebCore8Gradient20sortStopsIfNecessaryEv |