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

Issue 1670673003: Refactor the implementation of the webNavigation extension API. (Closed)

Created:
4 years, 10 months ago by nasko
Modified:
4 years, 10 months ago
Reviewers:
Charlie Reis, Devlin
CC:
chromium-reviews, davidben+watch_chromium.org, extensions-reviews_chromium.org, cbentzel+watch_chromium.org, sadrul, tburkard+watch_chromium.org, gavinp+prer_chromium.org, kalyank, chromium-apps-reviews_chromium.org, site-isolation-reviews_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@Bug-532666-NavigationHandleAPI
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Refactor the implementation of the webNavigation extension API. The webNavigation extension API does not work properly with out-of-process iframes and will be broken with the upcoming changes in navigation code (PlzNavigate). This CL is aiming to refactor the implementation to use the NavigationHandle API, which is compatible with PlzNavigate and helps hide some of the nasty details of cross-process navigations. This CL depends on new APIs added to NavigationHandle in https://codereview.chromium.org/1667163002/. BUG=584493 CQ_INCLUDE_TRYBOTS=tryserver.chromium.linux:linux_site_isolation Committed: https://crrev.com/e419e2171ce22acc291c5c30c251633daeb0740d Cr-Commit-Position: refs/heads/master@{#374505}

Patch Set 1 #

Total comments: 23

Patch Set 2 : Fixes based on Devlin's review. #

Patch Set 3 : Update documentation. #

Patch Set 4 : Reverting the workaround from https://codereview.chromium.org/1656613002. Remove tests from exclusi… #

Total comments: 11

Patch Set 5 : Fixes based on Devlin's review. #

Patch Set 6 : Remove UI thread DCHECKs. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+409 lines, -519 lines) Patch
M chrome/browser/extensions/api/web_navigation/frame_navigation_state.h View 1 5 chunks +12 lines, -26 lines 0 comments Download
M chrome/browser/extensions/api/web_navigation/frame_navigation_state.cc View 1 5 chunks +12 lines, -48 lines 0 comments Download
M chrome/browser/extensions/api/web_navigation/frame_navigation_state_unittest.cc View 10 chunks +28 lines, -18 lines 0 comments Download
M chrome/browser/extensions/api/web_navigation/web_navigation_api.h View 3 chunks +7 lines, -17 lines 0 comments Download
M chrome/browser/extensions/api/web_navigation/web_navigation_api.cc View 1 2 3 4 9 chunks +61 lines, -100 lines 0 comments Download
M chrome/browser/extensions/api/web_navigation/web_navigation_api_helpers.h View 3 chunks +4 lines, -7 lines 0 comments Download
M chrome/browser/extensions/api/web_navigation/web_navigation_api_helpers.cc View 1 8 chunks +120 lines, -99 lines 0 comments Download
M chrome/common/extensions/api/web_navigation.json View 1 2 3 4 2 chunks +10 lines, -2 lines 0 comments Download
M chrome/test/data/extensions/api_test/executescript/http204/background.js View 1 1 chunk +0 lines, -13 lines 0 comments Download
M chrome/test/data/extensions/api_test/webnavigation/api/framework.js View 1 chunk +1 line, -1 line 0 comments Download
M chrome/test/data/extensions/api_test/webnavigation/clientRedirect/framework.js View 1 chunk +1 line, -1 line 0 comments Download
M chrome/test/data/extensions/api_test/webnavigation/clientRedirect/test_clientRedirect.js View 2 chunks +2 lines, -2 lines 0 comments Download
M chrome/test/data/extensions/api_test/webnavigation/crash/framework.js View 1 chunk +1 line, -1 line 0 comments Download
M chrome/test/data/extensions/api_test/webnavigation/crash/test_crash.js View 2 chunks +2 lines, -2 lines 0 comments Download
M chrome/test/data/extensions/api_test/webnavigation/crossProcess/framework.js View 1 chunk +1 line, -1 line 0 comments Download
M chrome/test/data/extensions/api_test/webnavigation/crossProcess/test_crossProcess.js View 11 chunks +17 lines, -36 lines 0 comments Download
M chrome/test/data/extensions/api_test/webnavigation/crossProcessAbort/framework.js View 1 chunk +1 line, -1 line 0 comments Download
M chrome/test/data/extensions/api_test/webnavigation/crossProcessAbort/test_crossProcessAbort.js View 5 chunks +6 lines, -6 lines 0 comments Download
M chrome/test/data/extensions/api_test/webnavigation/crossProcessFragment/framework.js View 1 chunk +1 line, -1 line 0 comments Download
M chrome/test/data/extensions/api_test/webnavigation/crossProcessFragment/test_crossProcessFragment.js View 6 chunks +8 lines, -7 lines 0 comments Download
M chrome/test/data/extensions/api_test/webnavigation/crossProcessHistory/framework.js View 1 chunk +1 line, -1 line 0 comments Download
M chrome/test/data/extensions/api_test/webnavigation/crossProcessHistory/test_crossProcessHistory.js View 8 chunks +10 lines, -9 lines 0 comments Download
M chrome/test/data/extensions/api_test/webnavigation/crossProcessIframe/framework.js View 1 chunk +1 line, -1 line 0 comments Download
M chrome/test/data/extensions/api_test/webnavigation/crossProcessIframe/test_crossProcessIframe.js View 1 5 chunks +7 lines, -47 lines 0 comments Download
M chrome/test/data/extensions/api_test/webnavigation/download/framework.js View 1 chunk +1 line, -1 line 0 comments Download
M chrome/test/data/extensions/api_test/webnavigation/download/test_download.js View 1 chunk +1 line, -1 line 0 comments Download
M chrome/test/data/extensions/api_test/webnavigation/failures/framework.js View 1 chunk +1 line, -1 line 0 comments Download
M chrome/test/data/extensions/api_test/webnavigation/failures/test_failures.js View 10 chunks +10 lines, -10 lines 0 comments Download
M chrome/test/data/extensions/api_test/webnavigation/filtered/framework.js View 1 chunk +1 line, -1 line 0 comments Download
M chrome/test/data/extensions/api_test/webnavigation/forwardBack/framework.js View 1 chunk +1 line, -1 line 0 comments Download
M chrome/test/data/extensions/api_test/webnavigation/forwardBack/test_forwardBack.js View 3 chunks +3 lines, -3 lines 0 comments Download
M chrome/test/data/extensions/api_test/webnavigation/getFrame/framework.js View 1 chunk +1 line, -1 line 0 comments Download
M chrome/test/data/extensions/api_test/webnavigation/history/framework.js View 1 chunk +1 line, -1 line 0 comments Download
M chrome/test/data/extensions/api_test/webnavigation/history/test_history.js View 2 chunks +2 lines, -2 lines 0 comments Download
M chrome/test/data/extensions/api_test/webnavigation/iframe/framework.js View 1 chunk +1 line, -1 line 0 comments Download
M chrome/test/data/extensions/api_test/webnavigation/iframe/test_iframe.js View 10 chunks +10 lines, -10 lines 0 comments Download
M chrome/test/data/extensions/api_test/webnavigation/openTab/framework.js View 1 chunk +1 line, -1 line 0 comments Download
M chrome/test/data/extensions/api_test/webnavigation/openTab/test_openTab.js View 5 chunks +5 lines, -5 lines 0 comments Download
M chrome/test/data/extensions/api_test/webnavigation/prerender/framework.js View 1 chunk +1 line, -1 line 0 comments Download
M chrome/test/data/extensions/api_test/webnavigation/prerender/test_prerender.js View 2 chunks +2 lines, -2 lines 0 comments Download
M chrome/test/data/extensions/api_test/webnavigation/referenceFragment/framework.js View 1 chunk +1 line, -1 line 0 comments Download
M chrome/test/data/extensions/api_test/webnavigation/referenceFragment/test_referenceFragment.js View 1 chunk +1 line, -1 line 0 comments Download
M chrome/test/data/extensions/api_test/webnavigation/requestOpenTab/framework.js View 1 chunk +1 line, -1 line 0 comments Download
M chrome/test/data/extensions/api_test/webnavigation/requestOpenTab/test_requestOpenTab.js View 2 chunks +2 lines, -2 lines 0 comments Download
M chrome/test/data/extensions/api_test/webnavigation/serverRedirect/framework.js View 1 chunk +1 line, -1 line 0 comments Download
M chrome/test/data/extensions/api_test/webnavigation/serverRedirect/test_serverRedirect.js View 1 chunk +1 line, -1 line 0 comments Download
M chrome/test/data/extensions/api_test/webnavigation/serverRedirectSingleProcess/framework.js View 1 chunk +1 line, -1 line 0 comments Download
M chrome/test/data/extensions/api_test/webnavigation/serverRedirectSingleProcess/test_serverRedirectSingleProcess.js View 2 chunks +2 lines, -2 lines 0 comments Download
M chrome/test/data/extensions/api_test/webnavigation/simpleLoad/framework.js View 1 chunk +1 line, -1 line 0 comments Download
M chrome/test/data/extensions/api_test/webnavigation/simpleLoad/test_simpleLoad.js View 1 chunk +1 line, -1 line 0 comments Download
M chrome/test/data/extensions/api_test/webnavigation/srcdoc/framework.js View 1 chunk +1 line, -1 line 0 comments Download
M chrome/test/data/extensions/api_test/webnavigation/srcdoc/test_srcdoc.js View 2 chunks +2 lines, -2 lines 0 comments Download
M chrome/test/data/extensions/api_test/webnavigation/targetBlank/framework.js View 1 chunk +1 line, -1 line 0 comments Download
M chrome/test/data/extensions/api_test/webnavigation/targetBlank/test_targetBlank.js View 2 chunks +2 lines, -2 lines 0 comments Download
M chrome/test/data/extensions/api_test/webnavigation/userAction/framework.js View 1 chunk +1 line, -1 line 0 comments Download
M chrome/test/data/extensions/api_test/webnavigation/userAction/test_userAction.js View 2 chunks +2 lines, -2 lines 0 comments Download
M extensions/browser/extension_api_frame_id_map.h View 1 2 chunks +7 lines, -0 lines 0 comments Download
M extensions/browser/extension_api_frame_id_map.cc View 1 2 3 4 5 3 chunks +25 lines, -4 lines 0 comments Download
M testing/buildbot/filters/isolate-extensions.browser_tests.filter View 1 2 3 1 chunk +0 lines, -3 lines 0 comments Download
M testing/buildbot/filters/site-per-process.browser_tests.filter View 1 2 3 1 chunk +0 lines, -2 lines 0 comments Download

Depends on Patchset:

Messages

Total messages: 24 (11 generated)
nasko
Hey Charlie and Devlin, This CL is the long promised refactor of webNavigation API to ...
4 years, 10 months ago (2016-02-04 23:42:38 UTC) #3
nasko
https://codereview.chromium.org/1670673003/diff/1/chrome/browser/extensions/api/web_navigation/frame_navigation_state.h File chrome/browser/extensions/api/web_navigation/frame_navigation_state.h (right): https://codereview.chromium.org/1670673003/diff/1/chrome/browser/extensions/api/web_navigation/frame_navigation_state.h#newcode25 chrome/browser/extensions/api/web_navigation/frame_navigation_state.h:25: class FrameNavigationState { I renamed this into FrameLoadingState in ...
4 years, 10 months ago (2016-02-05 17:49:31 UTC) #4
Devlin
Should we update the docs to indicate that processId is invalid for these events? https://codereview.chromium.org/1670673003/diff/1/chrome/browser/extensions/api/web_navigation/frame_navigation_state.cc ...
4 years, 10 months ago (2016-02-05 18:30:28 UTC) #5
nasko
Thanks for pointing out the new and improved syntax for generating output for events. It ...
4 years, 10 months ago (2016-02-05 23:41:22 UTC) #6
Devlin
lgtm https://codereview.chromium.org/1670673003/diff/60001/chrome/browser/extensions/api/web_navigation/web_navigation_api.cc File chrome/browser/extensions/api/web_navigation/web_navigation_api.cc (right): https://codereview.chromium.org/1670673003/diff/60001/chrome/browser/extensions/api/web_navigation/web_navigation_api.cc#newcode275 chrome/browser/extensions/api/web_navigation/web_navigation_api.cc:275: if (!FrameNavigationState::IsValidUrl(navigation_handle->GetURL())) nit: combine with above if? https://codereview.chromium.org/1670673003/diff/60001/chrome/common/extensions/api/web_navigation.json ...
4 years, 10 months ago (2016-02-09 17:35:40 UTC) #7
nasko
https://codereview.chromium.org/1670673003/diff/60001/chrome/browser/extensions/api/web_navigation/web_navigation_api.cc File chrome/browser/extensions/api/web_navigation/web_navigation_api.cc (right): https://codereview.chromium.org/1670673003/diff/60001/chrome/browser/extensions/api/web_navigation/web_navigation_api.cc#newcode275 chrome/browser/extensions/api/web_navigation/web_navigation_api.cc:275: if (!FrameNavigationState::IsValidUrl(navigation_handle->GetURL())) On 2016/02/09 17:35:40, Devlin wrote: > nit: ...
4 years, 10 months ago (2016-02-09 17:53:54 UTC) #8
Devlin
https://codereview.chromium.org/1670673003/diff/60001/extensions/browser/extension_api_frame_id_map.cc File extensions/browser/extension_api_frame_id_map.cc (right): https://codereview.chromium.org/1670673003/diff/60001/extensions/browser/extension_api_frame_id_map.cc#newcode84 extensions/browser/extension_api_frame_id_map.cc:84: DCHECK_CURRENTLY_ON(content::BrowserThread::UI); On 2016/02/09 17:53:54, nasko wrote: > On 2016/02/09 ...
4 years, 10 months ago (2016-02-09 18:01:16 UTC) #9
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1670673003/100001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1670673003/100001
4 years, 10 months ago (2016-02-09 18:05:58 UTC) #12
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
4 years, 10 months ago (2016-02-09 20:01:04 UTC) #14
commit-bot: I haz the power
This CL has an open dependency (Issue 1667163002 Patch 60001). Please resolve the dependency and ...
4 years, 10 months ago (2016-02-09 20:09:26 UTC) #18
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1670673003/100001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1670673003/100001
4 years, 10 months ago (2016-02-09 22:19:35 UTC) #20
commit-bot: I haz the power
Committed patchset #6 (id:100001)
4 years, 10 months ago (2016-02-09 22:41:19 UTC) #22
commit-bot: I haz the power
4 years, 10 months ago (2016-02-09 22:43:01 UTC) #24
Message was sent while issue was closed.
Patchset 6 (id:??) landed as
https://crrev.com/e419e2171ce22acc291c5c30c251633daeb0740d
Cr-Commit-Position: refs/heads/master@{#374505}

Powered by Google App Engine
This is Rietveld 408576698