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

Issue 7031065: AppCache + Quota integration (Closed)

Created:
9 years, 7 months ago by michaeln
Modified:
9 years, 6 months ago
Reviewers:
kinuko
CC:
chromium-reviews, darin-cc_chromium.org
Visibility:
Public.

Description

AppCache + Quota integration * Notify the QuotaManager of accesses and modifications to the amount of storage utlized. * Implement the QuotaClient interface so the manager can query the appcache for usage and delete data. * When storing appcaches, use QuotaManager GetUsageAndQuota and respect the limit. * Remove the old and unsed support for storing per-origin quota values in the appcache DB. BUG=61676 TEST=unittests Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=88746

Patch Set 1 #

Patch Set 2 : '' #

Patch Set 3 : '' #

Patch Set 4 : '' #

Patch Set 5 : '' #

Patch Set 6 : '' #

Patch Set 7 : '' #

Patch Set 8 : '' #

Patch Set 9 : '' #

Patch Set 10 : '' #

Patch Set 11 : '' #

Patch Set 12 : '' #

Patch Set 13 : '' #

Total comments: 10

Patch Set 14 : '' #

Patch Set 15 : '' #

Patch Set 16 : '' #

Patch Set 17 : '' #

Total comments: 18

Patch Set 18 : '' #

Patch Set 19 : '' #

Patch Set 20 : '' #

Patch Set 21 : '' #

Patch Set 22 : '' #

Patch Set 23 : '' #

Patch Set 24 : '' #

Patch Set 25 : '' #

Total comments: 12

Patch Set 26 : '' #

Patch Set 27 : '' #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1544 lines, -66 lines) Patch
M webkit/appcache/appcache_database.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 5 chunks +3 lines, -8 lines 0 comments Download
M webkit/appcache/appcache_database.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 5 chunks +10 lines, -12 lines 0 comments Download
M webkit/appcache/appcache_database_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 3 chunks +7 lines, -2 lines 0 comments Download
A webkit/appcache/appcache_quota_client.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 1 chunk +111 lines, -0 lines 0 comments Download
A webkit/appcache/appcache_quota_client.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 1 chunk +268 lines, -0 lines 0 comments Download
A webkit/appcache/appcache_quota_client_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 1 chunk +429 lines, -0 lines 0 comments Download
M webkit/appcache/appcache_service.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 4 chunks +16 lines, -0 lines 0 comments Download
M webkit/appcache/appcache_service.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 6 chunks +108 lines, -3 lines 0 comments Download
A webkit/appcache/appcache_service_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 chunk +109 lines, -0 lines 0 comments Download
M webkit/appcache/appcache_storage.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 4 chunks +12 lines, -0 lines 0 comments Download
M webkit/appcache/appcache_storage.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 2 chunks +40 lines, -0 lines 0 comments Download
M webkit/appcache/appcache_storage_impl.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 3 chunks +2 lines, -1 line 0 comments Download
M webkit/appcache/appcache_storage_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 25 chunks +111 lines, -31 lines 0 comments Download
M webkit/appcache/appcache_storage_impl_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 25 chunks +168 lines, -7 lines 0 comments Download
M webkit/appcache/appcache_storage_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 2 chunks +82 lines, -0 lines 0 comments Download
M webkit/appcache/mock_appcache_service.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 1 chunk +18 lines, -1 line 0 comments Download
A webkit/appcache/mock_appcache_service.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +24 lines, -0 lines 0 comments Download
M webkit/appcache/mock_appcache_storage.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 5 chunks +8 lines, -1 line 0 comments Download
M webkit/appcache/mock_appcache_storage.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 3 chunks +13 lines, -0 lines 0 comments Download
M webkit/appcache/webkit_appcache.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 1 chunk +2 lines, -0 lines 0 comments Download
M webkit/tools/test_shell/test_shell.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 1 chunk +3 lines, -0 lines 0 comments Download

Messages

Total messages: 10 (0 generated)
michaeln
hi kinuko, this isn't quite done yet, but it's getting close. what's done is * ...
9 years, 6 months ago (2011-06-01 05:25:44 UTC) #1
kinuko
http://codereview.chromium.org/7031065/diff/25001/webkit/appcache/appcache_quota_client.cc File webkit/appcache/appcache_quota_client.cc (right): http://codereview.chromium.org/7031065/diff/25001/webkit/appcache/appcache_quota_client.cc#newcode42 webkit/appcache/appcache_quota_client.cc:42: DeletePendingRequests(); do we need this? we seem to be ...
9 years, 6 months ago (2011-06-02 08:38:06 UTC) #2
michaeln
i've still got a bit todo, notably tests and getting the limit from the QM ...
9 years, 6 months ago (2011-06-02 22:46:55 UTC) #3
michaeln
On 2011/06/02 22:46:55, michaeln wrote: > i've still got a bit todo, notably tests and ...
9 years, 6 months ago (2011-06-08 00:47:48 UTC) #4
kinuko
I want to take another look, but I think it looks good. http://codereview.chromium.org/7031065/diff/41022/webkit/appcache/appcache_quota_client_unittest.cc File webkit/appcache/appcache_quota_client_unittest.cc ...
9 years, 6 months ago (2011-06-08 13:49:25 UTC) #5
michaeln
Thnx for looking... Please ignore the comments for webkit/appcache/appcache_storage_impl_unittest.cc (the trailing comments). Those are just ...
9 years, 6 months ago (2011-06-08 18:09:54 UTC) #6
michaeln
I've modified the storage_impl unittests to test for the usage_map being update properly. These tests ...
9 years, 6 months ago (2011-06-09 01:28:17 UTC) #7
michaeln
Added tests and gypi file additions. I think this is ready now. I'll start some ...
9 years, 6 months ago (2011-06-10 01:01:24 UTC) #8
kinuko
lgtm http://codereview.chromium.org/7031065/diff/40055/webkit/appcache/appcache_quota_client.cc File webkit/appcache/appcache_quota_client.cc (right): http://codereview.chromium.org/7031065/diff/40055/webkit/appcache/appcache_quota_client.cc#newcode136 webkit/appcache/appcache_quota_client.cc:136: void AppCacheQuotaClient::DidDeleteAppCachesForOrigin(int rv) { To make sure... after ...
9 years, 6 months ago (2011-06-10 10:04:48 UTC) #9
michaeln
9 years, 6 months ago (2011-06-10 18:49:15 UTC) #10
http://codereview.chromium.org/7031065/diff/40055/webkit/appcache/appcache_qu...
File webkit/appcache/appcache_quota_client.cc (right):

http://codereview.chromium.org/7031065/diff/40055/webkit/appcache/appcache_qu...
webkit/appcache/appcache_quota_client.cc:136: void
AppCacheQuotaClient::DidDeleteAppCachesForOrigin(int rv) {
On 2011/06/10 10:04:48, kinuko wrote:
> To make sure... after it's cancelled this won't be called?  Do we need to
check
> if service_ is not null like we do for quota_manager?

Added a DCHECK(service_). After a cancelable callback is canceled, there's no
chance of getting here.

http://codereview.chromium.org/7031065/diff/40055/webkit/appcache/appcache_qu...
File webkit/appcache/appcache_quota_client.h (right):

http://codereview.chromium.org/7031065/diff/40055/webkit/appcache/appcache_qu...
webkit/appcache/appcache_quota_client.h:28: // with the quota  management
system. The QuotaClient interface is
On 2011/06/10 10:04:48, kinuko wrote:
> nit: two spaces between quota and management

Done.

http://codereview.chromium.org/7031065/diff/40055/webkit/appcache/appcache_qu...
File webkit/appcache/appcache_quota_client_unittest.cc (right):

http://codereview.chromium.org/7031065/diff/40055/webkit/appcache/appcache_qu...
webkit/appcache/appcache_quota_client_unittest.cc:423:
EXPECT_EQ(quota::kQuotaErrorAbort, delete_status_);
On 2011/06/10 10:04:48, kinuko wrote:
> need Call_OnQuotaManagerDestroyed(client) here?

Done.

gah! thank you kinuko-valgrind-san!

http://codereview.chromium.org/7031065/diff/40055/webkit/appcache/appcache_se...
File webkit/appcache/appcache_service_unittest.cc (right):

http://codereview.chromium.org/7031065/diff/40055/webkit/appcache/appcache_se...
webkit/appcache/appcache_service_unittest.cc:30: 
On 2011/06/10 10:04:48, kinuko wrote:
> protected: around here?
> (we seem to have public member vars finishing with '_')

Done.

http://codereview.chromium.org/7031065/diff/40055/webkit/appcache/appcache_st...
File webkit/appcache/appcache_storage_impl.cc (right):

http://codereview.chromium.org/7031065/diff/40055/webkit/appcache/appcache_st...
webkit/appcache/appcache_storage_impl.cc:597: // also exceeds the quota?
http://crbug.com/83968
On 2011/06/10 10:04:48, kinuko wrote:
> fyi for filesystem we reject any further append-writes but allow overwrites if
> offset+new_write_size is within the original file size (no truncation).

i'm doing that for appcaches too, but the consequence is that a stale old
version of the appcache can't be updated to the latest version... so you're
stuck with the old one.

i think i may need to delete the old one in this case to un-wedge things.

http://codereview.chromium.org/7031065/diff/40055/webkit/appcache/appcache_st...
File webkit/appcache/appcache_storage_impl_unittest.cc (right):

http://codereview.chromium.org/7031065/diff/40055/webkit/appcache/appcache_st...
webkit/appcache/appcache_storage_impl_unittest.cc:214: 
On 2011/06/10 10:04:48, kinuko wrote:
> nit: protected: ?

I'd have to add getters and setter methods to poke at these members (here and in
the class below) from within test fixtures. I think would just clutter things up
more than help really.

Powered by Google App Engine
This is Rietveld 408576698