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

Issue 2501343003: PlzNavigate: AppCache support. (Closed)

Created:
4 years, 1 month ago by ananta
Modified:
3 years, 11 months ago
CC:
chromium-reviews, mlamouri+watch-content_chromium.org, creis+watch_chromium.org, nasko+codewatch_chromium.org, jam, Randy Smith (Not in Mondays), darin-cc_chromium.org, blink-worker-reviews_chromium.org, loading-reviews_chromium.org, kinuko+watch, mmenke
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

PlzNavigate: AppCache support michaeln : Please review the AppCache changes. nasko/clamy: Please review the rest of the code. The AppCache system has a concept of host ids, which map to different DOM's being loaded in the renderer. Whenever a navigation is initiated by the renderer we get a new host id which is passed by the appcache code in the renderer via the AppCacheHostMsg_RegisterHost message. This does not work correctly for PlzNavigate as we don't have a renderer when the navigation request is instantiated. To workaround this we generate host ids in the newly newly added AppCacheNavigationHandle class. This class is created on the UI thread and has a counterpart AppCacheNavigationHandleCore on the IO thread. Their lifetimes are controlled by the lifetime of the NavigationHandle class. The host id is eventually passed to the passed to the renderer in the FrameMsg_CommitNavigation IPC in the RequestNavigationParams structure. This eventually is passed to the WebApplicationCacheHostImpl class. This patch adds support for AppCache in PlzNavigate. The main changes are as below: 1. Addition of new classes AppCacheNavigationHandle and AppCacheNavigationHandle core. The AppCacheNavigationHandle class is created when the NavigationHandleImpl::InitAppCacheHandle() method is called. 2. The AppCacheNavigationHandleCore class precreates the AppCacheHost class which is used for HTTP requests until the renderer registers with us. When the navigation is committed this host is passed to the AppCacheBackImpl class via AppCacheDispatcherHost::RegisterPrecreatedHost(). 3. The other AppCache changes are as below: Please note that these changes are all for PlzNavigate. 1. Provide functionality in the AppCacheDispatcherHost class register the precreated host instance This is provided via the function RegisterPrecreatedHost() 2. Provide functionality in the AppCacheHost class to set the AppCacheFrontend pointer. This is required when the precreated host is registered with the AppCacheBackendImpl class. BUG=608375 TEST=manual The test case at http://www.w3schools.com/html/tryit.asp?filename=tryhtml5_html_manifest works fine with PlzNavigate with this patch. CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_site_isolation Committed: https://crrev.com/292a917258e6ce3395a589fe40623d0697df044b Cr-Commit-Position: refs/heads/master@{#436821}

Patch Set 1 #

Patch Set 2 : Revert unnecessary changes #

Patch Set 3 : Fix build error #

Patch Set 4 : Attempt to fix bot redness #

Patch Set 5 : Register the pending host on the IO thread. This should fix linux redness. #

Patch Set 6 : Remove DCHECK. #

Patch Set 7 : Add a new class AppCacheFrameNavigationHandler to handle frame based navigations. This includes reg… #

Patch Set 8 : Fix unittests errors #

Patch Set 9 : Fix build redness #

Patch Set 10 : Attempt to fix unittest failures #

Patch Set 11 : Grab a reference on the weakptr from the main thread to ensure that we don't run into sequence chec… #

Patch Set 12 : Revert changes to webcore_test_database.localstorage #

Patch Set 13 : Attempt to fix browser test and other redness. We need to switch the AppCacheService as well during… #

Patch Set 14 : Remove DCHECKS #

Patch Set 15 : Delete the AppCacheFrameNavigationHandler instance on the IO thread using the traits in the RefCoun… #

Patch Set 16 : Revert changes to content/test/data/dom_storage/webcore_test_database.localstorage #

Patch Set 17 : Fix asan content_unittests failures. #

Patch Set 18 : git cl format #

Patch Set 19 : Remove incorrect DCHECK #

Patch Set 20 : Add DCHECKs for PlzNavigate and fix a double Release problem which caused one unit_test to fail wit… #

Total comments: 27

Patch Set 21 : Make the AppCache changes for PlzNavigate follow the ServiceWorker pattern with a handle and a core… #

Patch Set 22 : General cleanup #

Patch Set 23 : Annotate NavigationParams change with PlzNavigate #

Patch Set 24 : Address review comments #

Patch Set 25 : Fix content_unittests redness. The storage pointer in the AppCacheService is null in tests. #

Patch Set 26 : Rebased to tip #

Patch Set 27 : Fix build errors #

Patch Set 28 : Fix compile errors #

Patch Set 29 : Initialize the AppCacheHost on the IO thread. #

Patch Set 30 : Maintain a refcounted instance of ChromeAppCacheService in the AppCacheNavigationHandleCore instanc… #

Total comments: 14

Patch Set 31 : Address review comments #

Total comments: 4

Patch Set 32 : Retrieve the appcache host id from the DocumentState #

Patch Set 33 : Fix comment #

Patch Set 34 : Rebased to tip and fixed comment #

Patch Set 35 : Rebase to tip correctly #

Total comments: 27

Patch Set 36 : Address review comments #

Patch Set 37 : Fix content_browsertests rednesss #

Total comments: 4

Patch Set 38 : Follow the service worker pattern in how the precreated hosts are registered. #

Patch Set 39 : Cleanup #

Total comments: 8

Patch Set 40 : Address review comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+549 lines, -73 lines) Patch
M content/browser/BUILD.gn 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 1 chunk +4 lines, -0 lines 0 comments Download
M content/browser/appcache/appcache_backend_impl.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 36 37 1 chunk +6 lines, -0 lines 0 comments Download
M content/browser/appcache/appcache_backend_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 24 25 26 27 28 29 30 31 32 33 34 35 36 37 2 chunks +15 lines, -0 lines 0 comments Download
M content/browser/appcache/appcache_dispatcher_host.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 37 38 39 1 chunk +0 lines, -1 line 0 comments Download
M content/browser/appcache/appcache_dispatcher_host.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 38 39 9 chunks +38 lines, -26 lines 0 comments Download
M content/browser/appcache/appcache_host.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 1 chunk +8 lines, -0 lines 0 comments Download
M content/browser/appcache/appcache_interceptor.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 2 chunks +8 lines, -0 lines 0 comments Download
M content/browser/appcache/appcache_interceptor.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 2 chunks +15 lines, -7 lines 0 comments Download
A content/browser/appcache/appcache_navigation_handle.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 1 chunk +79 lines, -0 lines 0 comments Download
A content/browser/appcache/appcache_navigation_handle.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 +41 lines, -0 lines 0 comments Download
A content/browser/appcache/appcache_navigation_handle_core.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 37 1 chunk +80 lines, -0 lines 0 comments Download
A content/browser/appcache/appcache_navigation_handle_core.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 38 39 1 chunk +125 lines, -0 lines 0 comments Download
M content/browser/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 1 chunk +2 lines, -4 lines 0 comments Download
M content/browser/frame_host/navigation_handle_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 25 26 27 28 29 30 31 32 33 34 35 3 chunks +14 lines, -0 lines 0 comments Download
M content/browser/frame_host/navigation_handle_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 24 25 26 27 28 29 30 31 32 33 34 35 36 37 2 chunks +8 lines, -0 lines 0 comments Download
M content/browser/frame_host/navigation_request.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 1 chunk +0 lines, -1 line 0 comments Download
M content/browser/frame_host/navigation_request.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 6 chunks +16 lines, -1 line 0 comments Download
M content/browser/loader/DEPS 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 1 chunk +1 line, -0 lines 0 comments Download
M content/browser/loader/navigation_url_loader.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 2 chunks +2 lines, -0 lines 0 comments Download
M content/browser/loader/navigation_url_loader.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 2 chunks +2 lines, -1 line 0 comments Download
M content/browser/loader/navigation_url_loader_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 25 26 27 28 29 30 31 32 33 2 chunks +2 lines, -0 lines 0 comments Download
M content/browser/loader/navigation_url_loader_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 24 25 26 27 28 29 30 31 32 33 3 chunks +7 lines, -1 line 0 comments Download
M content/browser/loader/navigation_url_loader_impl_core.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 2 chunks +2 lines, -0 lines 0 comments Download
M content/browser/loader/navigation_url_loader_impl_core.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 2 chunks +2 lines, -1 line 0 comments Download
M content/browser/loader/navigation_url_loader_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 26 27 28 29 30 31 32 33 1 chunk +1 line, -1 line 0 comments Download
M content/browser/loader/resource_dispatcher_host_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 25 26 27 28 29 30 31 32 33 2 chunks +3 lines, -1 line 0 comments Download
M content/browser/loader/resource_dispatcher_host_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 24 25 26 27 28 29 30 31 32 33 3 chunks +18 lines, -12 lines 0 comments Download
M content/browser/loader/resource_dispatcher_host_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 26 27 28 29 30 31 32 33 2 chunks +2 lines, -2 lines 0 comments Download
M content/child/appcache/web_application_cache_host_impl.h View 1 chunk +2 lines, -1 line 0 comments Download
M content/child/appcache/web_application_cache_host_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 24 25 26 27 28 29 30 31 32 33 2 chunks +13 lines, -3 lines 0 comments Download
M content/common/frame_messages.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 1 chunk +1 line, -0 lines 0 comments Download
M content/common/navigation_params.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 1 chunk +4 lines, -0 lines 0 comments Download
M content/common/navigation_params.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 3 chunks +5 lines, -2 lines 0 comments Download
M content/renderer/render_frame_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 24 25 26 27 28 29 30 31 32 33 34 35 3 chunks +13 lines, -1 line 0 comments Download
M content/renderer/renderer_webapplicationcachehost_impl.h View 1 chunk +2 lines, -1 line 0 comments Download
M content/renderer/renderer_webapplicationcachehost_impl.cc View 1 chunk +3 lines, -2 lines 0 comments Download
M content/renderer/shared_worker/embedded_shared_worker_stub.cc View 2 chunks +5 lines, -4 lines 0 comments Download

Messages

Total messages: 155 (123 generated)
ananta
4 years, 1 month ago (2016-11-15 21:03:54 UTC) #9
ananta
4 years, 1 month ago (2016-11-16 13:39:37 UTC) #22
dcheng
> The AppCache system has a concept of host ids, which map to different DOM's ...
4 years, 1 month ago (2016-11-16 13:58:16 UTC) #23
ananta
On 2016/11/16 13:58:16, dcheng wrote: > > The AppCache system has a concept of host ...
4 years, 1 month ago (2016-11-17 20:25:31 UTC) #25
ananta
4 years, 1 month ago (2016-11-17 23:07:23 UTC) #33
clamy
Sorry I did not have time to look at it today, but I'll try to ...
4 years, 1 month ago (2016-11-21 17:56:53 UTC) #64
michaeln
i think it'd be good if appcache+plznav integration looked more like serviceworker+plznav ServiceWorkerNavigationHandle is the ...
4 years, 1 month ago (2016-11-22 00:17:27 UTC) #65
ananta
On 2016/11/22 00:17:27, michaeln wrote: > i think it'd be good if appcache+plznav integration looked ...
4 years, 1 month ago (2016-11-22 04:07:03 UTC) #66
ananta
On 2016/11/22 04:07:03, ananta wrote: > On 2016/11/22 00:17:27, michaeln wrote: > > i think ...
4 years ago (2016-11-23 03:42:43 UTC) #68
ananta
https://codereview.chromium.org/2501343003/diff/370001/content/browser/appcache/appcache_backend_impl.cc File content/browser/appcache/appcache_backend_impl.cc (right): https://codereview.chromium.org/2501343003/diff/370001/content/browser/appcache/appcache_backend_impl.cc#newcode21 content/browser/appcache/appcache_backend_impl.cc:21: if (process_id_ != -1) { On 2016/11/22 00:17:27, michaeln ...
4 years ago (2016-11-23 04:05:15 UTC) #69
clamy
Thanks! I haven't reviewed the appcache part, since I'm not familiar with it. The navigation ...
4 years ago (2016-11-25 13:32:24 UTC) #95
ananta
https://codereview.chromium.org/2501343003/diff/590001/content/browser/frame_host/navigation_handle_impl.cc File content/browser/frame_host/navigation_handle_impl.cc (right): https://codereview.chromium.org/2501343003/diff/590001/content/browser/frame_host/navigation_handle_impl.cc#newcode542 content/browser/frame_host/navigation_handle_impl.cc:542: if (appcache_handle_.get()) { On 2016/11/25 13:32:24, clamy (slow) wrote: ...
4 years ago (2016-11-28 21:36:53 UTC) #96
clamy
Thanks! A few comments below. As last time, I'm leaving the appcache part for michaeln ...
4 years ago (2016-11-30 17:40:22 UTC) #101
ananta
https://codereview.chromium.org/2501343003/diff/590001/content/renderer/render_frame_impl.cc File content/renderer/render_frame_impl.cc (right): https://codereview.chromium.org/2501343003/diff/590001/content/renderer/render_frame_impl.cc#newcode5005 content/renderer/render_frame_impl.cc:5005: appcache_host_id_ = request_params.appcache_host_id; On 2016/11/30 17:40:22, clamy (slow) wrote: ...
4 years ago (2016-12-01 05:15:00 UTC) #102
clamy
Thanks! Lgtm. Please wait for michaeln's lgtm for the appcache part before submitting though :). ...
4 years ago (2016-12-01 10:02:47 UTC) #111
michaeln
looks great, thnx for following the ServiceWorker pattern, i have a couple comments but nothing ...
4 years ago (2016-12-03 00:58:59 UTC) #112
ananta
https://codereview.chromium.org/2501343003/diff/690001/content/browser/appcache/appcache_backend_impl.cc File content/browser/appcache/appcache_backend_impl.cc (right): https://codereview.chromium.org/2501343003/diff/690001/content/browser/appcache/appcache_backend_impl.cc#newcode176 content/browser/appcache/appcache_backend_impl.cc:176: hosts_[host->host_id()] = std::move(host); On 2016/12/03 00:58:58, michaeln wrote: > ...
4 years ago (2016-12-03 14:55:04 UTC) #115
ananta
https://codereview.chromium.org/2501343003/diff/690001/content/browser/appcache/appcache_dispatcher_host.cc File content/browser/appcache/appcache_dispatcher_host.cc (right): https://codereview.chromium.org/2501343003/diff/690001/content/browser/appcache/appcache_dispatcher_host.cc#newcode85 content/browser/appcache/appcache_dispatcher_host.cc:85: if ((index != g_process_id_host_map.Get().end()) && index->second == this) On ...
4 years ago (2016-12-03 22:42:35 UTC) #119
michaeln
https://codereview.chromium.org/2501343003/diff/730001/content/browser/appcache/appcache_backend_impl.cc File content/browser/appcache/appcache_backend_impl.cc (right): https://codereview.chromium.org/2501343003/diff/730001/content/browser/appcache/appcache_backend_impl.cc#newcode46 content/browser/appcache/appcache_backend_impl.cc:46: DCHECK(found != pending_hosts_.end()); Since this |id| is given to ...
4 years ago (2016-12-05 21:52:54 UTC) #123
ananta
https://codereview.chromium.org/2501343003/diff/730001/content/browser/appcache/appcache_backend_impl.cc File content/browser/appcache/appcache_backend_impl.cc (right): https://codereview.chromium.org/2501343003/diff/730001/content/browser/appcache/appcache_backend_impl.cc#newcode46 content/browser/appcache/appcache_backend_impl.cc:46: DCHECK(found != pending_hosts_.end()); On 2016/12/05 21:52:54, michaeln wrote: > ...
4 years ago (2016-12-06 01:24:39 UTC) #124
michaeln
lgtm, but please delete that xtra method if its not needed https://codereview.chromium.org/2501343003/diff/770001/content/browser/appcache/appcache_dispatcher_host.cc File content/browser/appcache/appcache_dispatcher_host.cc (right): ...
4 years ago (2016-12-06 21:10:46 UTC) #129
ananta
https://codereview.chromium.org/2501343003/diff/770001/content/browser/appcache/appcache_dispatcher_host.cc File content/browser/appcache/appcache_dispatcher_host.cc (right): https://codereview.chromium.org/2501343003/diff/770001/content/browser/appcache/appcache_dispatcher_host.cc#newcode69 content/browser/appcache/appcache_dispatcher_host.cc:69: void AppCacheDispatcherHost::RegisterPrecreatedHost( On 2016/12/06 21:10:46, michaeln wrote: > is ...
4 years ago (2016-12-06 21:38:06 UTC) #130
michaeln
Thnx for doing this!
4 years ago (2016-12-06 21:44:55 UTC) #133
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/2501343003/790001
4 years ago (2016-12-07 00:17:33 UTC) #138
commit-bot: I haz the power
Try jobs failed on following builders: chromium_presubmit on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presubmit/builds/320021)
4 years ago (2016-12-07 01:05:20 UTC) #140
ananta
+wfh for security owners (frame_messages.h)
4 years ago (2016-12-07 01:11:53 UTC) #142
Will Harris
frame_messages.h lgtm
4 years ago (2016-12-07 01:17:56 UTC) #143
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/2501343003/790001
4 years ago (2016-12-07 01:18:46 UTC) #145
Will Harris
please update the first line of the changelist description to be the patch description as ...
4 years ago (2016-12-07 01:19:01 UTC) #146
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/2501343003/790001
4 years ago (2016-12-07 01:24:09 UTC) #150
commit-bot: I haz the power
Committed patchset #40 (id:790001)
4 years ago (2016-12-07 01:30:08 UTC) #153
commit-bot: I haz the power
4 years ago (2016-12-07 01:32:53 UTC) #155
Message was sent while issue was closed.
Patchset 40 (id:??) landed as
https://crrev.com/292a917258e6ce3395a589fe40623d0697df044b
Cr-Commit-Position: refs/heads/master@{#436821}

Powered by Google App Engine
This is Rietveld 408576698