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

Issue 2940023002: TaskScheduler: migrate appcache database over to use it. (Closed)

Created:
3 years, 6 months ago by michaeln
Modified:
3 years, 5 months ago
Reviewers:
gab, jsbell, boliu
CC:
chromium-reviews, michaeln, jam, darin-cc_chromium.org, jkarlin+watch_chromium.org, nhiroki, Maks Orlovich
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

TaskScheduler: migrate appcache database over to use it. Review-Url: https://codereview.chromium.org/2940023002 Cr-Commit-Position: refs/heads/master@{#485493} Committed: https://chromium.googlesource.com/chromium/src/+/be6b241a17964378fb18c62efbb56de7b781a725

Patch Set 1 #

Patch Set 2 : tests #

Patch Set 3 : many more tests #

Total comments: 8

Patch Set 4 : rebase #

Patch Set 5 : comments + rebase #

Unified diffs Side-by-side diffs Delta from patch set Stats (+133 lines, -94 lines) Patch
M content/browser/appcache/appcache_group_unittest.cc View 1 2 2 chunks +2 lines, -2 lines 0 comments Download
M content/browser/appcache/appcache_host_unittest.cc View 1 2 2 chunks +2 lines, -2 lines 0 comments Download
M content/browser/appcache/appcache_request_handler_unittest.cc View 1 2 3 chunks +8 lines, -2 lines 0 comments Download
M content/browser/appcache/appcache_response_unittest.cc View 1 2 3 chunks +8 lines, -2 lines 0 comments Download
M content/browser/appcache/appcache_service_impl.h View 1 3 chunks +4 lines, -4 lines 0 comments Download
M content/browser/appcache/appcache_service_impl.cc View 1 2 3 4 5 chunks +9 lines, -7 lines 0 comments Download
M content/browser/appcache/appcache_service_unittest.cc View 1 2 1 chunk +1 line, -3 lines 0 comments Download
M content/browser/appcache/appcache_storage_impl.h View 1 2 chunks +2 lines, -2 lines 0 comments Download
M content/browser/appcache/appcache_storage_impl.cc View 1 13 chunks +19 lines, -21 lines 0 comments Download
M content/browser/appcache/appcache_storage_impl_unittest.cc View 1 2 3 4 15 chunks +40 lines, -25 lines 0 comments Download
M content/browser/appcache/appcache_storage_unittest.cc View 1 2 2 chunks +5 lines, -1 line 0 comments Download
M content/browser/appcache/appcache_unittest.cc View 1 2 10 chunks +11 lines, -10 lines 0 comments Download
M content/browser/appcache/appcache_update_job_unittest.cc View 1 2 2 chunks +2 lines, -1 line 0 comments Download
M content/browser/appcache/appcache_url_request_job_unittest.cc View 1 2 3 chunks +8 lines, -2 lines 0 comments Download
M content/browser/appcache/chrome_appcache_service.cc View 1 chunk +1 line, -3 lines 0 comments Download
M content/browser/appcache/chrome_appcache_service_unittest.cc View 1 2 8 chunks +11 lines, -7 lines 0 comments Download

Messages

Total messages: 23 (16 generated)
michaeln
hi gab, ptal
3 years, 6 months ago (2017-06-19 18:12:18 UTC) #11
gab
lgtm % nits and further improvement suggestion, thanks! https://codereview.chromium.org/2940023002/diff/40001/content/browser/appcache/appcache_service_impl.cc File content/browser/appcache/appcache_service_impl.cc (right): https://codereview.chromium.org/2940023002/diff/40001/content/browser/appcache/appcache_service_impl.cc#newcode414 content/browser/appcache/appcache_service_impl.cc:414: db_task_runner_ ...
3 years, 6 months ago (2017-06-20 21:29:55 UTC) #13
michaeln
https://codereview.chromium.org/2940023002/diff/40001/content/browser/appcache/appcache_service_impl.cc File content/browser/appcache/appcache_service_impl.cc (right): https://codereview.chromium.org/2940023002/diff/40001/content/browser/appcache/appcache_service_impl.cc#newcode414 content/browser/appcache/appcache_service_impl.cc:414: db_task_runner_ = base::CreateSequencedTaskRunnerWithTraits( On 2017/06/20 21:29:54, gab (in-out til ...
3 years, 5 months ago (2017-07-11 00:33:54 UTC) #14
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/2940023002/80001
3 years, 5 months ago (2017-07-11 00:34:32 UTC) #17
commit-bot: I haz the power
Committed patchset #5 (id:80001) as https://chromium.googlesource.com/chromium/src/+/be6b241a17964378fb18c62efbb56de7b781a725
3 years, 5 months ago (2017-07-11 02:11:47 UTC) #20
boliu
Hi, I'm looking at migrating QuotaManager. And I found that AppCacheStorageImpl uses QuotaManager. Is this ...
3 years, 5 months ago (2017-07-24 19:23:30 UTC) #22
jsbell
3 years, 5 months ago (2017-07-24 19:55:50 UTC) #23
Message was sent while issue was closed.
Drive by response... hopefully I get the details right.

On 2017/07/24 19:23:30, boliu wrote:
> Hi, I'm looking at migrating QuotaManager. And I found that
AppCacheStorageImpl
> uses QuotaManager. Is this currently broken, and QuotaManager and
> AppCacheStorageImpl should really be using the same db sequence?

QuotaManager and AppCache are talking to separate databases, so they should be
able to use separate sequences.

Much of the AppCache logic runs on the IO thread; its internal database work
(now) runs on the db_task_runner_ (c/o task scheduler). See
AppCacheStorageImpl::DatabaseTask::Schedule for an example (runs on the IO
thread, schedules work on the db_task_runner)

Similarly, QuotaManager expects to be called on the IO thread for the most part,
and schedules work against its own DB thread. (I assume that's what you're
migrating, not migrating QuotaManager off of IO?)

> I can't quite tell but I *think* GetUsageAndQuota is called on the IO thread

Yes. GetQuotaThenSchedule eventually calls Schedule which asserts sequence
affinity. More DCHECKs about sequence affinity in both QuotaManager and AppCache
would be wonderful.

> in
> which case AppCache and QuotaManager don't need to share the same db sequence?

Each has a separate database, which can run separately.

> Would be super confusing though, two task runners that sounds like they are
the
> same aren't..

Names are confusing, but since there's no global database for Chrome (or
content, or ...) it's somewhat implicit - if not obvious - that QuotaManager's
db_runner is for talking to the quota database, and AppCache's db_runner is for
talking to the appcache database.

Powered by Google App Engine
This is Rietveld 408576698