diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2017-04-05 14:08:31 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2017-04-11 07:46:53 +0000 |
commit | 6a4cabb866f66d4128a97cdc6d9d08ce074f1247 (patch) | |
tree | ab00f70a5e89278d6a0d16ff0c42578dc4d84a2d /chromium/content/browser/browser_thread_impl.h | |
parent | e733310db58160074f574c429d48f8308c0afe17 (diff) | |
download | qtwebengine-chromium-6a4cabb866f66d4128a97cdc6d9d08ce074f1247.tar.gz |
BASELINE: Update Chromium to 57.0.2987.144
Change-Id: I29db402ff696c71a04c4dbaec822c2e53efe0267
Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu>
Diffstat (limited to 'chromium/content/browser/browser_thread_impl.h')
-rw-r--r-- | chromium/content/browser/browser_thread_impl.h | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/chromium/content/browser/browser_thread_impl.h b/chromium/content/browser/browser_thread_impl.h index 29081ebbf22..d4bd3c944eb 100644 --- a/chromium/content/browser/browser_thread_impl.h +++ b/chromium/content/browser/browser_thread_impl.h @@ -5,7 +5,8 @@ #ifndef CONTENT_BROWSER_BROWSER_THREAD_IMPL_H_ #define CONTENT_BROWSER_BROWSER_THREAD_IMPL_H_ -#include "base/threading/platform_thread.h" +#include "base/memory/ref_counted.h" +#include "base/single_thread_task_runner.h" #include "base/threading/thread.h" #include "content/common/content_export.h" #include "content/public/browser/browser_thread.h" @@ -32,8 +33,26 @@ class CONTENT_EXPORT BrowserThreadImpl : public BrowserThread, bool StartWithOptions(const Options& options); bool StartAndWaitForTesting(); + // Redirects tasks posted to |identifier| to |task_runner|. + static void RedirectThreadIDToTaskRunner( + BrowserThread::ID identifier, + scoped_refptr<base::SingleThreadTaskRunner> task_runner); + + // Makes this |identifier| no longer accept tasks and synchronously flushes + // any tasks previously posted to it. + // Can only be called after a matching RedirectThreadIDToTaskRunner call. + static void StopRedirectionOfThreadID(BrowserThread::ID identifier); + static void ShutdownThreadPool(); + // Resets globals for |identifier|. Used in tests to clear global state that + // would otherwise leak to the next test. Globals are not otherwise fully + // cleaned up in ~BrowserThreadImpl() as there are subtle differences between + // UNINITIALIZED and SHUTDOWN state (e.g. globals.task_runners are kept around + // on shutdown). Must be called after ~BrowserThreadImpl() for the given + // |identifier|. + static void ResetGlobalsForTesting(BrowserThread::ID identifier); + protected: void Init() override; void Run(base::RunLoop* run_loop) override; |