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

Issue 192043: AppCacheHost cache selection algorithm (Closed)

Created:
11 years, 3 months ago by michaeln
Modified:
9 years, 7 months ago
Reviewers:
jennb
CC:
chromium-reviews_googlegroups.com, darin (slow to review), jorlow1, dumi
Visibility:
Public.

Description

* Fleshed out AppCacheHost class a fair amount, in particular the cache selection algorithm. * Added some AppCacheHost unit tests. * Introduced AppCacheRequestHandler class, which replaces the clunkyApp CacheInterceptor::ExtraInfo struct. This impl is entirely skeletal stubs for now. TEST=appcache_unittest.cc, but really needs more BUG=none Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=26275

Patch Set 1 #

Patch Set 2 : '' #

Patch Set 3 : '' #

Patch Set 4 : '' #

Patch Set 5 : '' #

Total comments: 18

Patch Set 6 : '' #

Total comments: 1

Patch Set 7 : '' #

Total comments: 1

Patch Set 8 : '' #

Total comments: 22

Patch Set 9 : '' #

Patch Set 10 : '' #

Patch Set 11 : '' #

Patch Set 12 : '' #

Patch Set 13 : '' #

Patch Set 14 : '' #

Total comments: 30

Patch Set 15 : '' #

Total comments: 9

Patch Set 16 : '' #

Total comments: 1

Patch Set 17 : '' #

Unified diffs Side-by-side diffs Delta from patch set Stats (+993 lines, -231 lines) Patch
M chrome/common/appcache/appcache_dispatcher_host.cc View 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +3 lines, -0 lines 0 comments Download
M webkit/appcache/appcache.h View 6 7 8 9 10 11 12 13 14 15 16 3 chunks +9 lines, -7 lines 0 comments Download
M webkit/appcache/appcache_backend_impl.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 2 chunks +22 lines, -34 lines 0 comments Download
M webkit/appcache/appcache_backend_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 3 chunks +53 lines, -20 lines 0 comments Download
M webkit/appcache/appcache_entry.h View 14 15 16 2 chunks +5 lines, -7 lines 0 comments Download
M webkit/appcache/appcache_frontend_impl.h View 6 7 8 9 10 11 12 13 14 15 16 1 chunk +1 line, -1 line 0 comments Download
M webkit/appcache/appcache_group.h View 9 10 11 12 13 14 15 16 2 chunks +17 lines, -0 lines 0 comments Download
M webkit/appcache/appcache_group.cc View 9 10 11 12 13 14 15 16 3 chunks +7 lines, -1 line 0 comments Download
M webkit/appcache/appcache_group_unittest.cc View 4 5 6 7 8 9 10 11 12 13 14 15 16 4 chunks +52 lines, -15 lines 0 comments Download
M webkit/appcache/appcache_host.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +99 lines, -15 lines 0 comments Download
M webkit/appcache/appcache_host.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +234 lines, -13 lines 0 comments Download
A webkit/appcache/appcache_host_unittest.cc View 8 9 10 11 12 13 14 15 1 chunk +230 lines, -0 lines 0 comments Download
M webkit/appcache/appcache_interceptor.h View 3 4 5 6 7 8 9 10 11 12 13 14 15 16 2 chunks +7 lines, -1 line 0 comments Download
M webkit/appcache/appcache_interceptor.cc View 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 2 chunks +39 lines, -75 lines 0 comments Download
A webkit/appcache/appcache_request_handler.h View 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +53 lines, -0 lines 0 comments Download
A webkit/appcache/appcache_request_handler.cc View 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +63 lines, -0 lines 0 comments Download
M webkit/appcache/appcache_service.h View 9 10 11 12 13 14 15 16 4 chunks +34 lines, -12 lines 0 comments Download
M webkit/appcache/appcache_service.cc View 9 10 11 12 13 14 15 16 2 chunks +37 lines, -0 lines 0 comments Download
M webkit/appcache/appcache_service_unittest.cc View 7 8 9 10 11 12 13 14 15 16 2 chunks +4 lines, -8 lines 0 comments Download
M webkit/appcache/appcache_unittest.cc View 4 5 6 7 8 9 10 11 12 13 14 15 16 2 chunks +13 lines, -14 lines 0 comments Download
M webkit/appcache/manifest_parser_unittest.cc View 7 8 9 10 11 12 13 14 15 16 2 chunks +4 lines, -7 lines 0 comments Download
M webkit/appcache/web_application_cache_host_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +4 lines, -1 line 0 comments Download
M webkit/tools/test_shell/test_shell.gyp View 9 10 11 12 13 14 15 16 1 chunk +1 line, -0 lines 0 comments Download
M webkit/webkit.gyp View 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +2 lines, -0 lines 0 comments Download

Messages

Total messages: 22 (0 generated)
michaeln
Hi Jenn, This is some work in progress that I'd like to clean up and ...
11 years, 3 months ago (2009-09-09 20:13:41 UTC) #1
jennb
Seems a bit odd to me that the URLRequest::UserData is more than just a container ...
11 years, 3 months ago (2009-09-09 23:05:18 UTC) #2
michaeln
no new snapshot yet... http://codereview.chromium.org/192043/diff/1029/10 File webkit/appcache/appcache_backend_impl.h (right): http://codereview.chromium.org/192043/diff/1029/10#newcode16 Line 16: class AppCacheBackendImpl { I ...
11 years, 3 months ago (2009-09-09 23:41:36 UTC) #3
jennb
On Wed, Sep 9, 2009 at 4:41 PM, <michaeln@chromium.org> wrote: > no new snapshot yet... ...
11 years, 3 months ago (2009-09-10 17:55:17 UTC) #4
michaeln
Hi again jenn... new snapshot... I've been poking at this a bit more and dug ...
11 years, 3 months ago (2009-09-10 22:40:26 UTC) #5
michaeln
blah... gcc comile errors... trouble declaring the tests as friends? http://codereview.chromium.org/192043/diff/2004/2011 File webkit/appcache/appcache_request_handler.cc (right): http://codereview.chromium.org/192043/diff/2004/2011#newcode69 ...
11 years, 3 months ago (2009-09-10 23:08:12 UTC) #6
michaeln
new snapshot... put the unit tests in the appcache namespace and used FRIEND_TEST macro to ...
11 years, 3 months ago (2009-09-11 00:34:30 UTC) #7
michaeln
New snapshot 8... I've started work on unit tests for the AppCacheHost class too... the ...
11 years, 3 months ago (2009-09-11 19:00:16 UTC) #8
michaeln
I intend to add a similar test case for each precondition case - nothing selected ...
11 years, 3 months ago (2009-09-11 22:40:25 UTC) #9
jennb
Sorry took so long. Had to go look up new utils you used that were ...
11 years, 3 months ago (2009-09-12 00:17:10 UTC) #10
jennb
Since you have this open... http://codereview.chromium.org/192043/diff/9007/9024 File webkit/appcache/appcache_service_unittest.cc (right): http://codereview.chromium.org/192043/diff/9007/9024#newcode28 Line 28: new AppCacheGroup(&service, GURL::EmptyGURL()); ...
11 years, 3 months ago (2009-09-12 02:01:45 UTC) #11
michaeln
http://codereview.chromium.org/192043/diff/8008/8015 File webkit/appcache/appcache_request_handler.cc (right): http://codereview.chromium.org/192043/diff/8008/8015#newcode40 Line 40: // selection occurs, that extra reference should be ...
11 years, 3 months ago (2009-09-14 04:24:54 UTC) #12
michaeln
New snapshot 11... simplified how the distinction between potential and selected is maintained.
11 years, 3 months ago (2009-09-14 18:27:38 UTC) #13
michaeln
New snapshot 12/13... * fixed some lint errors * massaged AppCacheHost::SelectCache slightly for readability * ...
11 years, 3 months ago (2009-09-14 20:01:47 UTC) #14
jennb
http://codereview.chromium.org/192043/diff/1052/1066 File webkit/appcache/appcache.h (right): http://codereview.chromium.org/192043/diff/1052/1066#newcode70 Line 70: // Use AppCacheHost::Associate<<>>Host() to manipulate host association. s/<<>>Host/<<>>Cache ...
11 years, 3 months ago (2009-09-14 22:22:01 UTC) #15
michaeln
New snapshot coming soon... http://codereview.chromium.org/192043/diff/1052/1066 File webkit/appcache/appcache.h (right): http://codereview.chromium.org/192043/diff/1052/1066#newcode70 Line 70: // Use AppCacheHost::Associate<<>>Host() to ...
11 years, 3 months ago (2009-09-15 00:05:04 UTC) #16
michaeln
New snapshot uploaded.
11 years, 3 months ago (2009-09-15 01:05:55 UTC) #17
jennb
LGTM If you can commit early tomorrow, I'll be able to sync these changes to ...
11 years, 3 months ago (2009-09-15 04:26:08 UTC) #18
jennb
LGTM A couple more comments. http://codereview.chromium.org/192043/diff/11026/1121 File webkit/appcache/appcache.cc (right): http://codereview.chromium.org/192043/diff/11026/1121#newcode21 Line 21: if (cache_id_ != ...
11 years, 3 months ago (2009-09-15 04:29:52 UTC) #19
michaeln
In a future CL, i think we should be able to make cache_id_ const. Class ...
11 years, 3 months ago (2009-09-15 17:08:09 UTC) #20
michaeln
http://codereview.chromium.org/192043/diff/11026/1122 File webkit/appcache/appcache_entry.h (right): http://codereview.chromium.org/192043/diff/11026/1122#newcode8 Line 8: //#include "googleurl/src/gurl.h" On 2009/09/15 04:26:08, jennb wrote: > ...
11 years, 3 months ago (2009-09-15 18:36:46 UTC) #21
jennb
11 years, 3 months ago (2009-09-15 20:32:25 UTC) #22
On Tue, Sep 15, 2009 at 11:36 AM, <michaeln@chromium.org> wrote:

>
>
> http://codereview.chromium.org/192043/diff/11026/1100
> File webkit/appcache/appcache_host.cc (right):
>
> http://codereview.chromium.org/192043/diff/11026/1100#newcode166
> Line 166: if (associated_cache() && associated_cache()->is_complete())
> On 2009/09/15 04:26:08, jennb wrote:
>
>> Can use the member var associated_cache_ directly in these 2 lines?
>>
>
> As a code reader, i prefer associated_host() to association_host_.get(),
> as far as the compiler is concerned these are identical.


I don't think you need to use .get(). Should work with just
association_host_.


>
> http://codereview.chromium.org/192043/diff/8048/9148
> File webkit/appcache/appcache.h (right):
>
> http://codereview.chromium.org/192043/diff/8048/9148#newcode73
> Line 73: const int64 cache_id_;
> I've unwound the AssignId() method and instead have made the cache_id_
> const. Given our strategy, we should be able to either know a real id or
> to generate a real id at ctor time. Your ctor to create a new cache
> given a manifest can call...
>  cache_id_(service->NewCacheId())
> ... in the initializer list.
>
>
That works.

Jenn

> http://codereview.chromium.org/192043
>

Powered by Google App Engine
This is Rietveld 408576698