diff options
author | Kinuko Yasuda <kinuko@chromium.org> | 2019-07-29 06:12:56 +0000 |
---|---|---|
committer | Michael Brüning <michael.bruning@qt.io> | 2020-03-13 11:30:21 +0000 |
commit | 80bf361c042c697a7adc2fcdee190b35a594df1b (patch) | |
tree | b2469294176af0e89a523db700320a0ba6895370 /chromium/content/browser/code_cache/generated_code_cache_context.cc | |
parent | 6f1a37c63baf7cdbb919221258ad6fe294de9d82 (diff) | |
download | qtwebengine-chromium-80bf361c042c697a7adc2fcdee190b35a594df1b.tar.gz |
[Backport] Dependency for security bug 925035
Manual backport of patch originally reviewed on
https://chromium-review.googlesource.com/c/chromium/src/+/1712949:
Move CodeCacheHost and GeneratedCodeCache to UI thread
See the issue for more details. It doesn't look this needs to live on
IO thread, this patch moves all the code cache code onto UI thread
so that security check can become easier.
(Alternatively we can only move CodeCacheHost to UI thread
but leave everything else on IO thread or on a sequenced task runner.
e.g. https://chromium-review.googlesource.com/c/chromium/src/+/1705540)
Bug: 985681
Change-Id: I3a780902135b19d2c55a5b844c230aa694856667
Reviewed-by: Jüri Valdmann <juri.valdmann@qt.io>
Diffstat (limited to 'chromium/content/browser/code_cache/generated_code_cache_context.cc')
-rw-r--r-- | chromium/content/browser/code_cache/generated_code_cache_context.cc | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/chromium/content/browser/code_cache/generated_code_cache_context.cc b/chromium/content/browser/code_cache/generated_code_cache_context.cc index beb40b80224..738e8b95b59 100644 --- a/chromium/content/browser/code_cache/generated_code_cache_context.cc +++ b/chromium/content/browser/code_cache/generated_code_cache_context.cc @@ -20,14 +20,6 @@ void GeneratedCodeCacheContext::Initialize(const base::FilePath& path, int max_bytes) { DCHECK_CURRENTLY_ON(BrowserThread::UI); - base::PostTaskWithTraits( - FROM_HERE, {BrowserThread::IO}, - base::BindOnce(&GeneratedCodeCacheContext::InitializeOnIO, this, path, - max_bytes)); -} - -void GeneratedCodeCacheContext::InitializeOnIO(const base::FilePath& path, - int max_bytes) { generated_js_code_cache_.reset( new GeneratedCodeCache(path.AppendASCII("js"), max_bytes, GeneratedCodeCache::CodeCacheType::kJavaScript)); @@ -40,14 +32,20 @@ void GeneratedCodeCacheContext::InitializeOnIO(const base::FilePath& path, } } +void GeneratedCodeCacheContext::Shutdown() { + DCHECK_CURRENTLY_ON(BrowserThread::UI); + generated_js_code_cache_.reset(); + generated_wasm_code_cache_.reset(); +} + GeneratedCodeCache* GeneratedCodeCacheContext::generated_js_code_cache() const { - DCHECK_CURRENTLY_ON(BrowserThread::IO); + DCHECK_CURRENTLY_ON(BrowserThread::UI); return generated_js_code_cache_.get(); } GeneratedCodeCache* GeneratedCodeCacheContext::generated_wasm_code_cache() const { - DCHECK_CURRENTLY_ON(BrowserThread::IO); + DCHECK_CURRENTLY_ON(BrowserThread::UI); return generated_wasm_code_cache_.get(); } |