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

Issue 56193004: Re-work the thread restrictions on the DOM distiller database (Closed)

Created:
7 years, 1 month ago by cjhopman
Modified:
7 years, 1 month ago
Reviewers:
Nico
CC:
chromium-reviews, nyquist
Visibility:
Public.

Description

Re-work the thread restrictions on the DOM distiller database In the current implementation, DomDistillerDatabase cannot be deleted on the main thread, instead the user must call ::Destroy(), and then let the database delete itself on its task runner. This is awkward and sort of leaks implementation details out of that class. Second, currently the parts of DomDistillerDatabase on each thread are doing some ad hoc method of checking their thread restrictions. Using ThreadChecker is better, though it loses some flexibility from checking TaskRunner::RunsTasksOnCurrentThread (maybe there should be something like a TaskRunnerChecker for that). Now: 1. no functions are called on DomDistillerDatabase off of the main thread 2. DomDistillerDatabase::LevelDB enforces that function calls and destructor all run on the same thread 3. DomDistillerDatabase can be deleted on the main thread Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=233386

Patch Set 1 #

Total comments: 10

Patch Set 2 : #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+108 lines, -126 lines) Patch
M components/dom_distiller/core/dom_distiller_database.h View 7 chunks +7 lines, -32 lines 0 comments Download
M components/dom_distiller/core/dom_distiller_database.cc View 1 10 chunks +67 lines, -80 lines 0 comments Download
M components/dom_distiller/core/dom_distiller_database_unittest.cc View 1 3 chunks +34 lines, -12 lines 2 comments Download
M components/dom_distiller/core/dom_distiller_store_unittest.cc View 1 chunk +0 lines, -2 lines 0 comments Download

Messages

Total messages: 9 (0 generated)
cjhopman
thakis: *
7 years, 1 month ago (2013-11-01 21:51:24 UTC) #1
Nico
Thanks, this looks simpler. Update the CL description with why you're doing this ("simpler", I ...
7 years, 1 month ago (2013-11-03 23:29:52 UTC) #2
cjhopman
https://codereview.chromium.org/56193004/diff/1/components/dom_distiller/core/dom_distiller_database.cc File components/dom_distiller/core/dom_distiller_database.cc (right): https://codereview.chromium.org/56193004/diff/1/components/dom_distiller/core/dom_distiller_database.cc#newcode30 components/dom_distiller/core/dom_distiller_database.cc:30: DomDistillerDatabase::LevelDB::~LevelDB() {} On 2013/11/03 23:29:52, Nico wrote: > should ...
7 years, 1 month ago (2013-11-04 18:40:59 UTC) #3
Nico
lgtm! https://codereview.chromium.org/56193004/diff/190001/components/dom_distiller/core/dom_distiller_database_unittest.cc File components/dom_distiller/core/dom_distiller_database_unittest.cc (right): https://codereview.chromium.org/56193004/diff/190001/components/dom_distiller/core/dom_distiller_database_unittest.cc#newcode273 components/dom_distiller/core/dom_distiller_database_unittest.cc:273: new DomDistillerDatabase(db_thread.message_loop_proxy())); Can this be on the stack ...
7 years, 1 month ago (2013-11-04 19:31:56 UTC) #4
cjhopman
https://codereview.chromium.org/56193004/diff/190001/components/dom_distiller/core/dom_distiller_database_unittest.cc File components/dom_distiller/core/dom_distiller_database_unittest.cc (right): https://codereview.chromium.org/56193004/diff/190001/components/dom_distiller/core/dom_distiller_database_unittest.cc#newcode273 components/dom_distiller/core/dom_distiller_database_unittest.cc:273: new DomDistillerDatabase(db_thread.message_loop_proxy())); On 2013/11/04 19:31:56, Nico wrote: > Can ...
7 years, 1 month ago (2013-11-05 19:08:29 UTC) #5
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/cjhopman@chromium.org/56193004/190001
7 years, 1 month ago (2013-11-05 23:16:54 UTC) #6
commit-bot: I haz the power
Retried try job too often on linux_aura for step(s) browser_tests http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=linux_aura&number=94317
7 years, 1 month ago (2013-11-06 03:27:50 UTC) #7
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/cjhopman@chromium.org/56193004/190001
7 years, 1 month ago (2013-11-06 18:09:01 UTC) #8
commit-bot: I haz the power
7 years, 1 month ago (2013-11-06 21:59:30 UTC) #9
Message was sent while issue was closed.
Change committed as 233386

Powered by Google App Engine
This is Rietveld 408576698