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

Issue 2740013008: Fix tab restore for view-source Chrome extension pages. (Closed)

Created:
3 years, 9 months ago by alexmos
Modified:
3 years, 9 months ago
CC:
chromium-reviews, darin-cc_chromium.org, Avi (use Gerrit), jam, creis+watch_chromium.org, ajwong+watch_chromium.org, site-isolation-reviews_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Fix tab restore for view-source Chrome extension pages. Previously, for non-web-accessible pages, this was blocked by the check in ShouldAllowOpenURL, and generated a DumpWithoutCrashing report because the source SiteInstance ("about:") was not HTTP/HTTPS/extension and the target URL was not a WAR. The source SiteInstance was wrong because content::HandleViewSource disallowed view-source navigations to the chrome-extension scheme and overwrote the destination URL to about:blank. See full analysis in issue 699428. The fix adds chrome-extension to the list of schemes allowed for view-source. It also fixes an issue where the restored view-source tab's visible URL ended up at chrome://bookmarks, rather than view-source:chrome-extension://<bookmark_extension_id>/. BUG=699428, 698709, 696034, 700610 Review-Url: https://codereview.chromium.org/2740013008 Cr-Commit-Position: refs/heads/master@{#457582} Committed: https://chromium.googlesource.com/chromium/src/+/94875b3b4d4a1fc047b99214f30078f3780259f0

Patch Set 1 #

Total comments: 12

Patch Set 2 : Address Charlie's comments #

Total comments: 2

Patch Set 3 : Charlie's nit #

Unified diffs Side-by-side diffs Delta from patch set Stats (+101 lines, -7 lines) Patch
M chrome/browser/chrome_content_browser_client.h View 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/browser/chrome_content_browser_client.cc View 1 chunk +9 lines, -0 lines 0 comments Download
M chrome/browser/tab_contents/view_source_browsertest.cc View 1 3 chunks +73 lines, -0 lines 0 comments Download
M content/browser/browser_url_handler_impl.cc View 1 2 chunks +6 lines, -5 lines 0 comments Download
M content/public/browser/content_browser_client.h View 1 2 1 chunk +6 lines, -2 lines 0 comments Download
M content/public/browser/content_browser_client.cc View 1 1 chunk +5 lines, -0 lines 0 comments Download

Messages

Total messages: 22 (13 generated)
alexmos
Charlie, can you please take a look? This just adds chrome-extension to the list of ...
3 years, 9 months ago (2017-03-11 02:12:26 UTC) #6
Charlie Reis
Yes, seems like the right thing to do. LGTM with some thoughts below. Thanks! https://codereview.chromium.org/2740013008/diff/1/chrome/browser/chrome_content_browser_client.cc ...
3 years, 9 months ago (2017-03-15 15:03:31 UTC) #8
alexmos
Thanks for reviewing! https://codereview.chromium.org/2740013008/diff/1/chrome/browser/chrome_content_browser_client.cc File chrome/browser/chrome_content_browser_client.cc (right): https://codereview.chromium.org/2740013008/diff/1/chrome/browser/chrome_content_browser_client.cc#newcode1322 chrome/browser/chrome_content_browser_client.cc:1322: additional_schemes->push_back(extensions::kExtensionScheme); On 2017/03/15 15:03:31, Charlie Reis ...
3 years, 9 months ago (2017-03-16 20:07:30 UTC) #11
alexmos
Avi, can you please review chrome/browser/tab_contents/view_source_browsertest.cc for OWNERS?
3 years, 9 months ago (2017-03-16 20:12:31 UTC) #13
Avi (use Gerrit)
lgtm
3 years, 9 months ago (2017-03-16 20:16:10 UTC) #14
Charlie Reis
Thanks! LGTM with nit. https://codereview.chromium.org/2740013008/diff/1/content/browser/browser_url_handler_impl.cc File content/browser/browser_url_handler_impl.cc (right): https://codereview.chromium.org/2740013008/diff/1/content/browser/browser_url_handler_impl.cc#newcode100 content/browser/browser_url_handler_impl.cc:100: AddHandlerPair(&HandleViewSource, &ReverseViewSource); On 2017/03/16 20:07:30, ...
3 years, 9 months ago (2017-03-16 20:26:06 UTC) #15
alexmos
Thanks! https://codereview.chromium.org/2740013008/diff/20001/content/public/browser/content_browser_client.h File content/public/browser/content_browser_client.h (right): https://codereview.chromium.org/2740013008/diff/20001/content/public/browser/content_browser_client.h#newcode223 content/public/browser/content_browser_client.h:223: // Returns a list of additional schemes allowed ...
3 years, 9 months ago (2017-03-16 20:31:01 UTC) #16
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/2740013008/40001
3 years, 9 months ago (2017-03-16 20:32:20 UTC) #19
commit-bot: I haz the power
3 years, 9 months ago (2017-03-16 22:19:46 UTC) #22
Message was sent while issue was closed.
Committed patchset #3 (id:40001) as
https://chromium.googlesource.com/chromium/src/+/94875b3b4d4a1fc047b99214f300...

Powered by Google App Engine
This is Rietveld 408576698