Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(39)

Issue 2472473002: gpu shader cache: Clarify lifetime/ownership/threadiness of objects. (Closed)

Created:
4 years, 1 month ago by sadrul
Modified:
4 years, 1 month ago
Reviewers:
piman
CC:
chromium-reviews, jam, darin-cc_chromium.org, piman+watch_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

gpu shader cache: Clarify lifetime/ownership/threadiness of objects. Notable changes: . Instead of using BrowserThread from ShaderCacheFactory, inject the relevant task runners. This requires having an explicit creation step for the factory (ShaderCacheFactory::InitInstance()). Also, make the factory a ThreadChecker, and DCHECK that it is being used from a single thread. . Make ShaderDiskReadHelper non-refcounted. Instead, make ShaderDiskCache its explicit owner. This is safe, since ShaderDiskReadHelper used to have a weak pointer to the ShaderDiskCache, and not perform any action if the cache had been destroyed. So it makes sense to simply destroy the helper with the cache. . Make ShaderDiskCacheEntry non-refcounted. Like read-helper, this too used to have a weak pointer to the ShaderDiskCache, and not perform any action if the cache had been destroyed. So have the ShaderDiskCache own the cache-entry objects. . DCHECK that ShaderDiskReadHelper and ShaderDiskCacheEntry objects are destroyed in the same thread as they are created in. This also simplifies the dtors. . ShaderDiskCache no longer needs to be a SupportsWeakPtr<>, since only the cache-entry and the read-helper objects used to have the weak pointers, and they no longer do. This removes the last dependency on the rest of the content code from the gpu shader cache code. BUG=643746 Committed: https://crrev.com/0bb0ba87fa9ea8441575b798b91309986aee400d Cr-Commit-Position: refs/heads/master@{#429549}

Patch Set 1 #

Patch Set 2 : tot-merge #

Patch Set 3 : fix build, test #

Patch Set 4 : . #

Patch Set 5 : . #

Patch Set 6 : . #

Patch Set 7 : . #

Patch Set 8 : . #

Total comments: 9

Patch Set 9 : use weak_ptr<>, unordered_map<>, GetInstance() does not create. #

Patch Set 10 : GetInstance() returns null #

Patch Set 11 : iwyu #

Unified diffs Side-by-side diffs Delta from patch set Stats (+170 lines, -139 lines) Patch
M content/browser/browser_main_loop.cc View 1 2 3 4 5 6 7 8 9 10 2 chunks +8 lines, -0 lines 0 comments Download
M content/browser/gpu/shader_disk_cache.h View 1 2 3 4 5 6 7 8 9 5 chunks +27 lines, -14 lines 0 comments Download
M content/browser/gpu/shader_disk_cache.cc View 1 2 3 4 5 6 7 8 9 10 20 chunks +124 lines, -123 lines 0 comments Download
M content/browser/gpu/shader_disk_cache_unittest.cc View 2 chunks +4 lines, -0 lines 0 comments Download
M content/browser/renderer_host/render_process_host_impl.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +4 lines, -2 lines 0 comments Download
M content/browser/storage_partition_impl_unittest.cc View 1 2 1 chunk +3 lines, -0 lines 0 comments Download

Messages

Total messages: 65 (52 generated)
sadrul
4 years, 1 month ago (2016-11-02 03:53:13 UTC) #31
piman
https://codereview.chromium.org/2472473002/diff/130001/content/browser/gpu/shader_disk_cache.cc File content/browser/gpu/shader_disk_cache.cc (right): https://codereview.chromium.org/2472473002/diff/130001/content/browser/gpu/shader_disk_cache.cc#newcode183 content/browser/gpu/shader_disk_cache.cc:183: return net::ERR_IO_PENDING; I'm not a huge fan of this ...
4 years, 1 month ago (2016-11-02 18:11:15 UTC) #34
sadrul
Updated the CL desc. to reflect the changes in the patchset. https://codereview.chromium.org/2472473002/diff/130001/content/browser/gpu/shader_disk_cache.cc File content/browser/gpu/shader_disk_cache.cc (right): ...
4 years, 1 month ago (2016-11-02 19:24:53 UTC) #39
sadrul
https://codereview.chromium.org/2472473002/diff/130001/content/browser/gpu/shader_disk_cache.cc File content/browser/gpu/shader_disk_cache.cc (right): https://codereview.chromium.org/2472473002/diff/130001/content/browser/gpu/shader_disk_cache.cc#newcode394 content/browser/gpu/shader_disk_cache.cc:394: base::LeakySingletonTraits<ShaderCacheFactory>>::get(); On 2016/11/02 19:24:53, sadrul wrote: > On 2016/11/02 ...
4 years, 1 month ago (2016-11-02 20:36:40 UTC) #42
piman
LGTM with option below. https://codereview.chromium.org/2472473002/diff/130001/content/browser/gpu/shader_disk_cache.cc File content/browser/gpu/shader_disk_cache.cc (right): https://codereview.chromium.org/2472473002/diff/130001/content/browser/gpu/shader_disk_cache.cc#newcode394 content/browser/gpu/shader_disk_cache.cc:394: base::LeakySingletonTraits<ShaderCacheFactory>>::get(); On 2016/11/02 20:36:39, sadrul ...
4 years, 1 month ago (2016-11-02 20:56:17 UTC) #43
sadrul
https://codereview.chromium.org/2472473002/diff/130001/content/browser/gpu/shader_disk_cache.cc File content/browser/gpu/shader_disk_cache.cc (right): https://codereview.chromium.org/2472473002/diff/130001/content/browser/gpu/shader_disk_cache.cc#newcode394 content/browser/gpu/shader_disk_cache.cc:394: base::LeakySingletonTraits<ShaderCacheFactory>>::get(); On 2016/11/02 20:56:17, piman wrote: > On 2016/11/02 ...
4 years, 1 month ago (2016-11-03 03:57:51 UTC) #50
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2472473002/190001
4 years, 1 month ago (2016-11-03 03:59:02 UTC) #53
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_asan_rel_ng on master.tryserver.chromium.linux (JOB_TIMED_OUT, no build URL)
4 years, 1 month ago (2016-11-03 04:44:49 UTC) #55
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2472473002/190001
4 years, 1 month ago (2016-11-03 04:49:39 UTC) #57
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_asan_rel_ng on master.tryserver.chromium.linux (JOB_TIMED_OUT, no build URL)
4 years, 1 month ago (2016-11-03 06:50:16 UTC) #59
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2472473002/190001
4 years, 1 month ago (2016-11-03 12:34:58 UTC) #61
commit-bot: I haz the power
Committed patchset #11 (id:190001)
4 years, 1 month ago (2016-11-03 12:52:12 UTC) #63
commit-bot: I haz the power
4 years, 1 month ago (2016-11-03 12:54:22 UTC) #65
Message was sent while issue was closed.
Patchset 11 (id:??) landed as
https://crrev.com/0bb0ba87fa9ea8441575b798b91309986aee400d
Cr-Commit-Position: refs/heads/master@{#429549}

Powered by Google App Engine
This is Rietveld 408576698