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

Issue 2902653002: Get main frame and subframe AppCache loads to work. (Closed)

Created:
3 years, 7 months ago by ananta
Modified:
3 years, 6 months ago
Reviewers:
michaeln, kinuko, jam
CC:
chromium-reviews, Randy Smith (Not in Mondays), darin-cc_chromium.org, loading-reviews_chromium.org, mmenke
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Get main frame and subframe AppCache loads to work. The latest iteration of this patch now has AppCache working for the main frame and subframe. Subresource loads will be addressed in a later patchset. With this change the w3schools.com AppCache sample here https://www.w3schools.com/tags/tryit.asp?filename=tryhtml5_html_manifest works. This has been integrated with kinuko's patch, i.e. we implement the URLLoaderRequestHandler interface to validate if the request can be serviced via the AppCache. The URLLoaderFactory for AppCache is now instantiated as needed. Changes in this patch include the following: 1. The AppCacheRequestHandler class now implements the URLLoaderRequestHandler interface. The handler then initializes the AppCacheURLLoader job which allows us to determine if the request would be serviced via the AppCache. If yes we return the URLLoaderFactory for the AppCache in the callback or pass null to the callback. 2. We call the AppCacheRequestHandler::InitializeForNavigationNetworkService() function from NavigationURLLoaderNetworkService::URLLoaderRequestController::Start() for AppCache. 3. Use the AppCacheResponseReader and AppCacheResponseInfo classes in AppCacheURLLoaderJob to read data from the AppCache. The job invokes methods on the URLLoaderClient when it reads the response/data, etc. The data from the AppCache is written to a mojo data pipe and passed to the client. 4. I reverted portions of the previous change to the AppCacheURLLoaderRequest class, which was to hold on to a unique_ptr for the ResourceRequest. We now hold on to a copy of the request. The CreateLoaderAndStart() method on the factory gives us a copy of the request. 5. Moved some of the methods like IsWaiting/IsDeliveringAppCacheResponse/IsDeliveringNetworkResponse/IsDeliveringErrorResponse/IsCacheEntryNotFound to the AppCacheJob base class as these implementations could be shared between the URLRequest and URLLoader versions of the subclasses. I also moved the member variables used by these methods to the base class. 6. Add WeakPtrFactory to the AppCacheStorage class and provide a getter to return a weak pointer reference to the instance. BUG=715632 Review-Url: https://codereview.chromium.org/2902653002 Cr-Commit-Position: refs/heads/master@{#478459} Committed: https://chromium.googlesource.com/chromium/src/+/a2c8ec6149d02d7cfe9389d9739236ed06571a6a

Patch Set 1 #

Patch Set 2 : git cl format #

Patch Set 3 : Remove includes and AppCacheRequestHandler member. Unused at the moment #

Patch Set 4 : Fix compile failure by using the host_ member. #

Total comments: 17

Patch Set 5 : Address first round of review comments #

Patch Set 6 : Provide an override of AppCacheStorage::IsInitialized() in MockAppCacheStorage #

Patch Set 7 : Fix content_unittests redness #

Patch Set 8 : Fix check #

Total comments: 1

Patch Set 9 : Get main and subframe AppCache requests to work #

Patch Set 10 : Integrate with kinuko's change #

Patch Set 11 : Add comments and helper functions #

Total comments: 2

Patch Set 12 : Rebased to tip #

Patch Set 13 : Fix compile failures #

Total comments: 16

Patch Set 14 : Address review comments #

Total comments: 12

Patch Set 15 : Address portions of the review comments #

Total comments: 6

Patch Set 16 : Remove the Delegate interface #

Patch Set 17 : Remove unnecessary includes and references #

Patch Set 18 : Revert changes to AppCacheNavigationHandleCore #

Patch Set 19 : Remove callback.h #

Patch Set 20 : Rebased to tip #

Patch Set 21 : Fix compile failures #

Patch Set 22 : Rebase to fix patch update redness #

Patch Set 23 : Fix compile #

Patch Set 24 : Replace Binding with AssociatedBinding #

Patch Set 25 : Remove unused members and parameters like AppCacheService from the factory #

Patch Set 26 : Another attempt at fixing redness #

Total comments: 8

Patch Set 27 : Address review comments #

Patch Set 28 : Avoid using StrongBindingSet in the AppCache factory as each instance services only one client. #

Patch Set 29 : Use weak pointers and DeleteSoon in the job and the factory #

Total comments: 37

Patch Set 30 : Address next round of review comments #

Patch Set 31 : Invoke the loader callback from the job #

Patch Set 32 : Rebase to tip to sync to the independent URLLoader patch for browser navigation #

Total comments: 6

Patch Set 33 : Address review comments #

Patch Set 34 : Use weak ptr in the url loader job through out. #

Total comments: 38

Patch Set 35 : Address next round of review comments #

Total comments: 12

Patch Set 36 : Add rudimentary support for DeliverErrorResponse(). This will crash if we don't have a valid URLLoa… #

Patch Set 37 : Add weakptr support to AppCacheStorage and provide a way to return the weakptr. #

Total comments: 4

Patch Set 38 : Address review comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+554 lines, -274 lines) Patch
M content/browser/appcache/appcache_job.h View 1 2 3 4 5 6 7 8 9 10 11 3 chunks +18 lines, -5 lines 0 comments Download
M content/browser/appcache/appcache_job.cc View 1 2 3 4 5 6 7 8 9 10 11 3 chunks +26 lines, -2 lines 0 comments Download
M content/browser/appcache/appcache_request_handler.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 26 27 28 29 30 31 32 33 34 6 chunks +22 lines, -1 line 0 comments Download
M content/browser/appcache/appcache_request_handler.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 26 27 28 29 30 31 32 33 34 4 chunks +43 lines, -1 line 0 comments Download
M content/browser/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 24 25 26 27 28 29 30 31 32 33 34 35 36 4 chunks +11 lines, -0 lines 0 comments Download
M content/browser/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 24 25 26 27 28 29 30 31 32 33 34 35 36 2 chunks +9 lines, -3 lines 0 comments Download
M content/browser/appcache/appcache_storage_impl.h View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download
M content/browser/appcache/appcache_storage_impl.cc View 1 2 3 4 1 chunk +4 lines, -0 lines 0 comments Download
M content/browser/appcache/appcache_url_loader_factory.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 26 27 28 29 30 3 chunks +15 lines, -15 lines 0 comments Download
M content/browser/appcache/appcache_url_loader_factory.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 26 27 28 29 30 3 chunks +23 lines, -141 lines 0 comments Download
M content/browser/appcache/appcache_url_loader_job.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 26 27 28 29 30 31 32 33 34 35 36 2 chunks +96 lines, -10 lines 0 comments Download
M content/browser/appcache/appcache_url_loader_job.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 26 27 28 29 30 31 32 33 34 35 36 37 1 chunk +259 lines, -22 lines 0 comments Download
M content/browser/appcache/appcache_url_loader_request.h View 1 2 chunks +3 lines, -4 lines 0 comments Download
M content/browser/appcache/appcache_url_loader_request.cc View 2 chunks +9 lines, -9 lines 0 comments Download
M content/browser/appcache/appcache_url_request_job.h View 1 2 3 4 5 6 7 8 3 chunks +0 lines, -14 lines 0 comments Download
M content/browser/appcache/appcache_url_request_job.cc View 1 2 3 4 5 6 7 8 2 chunks +0 lines, -22 lines 0 comments Download
M content/browser/appcache/mock_appcache_storage.h View 1 2 3 4 5 1 chunk +1 line, -0 lines 0 comments Download
M content/browser/appcache/mock_appcache_storage.cc View 1 2 3 4 5 6 1 chunk +4 lines, -0 lines 0 comments Download
M content/browser/loader/navigation_url_loader_network_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 25 26 27 28 29 30 31 32 33 34 2 chunks +6 lines, -1 line 0 comments Download
M content/browser/url_loader_factory_getter.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 2 chunks +2 lines, -10 lines 0 comments Download
M content/browser/url_loader_factory_getter.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 26 27 28 29 30 3 chunks +2 lines, -14 lines 0 comments Download

Messages

Total messages: 166 (124 generated)
ananta
3 years, 7 months ago (2017-05-23 01:53:47 UTC) #2
ananta
+jam for content changes
3 years, 7 months ago (2017-05-23 20:41:42 UTC) #13
michaeln
https://codereview.chromium.org/2902653002/diff/60001/content/browser/appcache/appcache_url_loader_factory.cc File content/browser/appcache/appcache_url_loader_factory.cc (right): https://codereview.chromium.org/2902653002/diff/60001/content/browser/appcache/appcache_url_loader_factory.cc#newcode30 content/browser/appcache/appcache_url_loader_factory.cc:30: AppCacheHost* g_host = nullptr; I don't think we should ...
3 years, 7 months ago (2017-05-24 00:59:32 UTC) #14
ananta
https://codereview.chromium.org/2902653002/diff/60001/content/browser/appcache/appcache_url_loader_factory.cc File content/browser/appcache/appcache_url_loader_factory.cc (right): https://codereview.chromium.org/2902653002/diff/60001/content/browser/appcache/appcache_url_loader_factory.cc#newcode30 content/browser/appcache/appcache_url_loader_factory.cc:30: AppCacheHost* g_host = nullptr; On 2017/05/24 00:59:32, michaeln wrote: ...
3 years, 7 months ago (2017-05-24 02:14:03 UTC) #15
kinuko
On 2017/05/24 02:14:03, ananta wrote: > https://codereview.chromium.org/2902653002/diff/60001/content/browser/appcache/appcache_url_loader_factory.cc > File content/browser/appcache/appcache_url_loader_factory.cc (right): > > https://codereview.chromium.org/2902653002/diff/60001/content/browser/appcache/appcache_url_loader_factory.cc#newcode30 > ...
3 years, 7 months ago (2017-05-24 03:03:20 UTC) #20
jam
I'm still curious whether it's beneficial to keep landing a bunch of small cls that ...
3 years, 7 months ago (2017-05-24 15:29:03 UTC) #33
ananta
On 2017/05/24 15:29:03, jam wrote: > I'm still curious whether it's beneficial to keep landing ...
3 years, 7 months ago (2017-05-25 00:34:07 UTC) #34
ananta
We have main and subframe AppCache requests now working. Please note that the AppCache factory ...
3 years, 7 months ago (2017-05-27 02:25:34 UTC) #36
kinuko
On 2017/05/27 02:25:34, ananta wrote: > We have main and subframe AppCache requests now working. ...
3 years, 6 months ago (2017-05-29 14:58:40 UTC) #42
ananta
This patchset is now integrated with kinuko's change. Works for main and subframes.
3 years, 6 months ago (2017-05-31 21:05:52 UTC) #44
jam
https://codereview.chromium.org/2902653002/diff/240001/content/browser/appcache/appcache_url_loader_factory.cc File content/browser/appcache/appcache_url_loader_factory.cc (right): https://codereview.chromium.org/2902653002/diff/240001/content/browser/appcache/appcache_url_loader_factory.cc#newcode34 content/browser/appcache/appcache_url_loader_factory.cc:34: // service URL loads from the AppCache. It is ...
3 years, 6 months ago (2017-06-01 15:00:46 UTC) #57
ananta
https://codereview.chromium.org/2902653002/diff/240001/content/browser/appcache/appcache_url_loader_factory.cc File content/browser/appcache/appcache_url_loader_factory.cc (right): https://codereview.chromium.org/2902653002/diff/240001/content/browser/appcache/appcache_url_loader_factory.cc#newcode34 content/browser/appcache/appcache_url_loader_factory.cc:34: // service URL loads from the AppCache. It is ...
3 years, 6 months ago (2017-06-01 17:28:01 UTC) #58
ananta
https://codereview.chromium.org/2902653002/diff/240001/content/browser/appcache/appcache_url_loader_factory.cc File content/browser/appcache/appcache_url_loader_factory.cc (right): https://codereview.chromium.org/2902653002/diff/240001/content/browser/appcache/appcache_url_loader_factory.cc#newcode34 content/browser/appcache/appcache_url_loader_factory.cc:34: // service URL loads from the AppCache. It is ...
3 years, 6 months ago (2017-06-01 17:37:16 UTC) #61
michaeln
cc'ing kinuko so we can keep appcache and sw looking similar where we can https://codereview.chromium.org/2902653002/diff/200001/content/browser/appcache/appcache_url_loader_factory.cc ...
3 years, 6 months ago (2017-06-02 01:18:00 UTC) #64
ananta
On 2017/06/02 01:18:00, michaeln wrote: > cc'ing kinuko so we can keep appcache and sw ...
3 years, 6 months ago (2017-06-02 01:34:47 UTC) #65
ananta
The URLLoaderFactory interface is designed to hand out URL loader instances as needed. This enables ...
3 years, 6 months ago (2017-06-02 01:51:48 UTC) #66
ananta
Hi Michael I will stop by tomorrow to talk through your suggestions before we move ...
3 years, 6 months ago (2017-06-02 03:19:58 UTC) #67
michaeln
On 2017/06/02 01:51:48, ananta wrote: > The URLLoaderFactory interface is designed to hand out URL ...
3 years, 6 months ago (2017-06-02 19:21:05 UTC) #72
michaeln
https://codereview.chromium.org/2902653002/diff/270001/content/browser/appcache/appcache_request_handler.cc File content/browser/appcache/appcache_request_handler.cc (right): https://codereview.chromium.org/2902653002/diff/270001/content/browser/appcache/appcache_request_handler.cc#newcode329 content/browser/appcache/appcache_request_handler.cc:329: if (service_->storage()->IsInitialized() && Please use the storage() method to ...
3 years, 6 months ago (2017-06-02 23:47:28 UTC) #73
ananta
https://codereview.chromium.org/2902653002/diff/240001/content/browser/loader/navigation_url_loader_network_service.cc File content/browser/loader/navigation_url_loader_network_service.cc (right): https://codereview.chromium.org/2902653002/diff/240001/content/browser/loader/navigation_url_loader_network_service.cc#newcode134 content/browser/loader/navigation_url_loader_network_service.cc:134: AppCacheURLLoaderFactory::CreateRequestHandler( On 2017/06/02 01:17:59, michaeln wrote: > I'd vote ...
3 years, 6 months ago (2017-06-03 01:55:56 UTC) #75
kinuko
Thanks michealn for driving this review, I just skimmed through some bits but I think ...
3 years, 6 months ago (2017-06-06 08:07:31 UTC) #109
ananta
https://codereview.chromium.org/2902653002/diff/490001/content/browser/appcache/appcache_request_handler.cc File content/browser/appcache/appcache_request_handler.cc (right): https://codereview.chromium.org/2902653002/diff/490001/content/browser/appcache/appcache_request_handler.cc#newcode556 content/browser/appcache/appcache_request_handler.cc:556: LoaderFactoryCallback callback) { On 2017/06/06 08:07:30, kinuko wrote: > ...
3 years, 6 months ago (2017-06-06 20:49:16 UTC) #112
jam
https://codereview.chromium.org/2902653002/diff/550001/content/browser/appcache/appcache_request_handler.cc File content/browser/appcache/appcache_request_handler.cc (right): https://codereview.chromium.org/2902653002/diff/550001/content/browser/appcache/appcache_request_handler.cc#newcode238 content/browser/appcache/appcache_request_handler.cc:238: std::unique_ptr<AppCacheRequestHandler> handler = I thought an earlier patchset didn't ...
3 years, 6 months ago (2017-06-07 01:42:17 UTC) #119
michaeln
https://codereview.chromium.org/2902653002/diff/550001/content/browser/appcache/appcache_request_handler.cc File content/browser/appcache/appcache_request_handler.cc (right): https://codereview.chromium.org/2902653002/diff/550001/content/browser/appcache/appcache_request_handler.cc#newcode238 content/browser/appcache/appcache_request_handler.cc:238: std::unique_ptr<AppCacheRequestHandler> handler = On 2017/06/07 01:42:17, jam wrote: > ...
3 years, 6 months ago (2017-06-07 02:53:46 UTC) #120
ananta
https://codereview.chromium.org/2902653002/diff/550001/content/browser/appcache/appcache_request_handler.cc File content/browser/appcache/appcache_request_handler.cc (right): https://codereview.chromium.org/2902653002/diff/550001/content/browser/appcache/appcache_request_handler.cc#newcode238 content/browser/appcache/appcache_request_handler.cc:238: std::unique_ptr<AppCacheRequestHandler> handler = On 2017/06/07 01:42:17, jam wrote: > ...
3 years, 6 months ago (2017-06-07 20:57:17 UTC) #121
michaeln
i think i see how we could put more of the UrlLoader specific logic inside ...
3 years, 6 months ago (2017-06-08 02:54:01 UTC) #130
ananta
https://codereview.chromium.org/2902653002/diff/550001/content/browser/appcache/appcache_request_handler.cc File content/browser/appcache/appcache_request_handler.cc (right): https://codereview.chromium.org/2902653002/diff/550001/content/browser/appcache/appcache_request_handler.cc#newcode291 content/browser/appcache/appcache_request_handler.cc:291: std::move(loader_factory_callback_).Run(appcache_factory_.get()); On 2017/06/08 02:54:00, michaeln wrote: > On 2017/06/07 ...
3 years, 6 months ago (2017-06-08 05:58:40 UTC) #133
kinuko
(nits only, thanks for rebasing) https://codereview.chromium.org/2902653002/diff/610001/content/browser/appcache/appcache_request_handler.cc File content/browser/appcache/appcache_request_handler.cc (right): https://codereview.chromium.org/2902653002/diff/610001/content/browser/appcache/appcache_request_handler.cc#newcode548 content/browser/appcache/appcache_request_handler.cc:548: std::move(callback)); nit: for readability ...
3 years, 6 months ago (2017-06-08 10:31:21 UTC) #136
ananta
https://codereview.chromium.org/2902653002/diff/610001/content/browser/appcache/appcache_request_handler.cc File content/browser/appcache/appcache_request_handler.cc (right): https://codereview.chromium.org/2902653002/diff/610001/content/browser/appcache/appcache_request_handler.cc#newcode548 content/browser/appcache/appcache_request_handler.cc:548: std::move(callback)); On 2017/06/08 10:31:21, kinuko wrote: > nit: for ...
3 years, 6 months ago (2017-06-08 13:48:56 UTC) #137
michaeln
I think this is very close, please take a close look at BlobURLLoader and try ...
3 years, 6 months ago (2017-06-09 01:48:30 UTC) #144
michaeln
also, please update CL desc to match the code
3 years, 6 months ago (2017-06-09 01:49:35 UTC) #145
michaeln
https://codereview.chromium.org/2902653002/diff/650001/content/browser/appcache/appcache_url_loader_job.cc File content/browser/appcache/appcache_url_loader_job.cc (right): https://codereview.chromium.org/2902653002/diff/650001/content/browser/appcache/appcache_url_loader_job.cc#newcode35 content/browser/appcache/appcache_url_loader_job.cc:35: storage_->LoadResponseInfo(manifest_url_, entry_.response_id(), this); Unfortunately, the rawptr is a problem ...
3 years, 6 months ago (2017-06-09 02:06:18 UTC) #146
ananta
I will take a look at moving the common code for asynchronous reading and writing ...
3 years, 6 months ago (2017-06-09 04:48:19 UTC) #148
ananta
On 2017/06/09 04:48:19, ananta wrote: > I will take a look at moving the common ...
3 years, 6 months ago (2017-06-09 14:31:17 UTC) #153
jam
lgtm, I defer to Michael for the AppCache specific code. I mostly looked at the ...
3 years, 6 months ago (2017-06-09 15:27:33 UTC) #154
michaeln
lgtm, but please see comments about the storage ptr handling, there are some crashes waiting ...
3 years, 6 months ago (2017-06-09 19:59:54 UTC) #155
ananta
I added weak pointer support to AppCacheStorage and used it in the AppCacheURLLoaderJob. Please take ...
3 years, 6 months ago (2017-06-09 20:39:33 UTC) #157
michaeln
still lgtm https://codereview.chromium.org/2902653002/diff/690002/content/browser/appcache/appcache_url_loader_job.cc File content/browser/appcache/appcache_url_loader_job.cc (right): https://codereview.chromium.org/2902653002/diff/690002/content/browser/appcache/appcache_url_loader_job.cc#newcode31 content/browser/appcache/appcache_url_loader_job.cc:31: // connection at this point though. probably ...
3 years, 6 months ago (2017-06-09 21:49:00 UTC) #158
ananta
https://codereview.chromium.org/2902653002/diff/690002/content/browser/appcache/appcache_url_loader_job.cc File content/browser/appcache/appcache_url_loader_job.cc (right): https://codereview.chromium.org/2902653002/diff/690002/content/browser/appcache/appcache_url_loader_job.cc#newcode31 content/browser/appcache/appcache_url_loader_job.cc:31: // connection at this point though. On 2017/06/09 21:49:00, ...
3 years, 6 months ago (2017-06-09 22:16:53 UTC) #159
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/2902653002/710001
3 years, 6 months ago (2017-06-09 22:25:39 UTC) #162
commit-bot: I haz the power
Committed patchset #38 (id:710001) as https://chromium.googlesource.com/chromium/src/+/a2c8ec6149d02d7cfe9389d9739236ed06571a6a
3 years, 6 months ago (2017-06-09 23:44:25 UTC) #165
kinuko
3 years, 6 months ago (2017-06-13 07:50:35 UTC) #166
Message was sent while issue was closed.
lgtm

Powered by Google App Engine
This is Rietveld 408576698