diff options
author | tfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-12 23:23:44 +0000 |
---|---|---|
committer | tfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-12 23:23:44 +0000 |
commit | 092b04eff58cf2d20b6d7e6da0844c8bc5a798fb (patch) | |
tree | 20add3b04716381191280756bb8090ced27d4204 | |
parent | 1dfd7ad41fcfccf7525f52755d798278286dec1e (diff) | |
download | chromium_src-092b04eff58cf2d20b6d7e6da0844c8bc5a798fb.zip chromium_src-092b04eff58cf2d20b6d7e6da0844c8bc5a798fb.tar.gz chromium_src-092b04eff58cf2d20b6d7e6da0844c8bc5a798fb.tar.bz2 |
Rename ChromeThread to BrowserThread Final Part:
- Rename chrome_thread.cc to browser_thread.cc
- Rename chrome_thread_unittest.cc to browser_thread_unittest.cc
- Include browser_thread.h instead of chrome_thread.h where needed.
- Fix gyp files according.
BUG=56926
TEST=trybots and compiled locally
Review URL: http://codereview.chromium.org/3643005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@62356 0039d316-1c4b-4281-b951-d872f2087c98
27 files changed, 315 insertions, 328 deletions
diff --git a/chrome/browser/appcache/chrome_appcache_service.h b/chrome/browser/appcache/chrome_appcache_service.h index 42fff91..aade722 100644 --- a/chrome/browser/appcache/chrome_appcache_service.h +++ b/chrome/browser/appcache/chrome_appcache_service.h @@ -45,7 +45,7 @@ class ChromeAppCacheService static void ClearLocalState(const FilePath& profile_path); private: - friend class ChromeThread; + friend class BrowserThread; friend class DeleteTask<ChromeAppCacheService>; virtual ~ChromeAppCacheService(); diff --git a/chrome/browser/autocomplete/history_quick_provider_unittest.cc b/chrome/browser/autocomplete/history_quick_provider_unittest.cc index 55c8c56..4344a2e 100644 --- a/chrome/browser/autocomplete/history_quick_provider_unittest.cc +++ b/chrome/browser/autocomplete/history_quick_provider_unittest.cc @@ -13,7 +13,7 @@ #include "base/message_loop.h" #include "base/scoped_ptr.h" #include "base/utf_string_conversions.h" -#include "chrome/browser/chrome_thread.h" +#include "chrome/browser/browser_thread.h" #include "chrome/browser/history/history.h" #include "chrome/browser/history/url_database.h" #include "chrome/browser/prefs/pref_service.h" @@ -67,8 +67,8 @@ class HistoryQuickProviderTest : public testing::Test, public ACProviderListener { public: HistoryQuickProviderTest() - : ui_thread_(ChromeThread::UI, &message_loop_), - file_thread_(ChromeThread::FILE, &message_loop_) {} + : ui_thread_(BrowserThread::UI, &message_loop_), + file_thread_(BrowserThread::FILE, &message_loop_) {} // ACProviderListener virtual void OnProviderUpdate(bool updated_matches); @@ -100,8 +100,8 @@ class HistoryQuickProviderTest : public testing::Test, std::string expected_top_result); MessageLoopForUI message_loop_; - ChromeThread ui_thread_; - ChromeThread file_thread_; + BrowserThread ui_thread_; + BrowserThread file_thread_; scoped_ptr<TestingProfile> profile_; HistoryService* history_service_; diff --git a/chrome/browser/browser_main.h b/chrome/browser/browser_main.h index 0648e52..033fb1b 100644 --- a/chrome/browser/browser_main.h +++ b/chrome/browser/browser_main.h @@ -11,7 +11,7 @@ #include "base/scoped_ptr.h" #include "base/tracked_objects.h" -class ChromeThread; +class BrowserThread; class CommandLine; class HighResolutionTimerManager; struct MainFunctionParams; @@ -147,7 +147,7 @@ class BrowserMainParts { scoped_ptr<SystemMonitor> system_monitor_; scoped_ptr<HighResolutionTimerManager> hi_res_timer_manager_; scoped_ptr<net::NetworkChangeNotifier> network_change_notifier_; - scoped_ptr<ChromeThread> main_thread_; + scoped_ptr<BrowserThread> main_thread_; DISALLOW_COPY_AND_ASSIGN(BrowserMainParts); }; diff --git a/chrome/browser/chrome_thread.cc b/chrome/browser/browser_thread.cc index dc3febd..35c1308 100644 --- a/chrome/browser/chrome_thread.cc +++ b/chrome/browser/browser_thread.cc @@ -2,13 +2,13 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chrome/browser/chrome_thread.h" +#include "chrome/browser/browser_thread.h" #include "base/message_loop.h" #include "base/message_loop_proxy.h" // Friendly names for the well-known threads. -static const char* chrome_thread_names[ChromeThread::ID_COUNT] = { +static const char* browser_thread_names[BrowserThread::ID_COUNT] = { "", // UI (name assembled in browser_main.cc). "Chrome_DBThread", // DB "Chrome_WebKitThread", // WEBKIT @@ -22,119 +22,119 @@ static const char* chrome_thread_names[ChromeThread::ID_COUNT] = { }; // An implementation of MessageLoopProxy to be used in conjunction -// with ChromeThread. -class ChromeThreadMessageLoopProxy : public base::MessageLoopProxy { +// with BrowserThread. +class BrowserThreadMessageLoopProxy : public base::MessageLoopProxy { public: - explicit ChromeThreadMessageLoopProxy(ChromeThread::ID identifier) + explicit BrowserThreadMessageLoopProxy(BrowserThread::ID identifier) : id_(identifier) { } // MessageLoopProxy implementation. virtual bool PostTask(const tracked_objects::Location& from_here, Task* task) { - return ChromeThread::PostTask(id_, from_here, task); + return BrowserThread::PostTask(id_, from_here, task); } virtual bool PostDelayedTask(const tracked_objects::Location& from_here, Task* task, int64 delay_ms) { - return ChromeThread::PostDelayedTask(id_, from_here, task, delay_ms); + return BrowserThread::PostDelayedTask(id_, from_here, task, delay_ms); } virtual bool PostNonNestableTask(const tracked_objects::Location& from_here, Task* task) { - return ChromeThread::PostNonNestableTask(id_, from_here, task); + return BrowserThread::PostNonNestableTask(id_, from_here, task); } virtual bool PostNonNestableDelayedTask( const tracked_objects::Location& from_here, Task* task, int64 delay_ms) { - return ChromeThread::PostNonNestableDelayedTask(id_, from_here, task, + return BrowserThread::PostNonNestableDelayedTask(id_, from_here, task, delay_ms); } virtual bool BelongsToCurrentThread() { - return ChromeThread::CurrentlyOn(id_); + return BrowserThread::CurrentlyOn(id_); } private: - ChromeThread::ID id_; - DISALLOW_COPY_AND_ASSIGN(ChromeThreadMessageLoopProxy); + BrowserThread::ID id_; + DISALLOW_COPY_AND_ASSIGN(BrowserThreadMessageLoopProxy); }; -Lock ChromeThread::lock_; +Lock BrowserThread::lock_; -ChromeThread* ChromeThread::chrome_threads_[ID_COUNT]; +BrowserThread* BrowserThread::browser_threads_[ID_COUNT]; -ChromeThread::ChromeThread(ChromeThread::ID identifier) - : Thread(chrome_thread_names[identifier]), +BrowserThread::BrowserThread(BrowserThread::ID identifier) + : Thread(browser_thread_names[identifier]), identifier_(identifier) { Initialize(); } -ChromeThread::ChromeThread(ID identifier, MessageLoop* message_loop) +BrowserThread::BrowserThread(ID identifier, MessageLoop* message_loop) : Thread(message_loop->thread_name().c_str()), identifier_(identifier) { set_message_loop(message_loop); Initialize(); } -void ChromeThread::Initialize() { +void BrowserThread::Initialize() { AutoLock lock(lock_); DCHECK(identifier_ >= 0 && identifier_ < ID_COUNT); - DCHECK(chrome_threads_[identifier_] == NULL); - chrome_threads_[identifier_] = this; + DCHECK(browser_threads_[identifier_] == NULL); + browser_threads_[identifier_] = this; } -ChromeThread::~ChromeThread() { +BrowserThread::~BrowserThread() { // Stop the thread here, instead of the parent's class destructor. This is so // that if there are pending tasks that run, code that checks that it's on the - // correct ChromeThread succeeds. + // correct BrowserThread succeeds. Stop(); AutoLock lock(lock_); - chrome_threads_[identifier_] = NULL; + browser_threads_[identifier_] = NULL; #ifndef NDEBUG // Double check that the threads are ordererd correctly in the enumeration. for (int i = identifier_ + 1; i < ID_COUNT; ++i) { - DCHECK(!chrome_threads_[i]) << + DCHECK(!browser_threads_[i]) << "Threads must be listed in the reverse order that they die"; } #endif } // static -bool ChromeThread::IsWellKnownThread(ID identifier) { +bool BrowserThread::IsWellKnownThread(ID identifier) { AutoLock lock(lock_); return (identifier >= 0 && identifier < ID_COUNT && - chrome_threads_[identifier]); + browser_threads_[identifier]); } // static -bool ChromeThread::CurrentlyOn(ID identifier) { +bool BrowserThread::CurrentlyOn(ID identifier) { AutoLock lock(lock_); DCHECK(identifier >= 0 && identifier < ID_COUNT); - return chrome_threads_[identifier] && - chrome_threads_[identifier]->message_loop() == MessageLoop::current(); + return browser_threads_[identifier] && + browser_threads_[identifier]->message_loop() == MessageLoop::current(); } // static -bool ChromeThread::IsMessageLoopValid(ID identifier) { +bool BrowserThread::IsMessageLoopValid(ID identifier) { AutoLock lock(lock_); DCHECK(identifier >= 0 && identifier < ID_COUNT); - return chrome_threads_[identifier] && - chrome_threads_[identifier]->message_loop(); + return browser_threads_[identifier] && + browser_threads_[identifier]->message_loop(); } // static -bool ChromeThread::PostTask(ID identifier, +bool BrowserThread::PostTask(ID identifier, const tracked_objects::Location& from_here, Task* task) { return PostTaskHelper(identifier, from_here, task, 0, true); } // static -bool ChromeThread::PostDelayedTask(ID identifier, +bool BrowserThread::PostDelayedTask(ID identifier, const tracked_objects::Location& from_here, Task* task, int64 delay_ms) { @@ -142,7 +142,7 @@ bool ChromeThread::PostDelayedTask(ID identifier, } // static -bool ChromeThread::PostNonNestableTask( +bool BrowserThread::PostNonNestableTask( ID identifier, const tracked_objects::Location& from_here, Task* task) { @@ -150,7 +150,7 @@ bool ChromeThread::PostNonNestableTask( } // static -bool ChromeThread::PostNonNestableDelayedTask( +bool BrowserThread::PostNonNestableDelayedTask( ID identifier, const tracked_objects::Location& from_here, Task* task, @@ -159,12 +159,12 @@ bool ChromeThread::PostNonNestableDelayedTask( } // static -bool ChromeThread::GetCurrentThreadIdentifier(ID* identifier) { +bool BrowserThread::GetCurrentThreadIdentifier(ID* identifier) { MessageLoop* cur_message_loop = MessageLoop::current(); for (int i = 0; i < ID_COUNT; ++i) { - if (chrome_threads_[i] && - chrome_threads_[i]->message_loop() == cur_message_loop) { - *identifier = chrome_threads_[i]->identifier_; + if (browser_threads_[i] && + browser_threads_[i]->message_loop() == cur_message_loop) { + *identifier = browser_threads_[i]->identifier_; return true; } } @@ -174,15 +174,15 @@ bool ChromeThread::GetCurrentThreadIdentifier(ID* identifier) { // static scoped_refptr<base::MessageLoopProxy> -ChromeThread::GetMessageLoopProxyForThread( +BrowserThread::GetMessageLoopProxyForThread( ID identifier) { scoped_refptr<base::MessageLoopProxy> proxy = - new ChromeThreadMessageLoopProxy(identifier); + new BrowserThreadMessageLoopProxy(identifier); return proxy; } // static -bool ChromeThread::PostTaskHelper( +bool BrowserThread::PostTaskHelper( ID identifier, const tracked_objects::Location& from_here, Task* task, @@ -203,8 +203,8 @@ bool ChromeThread::PostTaskHelper( if (!guaranteed_to_outlive_target_thread) lock_.Acquire(); - MessageLoop* message_loop = chrome_threads_[identifier] ? - chrome_threads_[identifier]->message_loop() : NULL; + MessageLoop* message_loop = browser_threads_[identifier] ? + browser_threads_[identifier]->message_loop() : NULL; if (message_loop) { if (nestable) { message_loop->PostDelayedTask(from_here, task, delay_ms); diff --git a/chrome/browser/browser_thread.h b/chrome/browser/browser_thread.h index fdaf997..c034851 100644 --- a/chrome/browser/browser_thread.h +++ b/chrome/browser/browser_thread.h @@ -4,7 +4,206 @@ #ifndef CHROME_BROWSER_BROWSER_THREAD_H_ #define CHROME_BROWSER_BROWSER_THREAD_H_ +#pragma once -#include "chrome/browser/chrome_thread.h" +#include "base/lock.h" +#include "base/task.h" +#include "base/thread.h" + +namespace base { +class MessageLoopProxy; +} + +/////////////////////////////////////////////////////////////////////////////// +// BrowserThread +// +// This class represents a thread that is known by a browser-wide name. For +// example, there is one IO thread for the entire browser process, and various +// pieces of code find it useful to retrieve a pointer to the IO thread's +// Invoke a task by thread ID: +// +// BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, task); +// +// The return value is false if the task couldn't be posted because the target +// thread doesn't exist. If this could lead to data loss, you need to check the +// result and restructure the code to ensure it doesn't occur. +// +// This class automatically handles the lifetime of different threads. +// It's always safe to call PostTask on any thread. If it's not yet created, +// the task is deleted. There are no race conditions. If the thread that the +// task is posted to is guaranteed to outlive the current thread, then no locks +// are used. You should never need to cache pointers to MessageLoops, since +// they're not thread safe. +class BrowserThread : public base::Thread { + public: + // An enumeration of the well-known threads. + // NOTE: threads must be listed in the order of their life-time, with each + // thread outliving every other thread below it. + enum ID { + // The main thread in the browser. + UI, + + // This is the thread that interacts with the database. + DB, + + // This is the "main" thread for WebKit within the browser process when + // NOT in --single-process mode. + WEBKIT, + + // This is the thread that interacts with the file system. + FILE, + + // Used to launch and terminate processes. + PROCESS_LAUNCHER, + + // This is the thread to handle slow HTTP cache operations. + CACHE, + + // This is the thread that processes IPC and network messages. + IO, + +#if defined(USE_X11) + // This thread has a second connection to the X server and is used to + // process UI requests when routing the request to the UI thread would risk + // deadlock. + BACKGROUND_X11, +#endif + + // This identifier does not represent a thread. Instead it counts the + // number of well-known threads. Insert new well-known threads before this + // identifier. + ID_COUNT + }; + + // Construct a BrowserThread with the supplied identifier. It is an error + // to construct a BrowserThread that already exists. + explicit BrowserThread(ID identifier); + + // Special constructor for the main (UI) thread and unittests. We use a dummy + // thread here since the main thread already exists. + BrowserThread(ID identifier, MessageLoop* message_loop); + + virtual ~BrowserThread(); + + // These are the same methods in message_loop.h, but are guaranteed to either + // get posted to the MessageLoop if it's still alive, or be deleted otherwise. + // They return true iff the thread existed and the task was posted. Note that + // even if the task is posted, there's no guarantee that it will run, since + // the target thread may already have a Quit message in its queue. + static bool PostTask(ID identifier, + const tracked_objects::Location& from_here, + Task* task); + static bool PostDelayedTask(ID identifier, + const tracked_objects::Location& from_here, + Task* task, + int64 delay_ms); + static bool PostNonNestableTask(ID identifier, + const tracked_objects::Location& from_here, + Task* task); + static bool PostNonNestableDelayedTask( + ID identifier, + const tracked_objects::Location& from_here, + Task* task, + int64 delay_ms); + + template <class T> + static bool DeleteSoon(ID identifier, + const tracked_objects::Location& from_here, + T* object) { + return PostNonNestableTask( + identifier, from_here, new DeleteTask<T>(object)); + } + + template <class T> + static bool ReleaseSoon(ID identifier, + const tracked_objects::Location& from_here, + T* object) { + return PostNonNestableTask( + identifier, from_here, new ReleaseTask<T>(object)); + } + + // Callable on any thread. Returns whether the given ID corresponds to a well + // known thread. + static bool IsWellKnownThread(ID identifier); + + // Callable on any thread. Returns whether you're currently on a particular + // thread. + static bool CurrentlyOn(ID identifier); + + // Callable on any thread. Returns whether the threads message loop is valid. + // If this returns false it means the thread is in the process of shutting + // down. + static bool IsMessageLoopValid(ID identifier); + + // If the current message loop is one of the known threads, returns true and + // sets identifier to its ID. Otherwise returns false. + static bool GetCurrentThreadIdentifier(ID* identifier); + + // Callers can hold on to a refcounted MessageLoopProxy beyond the lifetime + // of the thread. + static scoped_refptr<base::MessageLoopProxy> GetMessageLoopProxyForThread( + ID identifier); + + // Use these templates in conjuction with RefCountedThreadSafe when you want + // to ensure that an object is deleted on a specific thread. This is needed + // when an object can hop between threads (i.e. IO -> FILE -> IO), and thread + // switching delays can mean that the final IO tasks executes before the FILE + // task's stack unwinds. This would lead to the object destructing on the + // FILE thread, which often is not what you want (i.e. to unregister from + // NotificationService, to notify other objects on the creating thread etc). + template<ID thread> + struct DeleteOnThread { + template<typename T> + static void Destruct(T* x) { + if (CurrentlyOn(thread)) { + delete x; + } else { + DeleteSoon(thread, FROM_HERE, x); + } + } + }; + + // Sample usage: + // class Foo + // : public base::RefCountedThreadSafe< + // Foo, BrowserThread::DeleteOnIOThread> { + // + // ... + // private: + // friend struct BrowserThread::DeleteOnThread<BrowserThread::IO>; + // friend class DeleteTask<Foo>; + // + // ~Foo(); + struct DeleteOnUIThread : public DeleteOnThread<UI> { }; + struct DeleteOnIOThread : public DeleteOnThread<IO> { }; + struct DeleteOnFileThread : public DeleteOnThread<FILE> { }; + struct DeleteOnDBThread : public DeleteOnThread<DB> { }; + struct DeleteOnWebKitThread : public DeleteOnThread<WEBKIT> { }; + + private: + // Common initialization code for the constructors. + void Initialize(); + + static bool PostTaskHelper( + ID identifier, + const tracked_objects::Location& from_here, + Task* task, + int64 delay_ms, + bool nestable); + + // The identifier of this thread. Only one thread can exist with a given + // identifier at a given time. + ID identifier_; + + // This lock protects |browser_threads_|. Do not read or modify that array + // without holding this lock. Do not block while holding this lock. + static Lock lock_; + + // An array of the BrowserThread objects. This array is protected by |lock_|. + // The threads are not owned by this array. Typically, the threads are owned + // on the UI thread by the g_browser_process object. BrowserThreads remove + // themselves from this array upon destruction. + static BrowserThread* browser_threads_[ID_COUNT]; +}; #endif // CHROME_BROWSER_BROWSER_THREAD_H_ diff --git a/chrome/browser/chrome_thread_unittest.cc b/chrome/browser/browser_thread_unittest.cc index 5408af4..d2c19d8 100644 --- a/chrome/browser/chrome_thread_unittest.cc +++ b/chrome/browser/browser_thread_unittest.cc @@ -9,17 +9,17 @@ #include "testing/gtest/include/gtest/gtest.h" #include "testing/platform_test.h" -class ChromeThreadTest : public testing::Test { +class BrowserThreadTest : public testing::Test { public: void Release() { - CHECK(ChromeThread::CurrentlyOn(ChromeThread::UI)); + CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); loop_.PostTask(FROM_HERE, new MessageLoop::QuitTask); } protected: virtual void SetUp() { - ui_thread_.reset(new ChromeThread(ChromeThread::UI)); - file_thread_.reset(new ChromeThread(ChromeThread::FILE)); + ui_thread_.reset(new BrowserThread(BrowserThread::UI)); + file_thread_.reset(new BrowserThread(BrowserThread::FILE)); ui_thread_->Start(); file_thread_->Start(); } @@ -30,7 +30,7 @@ class ChromeThreadTest : public testing::Test { } static void BasicFunction(MessageLoop* message_loop) { - CHECK(ChromeThread::CurrentlyOn(ChromeThread::FILE)); + CHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); message_loop->PostTask(FROM_HERE, new MessageLoop::QuitTask); } @@ -51,13 +51,13 @@ class ChromeThreadTest : public testing::Test { class DeletedOnFile : public base::RefCountedThreadSafe< - DeletedOnFile, ChromeThread::DeleteOnFileThread> { + DeletedOnFile, BrowserThread::DeleteOnFileThread> { public: explicit DeletedOnFile(MessageLoop* message_loop) : message_loop_(message_loop) { } ~DeletedOnFile() { - CHECK(ChromeThread::CurrentlyOn(ChromeThread::FILE)); + CHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); message_loop_->PostTask(FROM_HERE, new MessageLoop::QuitTask()); } @@ -67,7 +67,7 @@ class ChromeThreadTest : public testing::Test { class NeverDeleted : public base::RefCountedThreadSafe< - NeverDeleted, ChromeThread::DeleteOnWebKitThread> { + NeverDeleted, BrowserThread::DeleteOnWebKitThread> { public: ~NeverDeleted() { CHECK(false); @@ -75,32 +75,32 @@ class ChromeThreadTest : public testing::Test { }; private: - scoped_ptr<ChromeThread> ui_thread_; - scoped_ptr<ChromeThread> file_thread_; + scoped_ptr<BrowserThread> ui_thread_; + scoped_ptr<BrowserThread> file_thread_; MessageLoop loop_; }; -TEST_F(ChromeThreadTest, PostTask) { - ChromeThread::PostTask( - ChromeThread::FILE, FROM_HERE, +TEST_F(BrowserThreadTest, PostTask) { + BrowserThread::PostTask( + BrowserThread::FILE, FROM_HERE, NewRunnableFunction(&BasicFunction, MessageLoop::current())); MessageLoop::current()->Run(); } -TEST_F(ChromeThreadTest, Release) { - ChromeThread::ReleaseSoon(ChromeThread::UI, FROM_HERE, this); +TEST_F(BrowserThreadTest, Release) { + BrowserThread::ReleaseSoon(BrowserThread::UI, FROM_HERE, this); MessageLoop::current()->Run(); } -TEST_F(ChromeThreadTest, TaskToNonExistentThreadIsDeleted) { +TEST_F(BrowserThreadTest, TaskToNonExistentThreadIsDeleted) { bool deleted = false; - ChromeThread::PostTask( - ChromeThread::WEBKIT, FROM_HERE, + BrowserThread::PostTask( + BrowserThread::WEBKIT, FROM_HERE, new DummyTask(&deleted)); EXPECT_TRUE(deleted); } -TEST_F(ChromeThreadTest, ReleasedOnCorrectThread) { +TEST_F(BrowserThreadTest, ReleasedOnCorrectThread) { { scoped_refptr<DeletedOnFile> test( new DeletedOnFile(MessageLoop::current())); @@ -108,55 +108,55 @@ TEST_F(ChromeThreadTest, ReleasedOnCorrectThread) { MessageLoop::current()->Run(); } -TEST_F(ChromeThreadTest, NotReleasedIfTargetThreadNonExistent) { +TEST_F(BrowserThreadTest, NotReleasedIfTargetThreadNonExistent) { scoped_refptr<NeverDeleted> test(new NeverDeleted()); } -TEST_F(ChromeThreadTest, PostTaskViaMessageLoopProxy) { +TEST_F(BrowserThreadTest, PostTaskViaMessageLoopProxy) { scoped_refptr<base::MessageLoopProxy> message_loop_proxy = - ChromeThread::GetMessageLoopProxyForThread(ChromeThread::FILE); + BrowserThread::GetMessageLoopProxyForThread(BrowserThread::FILE); message_loop_proxy->PostTask(FROM_HERE, NewRunnableFunction(&BasicFunction, MessageLoop::current())); MessageLoop::current()->Run(); } -TEST_F(ChromeThreadTest, ReleaseViaMessageLoopProxy) { +TEST_F(BrowserThreadTest, ReleaseViaMessageLoopProxy) { scoped_refptr<base::MessageLoopProxy> message_loop_proxy = - ChromeThread::GetMessageLoopProxyForThread(ChromeThread::UI); + BrowserThread::GetMessageLoopProxyForThread(BrowserThread::UI); message_loop_proxy->ReleaseSoon(FROM_HERE, this); MessageLoop::current()->Run(); } -TEST_F(ChromeThreadTest, TaskToNonExistentThreadIsDeletedViaMessageLoopProxy) { +TEST_F(BrowserThreadTest, TaskToNonExistentThreadIsDeletedViaMessageLoopProxy) { bool deleted = false; scoped_refptr<base::MessageLoopProxy> message_loop_proxy = - ChromeThread::GetMessageLoopProxyForThread(ChromeThread::WEBKIT); + BrowserThread::GetMessageLoopProxyForThread(BrowserThread::WEBKIT); message_loop_proxy->PostTask(FROM_HERE, new DummyTask(&deleted)); EXPECT_TRUE(deleted); } -TEST_F(ChromeThreadTest, PostTaskViaMessageLoopProxyAfterThreadExits) { - scoped_ptr<ChromeThread> io_thread(new ChromeThread(ChromeThread::IO)); +TEST_F(BrowserThreadTest, PostTaskViaMessageLoopProxyAfterThreadExits) { + scoped_ptr<BrowserThread> io_thread(new BrowserThread(BrowserThread::IO)); io_thread->Start(); io_thread->Stop(); bool deleted = false; scoped_refptr<base::MessageLoopProxy> message_loop_proxy = - ChromeThread::GetMessageLoopProxyForThread(ChromeThread::IO); + BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO); bool ret = message_loop_proxy->PostTask(FROM_HERE, new DummyTask(&deleted)); EXPECT_FALSE(ret); EXPECT_TRUE(deleted); } -TEST_F(ChromeThreadTest, PostTaskViaMessageLoopProxyAfterThreadIsDeleted) { +TEST_F(BrowserThreadTest, PostTaskViaMessageLoopProxyAfterThreadIsDeleted) { { - scoped_ptr<ChromeThread> io_thread(new ChromeThread(ChromeThread::IO)); + scoped_ptr<BrowserThread> io_thread(new BrowserThread(BrowserThread::IO)); io_thread->Start(); } bool deleted = false; scoped_refptr<base::MessageLoopProxy> message_loop_proxy = - ChromeThread::GetMessageLoopProxyForThread(ChromeThread::IO); + BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO); bool ret = message_loop_proxy->PostTask(FROM_HERE, new DummyTask(&deleted)); EXPECT_FALSE(ret); EXPECT_TRUE(deleted); diff --git a/chrome/browser/chrome_blob_storage_context.h b/chrome/browser/chrome_blob_storage_context.h index 9006a2f..5bd8a10 100644 --- a/chrome/browser/chrome_blob_storage_context.h +++ b/chrome/browser/chrome_blob_storage_context.h @@ -35,7 +35,7 @@ class ChromeBlobStorageContext } private: - friend class ChromeThread; + friend class BrowserThread; friend class DeleteTask<ChromeBlobStorageContext>; virtual ~ChromeBlobStorageContext(); diff --git a/chrome/browser/chrome_thread.h b/chrome/browser/chrome_thread.h deleted file mode 100644 index 475d9f7..0000000 --- a/chrome/browser/chrome_thread.h +++ /dev/null @@ -1,211 +0,0 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef CHROME_BROWSER_CHROME_THREAD_H_ -#define CHROME_BROWSER_CHROME_THREAD_H_ -#pragma once - -#include "base/lock.h" -#include "base/task.h" -#include "base/thread.h" - -namespace base { -class MessageLoopProxy; -} - -/////////////////////////////////////////////////////////////////////////////// -// ChromeThread -// -// This class represents a thread that is known by a browser-wide name. For -// example, there is one IO thread for the entire browser process, and various -// pieces of code find it useful to retrieve a pointer to the IO thread's -// Invoke a task by thread ID: -// -// ChromeThread::PostTask(ChromeThread::IO, FROM_HERE, task); -// -// The return value is false if the task couldn't be posted because the target -// thread doesn't exist. If this could lead to data loss, you need to check the -// result and restructure the code to ensure it doesn't occur. -// -// This class automatically handles the lifetime of different threads. -// It's always safe to call PostTask on any thread. If it's not yet created, -// the task is deleted. There are no race conditions. If the thread that the -// task is posted to is guaranteed to outlive the current thread, then no locks -// are used. You should never need to cache pointers to MessageLoops, since -// they're not thread safe. -class ChromeThread : public base::Thread { - public: - // An enumeration of the well-known threads. - // NOTE: threads must be listed in the order of their life-time, with each - // thread outliving every other thread below it. - enum ID { - // The main thread in the browser. - UI, - - // This is the thread that interacts with the database. - DB, - - // This is the "main" thread for WebKit within the browser process when - // NOT in --single-process mode. - WEBKIT, - - // This is the thread that interacts with the file system. - FILE, - - // Used to launch and terminate processes. - PROCESS_LAUNCHER, - - // This is the thread to handle slow HTTP cache operations. - CACHE, - - // This is the thread that processes IPC and network messages. - IO, - -#if defined(USE_X11) - // This thread has a second connection to the X server and is used to - // process UI requests when routing the request to the UI thread would risk - // deadlock. - BACKGROUND_X11, -#endif - - // This identifier does not represent a thread. Instead it counts the - // number of well-known threads. Insert new well-known threads before this - // identifier. - ID_COUNT - }; - - // Construct a ChromeThread with the supplied identifier. It is an error - // to construct a ChromeThread that already exists. - explicit ChromeThread(ID identifier); - - // Special constructor for the main (UI) thread and unittests. We use a dummy - // thread here since the main thread already exists. - ChromeThread(ID identifier, MessageLoop* message_loop); - - virtual ~ChromeThread(); - - // These are the same methods in message_loop.h, but are guaranteed to either - // get posted to the MessageLoop if it's still alive, or be deleted otherwise. - // They return true iff the thread existed and the task was posted. Note that - // even if the task is posted, there's no guarantee that it will run, since - // the target thread may already have a Quit message in its queue. - static bool PostTask(ID identifier, - const tracked_objects::Location& from_here, - Task* task); - static bool PostDelayedTask(ID identifier, - const tracked_objects::Location& from_here, - Task* task, - int64 delay_ms); - static bool PostNonNestableTask(ID identifier, - const tracked_objects::Location& from_here, - Task* task); - static bool PostNonNestableDelayedTask( - ID identifier, - const tracked_objects::Location& from_here, - Task* task, - int64 delay_ms); - - template <class T> - static bool DeleteSoon(ID identifier, - const tracked_objects::Location& from_here, - T* object) { - return PostNonNestableTask( - identifier, from_here, new DeleteTask<T>(object)); - } - - template <class T> - static bool ReleaseSoon(ID identifier, - const tracked_objects::Location& from_here, - T* object) { - return PostNonNestableTask( - identifier, from_here, new ReleaseTask<T>(object)); - } - - // Callable on any thread. Returns whether the given ID corresponds to a well - // known thread. - static bool IsWellKnownThread(ID identifier); - - // Callable on any thread. Returns whether you're currently on a particular - // thread. - static bool CurrentlyOn(ID identifier); - - // Callable on any thread. Returns whether the threads message loop is valid. - // If this returns false it means the thread is in the process of shutting - // down. - static bool IsMessageLoopValid(ID identifier); - - // If the current message loop is one of the known threads, returns true and - // sets identifier to its ID. Otherwise returns false. - static bool GetCurrentThreadIdentifier(ID* identifier); - - // Callers can hold on to a refcounted MessageLoopProxy beyond the lifetime - // of the thread. - static scoped_refptr<base::MessageLoopProxy> GetMessageLoopProxyForThread( - ID identifier); - - // Use these templates in conjuction with RefCountedThreadSafe when you want - // to ensure that an object is deleted on a specific thread. This is needed - // when an object can hop between threads (i.e. IO -> FILE -> IO), and thread - // switching delays can mean that the final IO tasks executes before the FILE - // task's stack unwinds. This would lead to the object destructing on the - // FILE thread, which often is not what you want (i.e. to unregister from - // NotificationService, to notify other objects on the creating thread etc). - template<ID thread> - struct DeleteOnThread { - template<typename T> - static void Destruct(T* x) { - if (CurrentlyOn(thread)) { - delete x; - } else { - DeleteSoon(thread, FROM_HERE, x); - } - } - }; - - // Sample usage: - // class Foo - // : public base::RefCountedThreadSafe< - // Foo, ChromeThread::DeleteOnIOThread> { - // - // ... - // private: - // friend struct ChromeThread::DeleteOnThread<ChromeThread::IO>; - // friend class DeleteTask<Foo>; - // - // ~Foo(); - struct DeleteOnUIThread : public DeleteOnThread<UI> { }; - struct DeleteOnIOThread : public DeleteOnThread<IO> { }; - struct DeleteOnFileThread : public DeleteOnThread<FILE> { }; - struct DeleteOnDBThread : public DeleteOnThread<DB> { }; - struct DeleteOnWebKitThread : public DeleteOnThread<WEBKIT> { }; - - private: - // Common initialization code for the constructors. - void Initialize(); - - static bool PostTaskHelper( - ID identifier, - const tracked_objects::Location& from_here, - Task* task, - int64 delay_ms, - bool nestable); - - // The identifier of this thread. Only one thread can exist with a given - // identifier at a given time. - ID identifier_; - - // This lock protects |chrome_threads_|. Do not read or modify that array - // without holding this lock. Do not block while holding this lock. - static Lock lock_; - - // An array of the ChromeThread objects. This array is protected by |lock_|. - // The threads are not owned by this array. Typically, the threads are owned - // on the UI thread by the g_browser_process object. ChromeThreads remove - // themselves from this array upon destruction. - static ChromeThread* chrome_threads_[ID_COUNT]; -}; - -typedef ChromeThread BrowserThread; - -#endif // CHROME_BROWSER_CHROME_THREAD_H_ diff --git a/chrome/browser/download/download_manager.h b/chrome/browser/download/download_manager.h index 5a0f843..56acb00 100644 --- a/chrome/browser/download/download_manager.h +++ b/chrome/browser/download/download_manager.h @@ -225,7 +225,7 @@ class DownloadManager DownloadManager* observed_download_manager_; }; - friend class ChromeThread; + friend class BrowserThread; friend class DeleteTask<DownloadManager>; friend class OtherDownloadManagerObserver; diff --git a/chrome/browser/extensions/extensions_service.h b/chrome/browser/extensions/extensions_service.h index 7085509..228dd48 100644 --- a/chrome/browser/extensions/extensions_service.h +++ b/chrome/browser/extensions/extensions_service.h @@ -404,7 +404,7 @@ class ExtensionsService private: virtual ~ExtensionsService(); - friend class ChromeThread; + friend class BrowserThread; friend class DeleteTask<ExtensionsService>; // Clear all persistent data that may have been stored by the extension. diff --git a/chrome/browser/gtk/create_application_shortcuts_dialog_gtk.h b/chrome/browser/gtk/create_application_shortcuts_dialog_gtk.h index 403c535..054a0bd 100644 --- a/chrome/browser/gtk/create_application_shortcuts_dialog_gtk.h +++ b/chrome/browser/gtk/create_application_shortcuts_dialog_gtk.h @@ -27,7 +27,7 @@ class CreateApplicationShortcutsDialogGtk static void Show(GtkWindow* parent, TabContents* tab_contents); private: - friend class ChromeThread; + friend class BrowserThread; friend class DeleteTask<CreateApplicationShortcutsDialogGtk>; CreateApplicationShortcutsDialogGtk(GtkWindow* parent, diff --git a/chrome/browser/net/chrome_url_request_context.cc b/chrome/browser/net/chrome_url_request_context.cc index e0a0ee5..e1aa4ae 100644 --- a/chrome/browser/net/chrome_url_request_context.cc +++ b/chrome/browser/net/chrome_url_request_context.cc @@ -189,7 +189,7 @@ class ChromeCookieMonsterDelegate : public net::CookieMonster::Delegate { } private: - friend class ::ChromeThread; + friend class ::BrowserThread; friend class DeleteTask<ProfileGetter>; virtual ~ProfileGetter() {} diff --git a/chrome/browser/plugin_updater.cc b/chrome/browser/plugin_updater.cc index bf465ed..e969da6 100644 --- a/chrome/browser/plugin_updater.cc +++ b/chrome/browser/plugin_updater.cc @@ -218,8 +218,8 @@ void PluginUpdater::DisablePluginGroupsFromPrefs(Profile* profile) { } void PluginUpdater::UpdatePreferences(Profile* profile) { - ChromeThread::PostTask( - ChromeThread::FILE, + BrowserThread::PostTask( + BrowserThread::FILE, FROM_HERE, NewRunnableFunction( &PluginUpdater::GetPreferencesDataOnFileThread, profile)); @@ -232,8 +232,8 @@ void PluginUpdater::GetPreferencesDataOnFileThread(void* profile) { NPAPI::PluginList::PluginMap groups; NPAPI::PluginList::Singleton()->GetPluginGroups(false, &groups); - ChromeThread::PostTask( - ChromeThread::UI, + BrowserThread::PostTask( + BrowserThread::UI, FROM_HERE, NewRunnableFunction( &PluginUpdater::OnUpdatePreferences, diff --git a/chrome/browser/renderer_host/audio_renderer_host.h b/chrome/browser/renderer_host/audio_renderer_host.h index c3a0254..8ec3cd1 100644 --- a/chrome/browser/renderer_host/audio_renderer_host.h +++ b/chrome/browser/renderer_host/audio_renderer_host.h @@ -148,7 +148,7 @@ class AudioRendererHost : public base::RefCountedThreadSafe< private: friend class AudioRendererHostTest; - friend class ChromeThread; + friend class BrowserThread; friend class DeleteTask<AudioRendererHost>; friend class MockAudioRendererHost; FRIEND_TEST_ALL_PREFIXES(AudioRendererHostTest, CreateMockStream); diff --git a/chrome/browser/renderer_host/resource_handler.h b/chrome/browser/renderer_host/resource_handler.h index 819eb1b..56f70bd 100644 --- a/chrome/browser/renderer_host/resource_handler.h +++ b/chrome/browser/renderer_host/resource_handler.h @@ -87,7 +87,7 @@ class ResourceHandler virtual void OnDataDownloaded(int request_id, int bytes_downloaded) {} protected: - friend class ChromeThread; + friend class BrowserThread; friend class DeleteTask<ResourceHandler>; virtual ~ResourceHandler() {} diff --git a/chrome/browser/renderer_host/resource_message_filter.h b/chrome/browser/renderer_host/resource_message_filter.h index b4382ff..52db66c 100644 --- a/chrome/browser/renderer_host/resource_message_filter.h +++ b/chrome/browser/renderer_host/resource_message_filter.h @@ -128,7 +128,7 @@ class ResourceMessageFilter : public IPC::ChannelProxy::MessageFilter, ChromeURLRequestContext* GetRequestContextForURL(const GURL& url); private: - friend class ChromeThread; + friend class BrowserThread; friend class DeleteTask<ResourceMessageFilter>; typedef void (*FileInfoWriteFunc)(IPC::Message* reply_msg, const base::PlatformFileInfo& file_info); diff --git a/chrome/browser/spellcheck_host.h b/chrome/browser/spellcheck_host.h index 901ebb9..aad254a 100644 --- a/chrome/browser/spellcheck_host.h +++ b/chrome/browser/spellcheck_host.h @@ -57,7 +57,7 @@ class SpellCheckHost : public base::RefCountedThreadSafe<SpellCheckHost, private: // These two classes can destruct us. - friend class ChromeThread; + friend class BrowserThread; friend class DeleteTask<SpellCheckHost>; virtual ~SpellCheckHost(); diff --git a/chrome/browser/ssl/ssl_client_auth_handler.h b/chrome/browser/ssl/ssl_client_auth_handler.h index ae9458e..c93a55a 100644 --- a/chrome/browser/ssl/ssl_client_auth_handler.h +++ b/chrome/browser/ssl/ssl_client_auth_handler.h @@ -45,7 +45,7 @@ class SSLClientAuthHandler net::SSLCertRequestInfo* cert_request_info() { return cert_request_info_; } private: - friend class ChromeThread; + friend class BrowserThread; friend class DeleteTask<SSLClientAuthHandler>; virtual ~SSLClientAuthHandler(); diff --git a/chrome/browser/sync/glue/data_type_controller.h b/chrome/browser/sync/glue/data_type_controller.h index a483718..62da8ed 100644 --- a/chrome/browser/sync/glue/data_type_controller.h +++ b/chrome/browser/sync/glue/data_type_controller.h @@ -95,7 +95,7 @@ class DataTypeController protected: friend class base::RefCountedThreadSafe<DataTypeController>; - friend class ChromeThread; + friend class BrowserThread; friend class DeleteTask<DataTypeController>; friend class ShutdownTask; }; diff --git a/chrome/browser/webdata/web_data_service.h b/chrome/browser/webdata/web_data_service.h index 37d1a39..b3cf46b 100644 --- a/chrome/browser/webdata/web_data_service.h +++ b/chrome/browser/webdata/web_data_service.h @@ -494,7 +494,7 @@ class WebDataService ////////////////////////////////////////////////////////////////////////////// private: friend class base::RefCountedThreadSafe<WebDataService>; - friend class ChromeThread; + friend class BrowserThread; friend class DeleteTask<WebDataService>; friend class ShutdownTask; diff --git a/chrome/chrome_browser.gypi b/chrome/chrome_browser.gypi index c40d339..498ea1d9 100644 --- a/chrome/chrome_browser.gypi +++ b/chrome/chrome_browser.gypi @@ -320,9 +320,10 @@ 'browser/browser_process_sub_thread.h', 'browser/browser_shutdown.cc', 'browser/browser_shutdown.h', + 'browser/browser_thread.cc', + 'browser/browser_thread.h', 'browser/browser_trial.cc', 'browser/browser_trial.h', - 'browser/browser_thread.h', 'browser/browser_url_handler.cc', 'browser/browser_url_handler.h', 'browser/browser_window.h', @@ -370,8 +371,6 @@ 'browser/chrome_plugin_browsing_context.h', 'browser/chrome_plugin_host.cc', 'browser/chrome_plugin_host.h', - 'browser/chrome_thread.cc', - 'browser/chrome_thread.h', 'browser/chromeos/notifications/balloon_collection_impl.cc', 'browser/chromeos/notifications/balloon_collection_impl.h', 'browser/chromeos/notifications/balloon_view.cc', diff --git a/chrome/chrome_tests.gypi b/chrome/chrome_tests.gypi index 8824326..63c479a 100644 --- a/chrome/chrome_tests.gypi +++ b/chrome/chrome_tests.gypi @@ -1027,8 +1027,7 @@ 'browser/bookmarks/bookmark_utils_unittest.cc', 'browser/browser_about_handler_unittest.cc', 'browser/browser_commands_unittest.cc', - 'browser/themes/browser_theme_pack_unittest.cc', - 'browser/themes/browser_theme_provider_unittest.cc', + 'browser/browser_thread_unittest.cc', 'browser/browsing_data_appcache_helper_unittest.cc', 'browser/browsing_data_database_helper_unittest.cc', 'browser/browsing_data_indexed_db_helper_unittest.cc', @@ -1036,7 +1035,6 @@ 'browser/child_process_security_policy_unittest.cc', 'browser/chrome_browser_application_mac_unittest.mm', 'browser/chrome_plugin_unittest.cc', - 'browser/chrome_thread_unittest.cc', 'browser/chromeos/customization_document_unittest.cc', 'browser/chromeos/dom_ui/language_options_handler_unittest.cc', 'browser/chromeos/external_cookie_handler_unittest.cc', @@ -1484,6 +1482,8 @@ 'browser/tabs/pinned_tab_codec_unittest.cc', 'browser/tabs/tab_strip_model_unittest.cc', 'browser/task_manager/task_manager_unittest.cc', + 'browser/themes/browser_theme_pack_unittest.cc', + 'browser/themes/browser_theme_provider_unittest.cc', 'browser/translate/translate_manager_unittest.cc', 'browser/user_style_sheet_watcher_unittest.cc', 'browser/views/accessibility_event_router_views_unittest.cc', diff --git a/tools/heapcheck/suppressions.txt b/tools/heapcheck/suppressions.txt index 94d110d..bbff895 100644 --- a/tools/heapcheck/suppressions.txt +++ b/tools/heapcheck/suppressions.txt @@ -111,9 +111,9 @@ fun:ToolsSanityTest_MemoryLeak_Test::TestBody } { - Intentional leak in ChromeThreadTest.NotReleasedIfTargetThreadNonExistent + Intentional leak in BrowserThreadTest.NotReleasedIfTargetThreadNonExistent Heapcheck:Leak - fun:ChromeThreadTest_NotReleasedIfTargetThreadNonExistent_Test::TestBody + fun:BrowserThreadTest_NotReleasedIfTargetThreadNonExistent_Test::TestBody fun:testing::Test::Run } #----------------------------------------------------------------------- diff --git a/tools/valgrind/memcheck/suppressions.txt b/tools/valgrind/memcheck/suppressions.txt index 1571dd4..87f2f15 100644 --- a/tools/valgrind/memcheck/suppressions.txt +++ b/tools/valgrind/memcheck/suppressions.txt @@ -667,10 +667,10 @@ fun:_ZN7WebCore8SVGNames4initEv } { - intentional_ChromeThreadTest_NotReleasedIfTargetThreadNonExistent_Test_leak + intentional_BrowserThreadTest_NotReleasedIfTargetThreadNonExistent_Test_leak Memcheck:Leak fun:_Znw* - fun:_ZN58ChromeThreadTest_NotReleasedIfTargetThreadNonExistent_Test8TestBodyEv + fun:_ZN58BrowserThreadTest_NotReleasedIfTargetThreadNonExistent_Test8TestBodyEv } { # This is an on demand initialization which is done and then intentionally diff --git a/tools/valgrind/tsan/ignores.txt b/tools/valgrind/tsan/ignores.txt index 2d7182bb..3e6e499 100644 --- a/tools/valgrind/tsan/ignores.txt +++ b/tools/valgrind/tsan/ignores.txt @@ -100,4 +100,4 @@ fun_r:threadLockingTest # Ignore accesses below GetCurrentThreadIdentifier. # There is a benign race which is hard to suppress properly, # see http://crbug.com/44580 -fun_r:*ChromeThread*GetCurrentThreadIdentifier* +fun_r:*BrowserThread*GetCurrentThreadIdentifier* diff --git a/tools/valgrind/wine_memcheck/suppressions.txt b/tools/valgrind/wine_memcheck/suppressions.txt index 4c5e85b..64161d9 100644 --- a/tools/valgrind/wine_memcheck/suppressions.txt +++ b/tools/valgrind/wine_memcheck/suppressions.txt @@ -420,11 +420,11 @@ { # Same leak exists in src/tools/valgrind/memcheck/suppressions.txt # with a mangled stack signature. - intentional_ChromeThreadTest_NotReleasedIfTargetThreadNonExistent_Test_leak + intentional_BrowserThreadTest_NotReleasedIfTargetThreadNonExistent_Test_leak Memcheck:Leak ... fun:operator new - fun:ChromeThreadTest_NotReleasedIfTargetThreadNonExistent_Test::TestBody + fun:BrowserThreadTest_NotReleasedIfTargetThreadNonExistent_Test::TestBody fun:testing::Test::Run } diff --git a/tools/wine_valgrind/chromium-valgrind-suppressions b/tools/wine_valgrind/chromium-valgrind-suppressions index 9af36b5..3dd72f1 100644 --- a/tools/wine_valgrind/chromium-valgrind-suppressions +++ b/tools/wine_valgrind/chromium-valgrind-suppressions @@ -215,11 +215,11 @@ { # Same leak exists in src/tools/valgrind/memcheck/suppressions.txt # with a mangled stack signature. - intentional_ChromeThreadTest_NotReleasedIfTargetThreadNonExistent_Test_leak + intentional_BrowserThreadTest_NotReleasedIfTargetThreadNonExistent_Test_leak Memcheck:Leak ... fun:operator new - fun:ChromeThreadTest_NotReleasedIfTargetThreadNonExistent_Test::TestBody + fun:BrowserThreadTest_NotReleasedIfTargetThreadNonExistent_Test::TestBody fun:testing::Test::Run } # From src/tools/valgrind/memcheck/suppressions.txt |