Chrome no longer supports FTP, meaning that view-source: no longer does
anything reasonable for view-source URLs. Remove FTP from the list of
protocols supported by view-source.
Bug: 333943
Change-Id: I99f19d026da48ad7e519a69682926ad8e65e3c20
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3262499
Reviewed-by: Nasko Oskov <nasko@chromium.org>
Commit-Queue: Eric Lawrence [MSFT] <ericlaw@microsoft.com>
Cr-Commit-Position: refs/heads/main@{#939543}
base::size() has been moved to base/cxx17_backports.h, so .cc files that
use base::size(), but no other function from base/stl_util.h, can
directly include base/cxx17_backports.h and not base/stl_util.h.
Bug: 1210983
Change-Id: I42a598a9c2b8fcbfd1e225329109ae3308bd9518
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2915348
Reviewed-by: Camille Lamy <clamy@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/master@{#886358}
This CL moves HandleRendererDebugURL method from content.mojom.Frame
to blink.mojom.LocalFrame Mojo interface.
- Move LoadJavaScriptURL from WebLocalFrameClient to LocalFrame.
- Make LocalFrame implement HandleRendererDebugURL.
- Add ProcessChromeDebugURL/IsURLForRendererDebug methods to Platform.h
in order to call them in blink LocalFrame.
Bug: 1192241
Change-Id: Ia128ce4d5c3299098d7ddca02404da66474ac831
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2805735
Reviewed-by: Dave Tapuska <dtapuska@chromium.org>
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Reviewed-by: David Roger <droger@chromium.org>
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Reviewed-by: Robert Sesek <rsesek@chromium.org>
Reviewed-by: Peter Kvitek <kvitekp@chromium.org>
Commit-Queue: Gyuyoung Kim <gyuyoung@igalia.com>
Cr-Commit-Position: refs/heads/master@{#871738}
Motivation for this CL
======================
Before this CL url_formatter::FixupURL could transform URLs of
renderer-initiated navigations. This may have allowed an attacker to
"launder" URLs past early filters (if the initial URL provided by the
attacker looks benign, but after passing the filters is transformed by
FixupURL into a malicious form). The following bugs in the past seem to
have been at least partially enabled by this transformation:
- Laundering a "javascript:" URL:
https://crbug.com/1116280 and https://crbug.com/850824
- Omnibox spoof due to the modified url:
https://crbug.com/449829 and https://crbug.com/657720
- Invariant violation due to a difference between virtual url and
regular url: https://crbug.com/895065
Before this CL, url_formatter::FixupURL was called for
renderer-initiated navigations via WillHandleBrowserAboutURL. This
doesn’t seem necessary per the TODO in this function asking to
"Eliminate "about:*" constants [...] then hopefully we can remove this
forced fixup".
Note that BrowserURLHandler::SetFixupHandler has been introduced in
r316923 as a workaround to ensure URL consistency by adding FixupURL in
one more place. If FixupURL wouldn’t be called from
WillHandleBrowserAboutURL, then BrowserURLHandler::SetFixupHandler
wouldn’t be needed in the first place.
Finally, https://crbug.com/1130091#c3 points out that
url_formatter::FixupURL should only be invoked on user input (e.g. URLs
typed into the omnibox and used for browser-initiated navigations)
rather than on arbitrary URLs.
Summary of changes in this CL
=============================
Based on the above, the CL:
- Removes the FixupBrowserAboutURL call from WillHandleBrowserAboutURL
- Removes the BrowserURLHandler::SetFixupHandler method and related code
- Fixes tests so that they use the final URL form (rather than relying
on the FixupURL call)
- Adjusting expectations of tests that were testing laundering scenarios
The CL also opportunistically:
- Simplifies WillHandleBrowserAboutURL (path transformations were a
no-op; early return for kChromeUISettingsHost and kChromeUIHelpHost
can be consolidated)
Testing
=======
Manual testing:
- Verified that "about:version" typed into the omnibox still ends up
navigating to "chrome://version/"
- Verified that renderer-initiated navigations to "about:version" are
translated into "about:blank#blocked" by
RenderProcessHostImpl::FilterURL
Bug: 1130091
Change-Id: I9a9f32d4d9c0ec630c2110679efe0c1d18b4370b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2441284
Reviewed-by: Charlie Reis <creis@chromium.org>
Reviewed-by: Peter Kasting <pkasting@chromium.org>
Commit-Queue: Łukasz Anforowicz <lukasza@chromium.org>
Cr-Commit-Position: refs/heads/master@{#818969}
This CL changes BrowserURLHandlerImpl::RewriteURLIfNecessary so that it
returns early(and doesn't mutate the |url| in the in-out argument) if
|url| is invalid. This helps avoid scenarios where
RewriteUrlForNavigation (in navigation_controller_impl.cc) ends up
generating a NavigationEntry with an invalid virtual URL that
(accidentally/incorrectly) gets rewritten into a valid URL.
Bug: 1116280
Change-Id: I114cf8c8d9459b6931ae659f62a100679b994d5e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2385921
Reviewed-by: Alex Moshchuk <alexmos@chromium.org>
Commit-Queue: Łukasz Anforowicz <lukasza@chromium.org>
Cr-Commit-Position: refs/heads/master@{#809537}
If the NTP was overridden from its default state with Google as the
search provider, show a branded dialog and custom message to the user.
This requires a bit of code acrobatics in order to determine what the
previous NTP and search engine will be. In particular, we need to:
1) Determine if the default search is Google
2) Determine if the default NTP is the "secondary" NTP
1) is relatively straightforward; 2) is more complicated. The NTP can
be overridden by several different sources (extensions, policies, or
a different default search provider). In order to accommodate this,
introduce BrowserURLHandler::GetPossibleRewrites(), which iterates over
all rewriters and accumulates the list of rewrites that would happen.
This, in conjunction with also checking for multiple NTP overriding
extensions, allows us to check if the default NTP would be used if the
overriding extension were removed.
Add tests for various pieces:
- BrowserURLHandler::GetPossibleRewrites()
- ExtensionWebUI::GetNumberOfExtensionsOverridingURL()
- The dialog params generated when a non-default search is selected
- The dialog params generated when multiple NTP-overriding extensions
are installed
- UI browser tests for both the generic and the default-specific
dialogs.
Bug: 1079364
Change-Id: I6d37eb8fa85cd824155a9907253a57f1d8cfd51c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2202156
Commit-Queue: Devlin <rdevlin.cronin@chromium.org>
Reviewed-by: Elly Fong-Jones <ellyjones@chromium.org>
Reviewed-by: Brian White <bcwhite@chromium.org>
Reviewed-by: Alex Moshchuk <alexmos@chromium.org>
Cr-Commit-Position: refs/heads/master@{#774653}
This CL removes the |reverse_on_redirect| out parameter from the
//content-public version of the BrowserURLHandler::RewriteURLIfNecessary
method. This is justified by the fact that outside of //content all
callers of that method would ignore this out parameter.
The CL keeps the |reverse_on_redirect| in the //content-internal
overload of the method in BrowserURLHandlerImpl, because the
|reverse_on_redirect| out parameter is used from the
NavigationControllerImpl code.
This CL is intended to be pure refactoring and should introduce no
behavior changes. This is followup from discussion in r735048.
Bug: 1029161
Change-Id: I4d4322495604d7d67ddf22668eeab33c70fe0cf6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1993724
Commit-Queue: Łukasz Anforowicz <lukasza@chromium.org>
Reviewed-by: Charlie Reis <creis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#735175}
This reduces the number of preprocessor tokens in
content_browser_client.h from 1,335,281 to 754,474. Since this is a
widely included file, reducing build times a fair bit (see bug).
TBR=tsepez for content/browser/child_process_security_policy_*
Bug: 1014009
Change-Id: Id3c2de29f5b08cab80820d01aff722afeb1618e6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1857126
Commit-Queue: Hans Wennborg <hans@chromium.org>
Reviewed-by: Richard Coles <torne@chromium.org>
Reviewed-by: Ken Rockot <rockot@google.com>
Reviewed-by: Nico Weber <thakis@chromium.org>
Reviewed-by: Camille Lamy <clamy@chromium.org>
Reviewed-by: Sami Kyöstilä <skyostil@chromium.org>
Cr-Commit-Position: refs/heads/master@{#706388}
This CL makes sure we do not attempt to rewrite a subframe navigation URL in
should only be performed on main frame navigations.
NavigationControllerImpl: :CreateNavigationRequestFromLoadParams. Rewrites
Bug: 895065, 803859, 896028
Change-Id: I2a2326d802b55655d59f0c6d3d73e3060c58152b
Reviewed-on: https://chromium-review.googlesource.com/c/1282992
Commit-Queue: Charlie Reis <creis@chromium.org>
Reviewed-by: Charlie Reis <creis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#601183}
Sending renderer debug URLs to the network stack will result in trying
to commit an error page, which is when the debug URL will actually be
handled. This causing issues when trying to block them.
This CL also ensures that debug URLs will never commit.
BUG=776528,760732
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_site_isolation
Change-Id: Iaae35029e5fcd0b66c470468a8f90ca9736fff3e
Reviewed-on: https://chromium-review.googlesource.com/731083
Commit-Queue: Charlie Reis <creis@chromium.org>
Reviewed-by: Ned Nguyen <nednguyen@google.com>
Reviewed-by: Charlie Reis <creis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#517157}
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}
Public APIs from base should live inside base:: so moved Singleton class
and structs to base{} and fixed consumers.
also fixed:
** Presubmit ERRORS **
Found Singleton<T> in the following header files.
Please move them to an appropriate source file so that the template
gets instantiated in a single compilation unit.
chrome/browser/plugins/plugin_finder.h \
chromecast/media/base/media_message_loop.h \
content/browser/media/android/media_drm_credential_manager.h
Presubmit warnings:
src/chrome/browser/extensions/warning_badge_service_factory.h:5:
#ifndef header guard has wrong style, please use:
CHROME_BROWSER_EXTENSIONS_WARNING_BADGE_SERVICE_FACTORY_H_
[build/header_guard] [5]
src/chrome/browser/extensions/warning_badge_service_factory.h:39:
#endif line should be "#endif //
CHROME_BROWSER_EXTENSIONS_WARNING_BADGE_SERVICE_FACTORY_H_"
[build/header_guard] [5]
TBR=jam@chromium.org
Review URL: https://codereview.chromium.org/1308823002
Cr-Commit-Position: refs/heads/master@{#348136}
Uses BrowserURLHandler since this depends on components and can't
live in content.
BUG=449829
TEST=See bug for repro steps.
Review URL: https://codereview.chromium.org/923183003
Cr-Commit-Position: refs/heads/master@{#316923}
BUG=336846
The logic to create a view-source URL from a non-view-source URL has
the incorrect assumption that the URL path includes both the query and the
fragment parts. This causes these parts to be repeated after the
transformation.
Review URL: https://codereview.chromium.org/655023002
Cr-Commit-Position: refs/heads/master@{#299752}
Previously Telemetry enabled navigation to Debug URLs by adding a custom
URL handler. However, URL handlers can be called multiple times per
Navigation, and Debug URL actions must happen only once.
This CL enables Telemetry URL handling to be done by the normal
NavigationControllerImpl::LoadURLWithParams() to HandleDebugURL() path.
This also removes the prior workaround added in crrev.com/277113002 .
BUG=395326
Review URL: https://codereview.chromium.org/418733002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@286117 0039d316-1c4b-4281-b951-d872f2087c98
kAboutScheme and kAboutBlankURL are used in code shared by iOS, and are general
enough to live in //url instead of //content.
TBR=yoz,benm
Review URL: https://codereview.chromium.org/325443002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@275988 0039d316-1c4b-4281-b951-d872f2087c98
This patch moves the kEnableGpuBenchmarking switch from
content switches to cc switches for it to be accessible from
ui/compositor/compositor.cc.
If the flag is set, the browser compositor enalbes recording of rendering
stats in its constructor. The recorded stats will be used by a follow-up patch
that switches smoothness benchmark to use time stamps from the browser
compositor when available.
R=piman@chromium.org,nduca@chromium.org
BUG=340747
Review URL: https://codereview.chromium.org/148983007
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@249307 0039d316-1c4b-4281-b951-d872f2087c98
This adds the scheme chrome-distiller:// and has a minimal implementation
of a data source which should be loaded when a URL with the new scheme is
loaded.
The chrome-distiller:// scheme will be used for displaying distilled
articles, which is extracted content of web pages with long form articles.
Chrome will maintain a list of such articles, and in addition, the user
will be able to display such distilled content on demand for a given URL.
BUG=319881
Review URL: https://codereview.chromium.org/105723002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@247187 0039d316-1c4b-4281-b951-d872f2087c98
This CL moves all frame tree classes, Navigation* and its dependencies from web_contents/ to a separate frame_host/ directory.
BUG=304341
Review URL: https://codereview.chromium.org/49823002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@231921 0039d316-1c4b-4281-b951-d872f2087c98
Adds a new GURL::GetContent() to retrieve the text after scheme: specifically
intended for use in non-hierarchical schemes (data: etc).
Doing the first part of https://codereview.chromium.org/23835019/
in a preparation CL.
BUG=291747
Review URL: https://codereview.chromium.org/23549039
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@230781 0039d316-1c4b-4281-b951-d872f2087c98
Added command line argument for disabling the WebGL infobar, required
for automated recovery from context loss. Added browser-side handling
of debug URLs for navigations coming from Telemetry, covered under
existing --enable-gpu-benchmarking command line argument.
BUG=308675
R=dtu@chromium.org, jam@chromium.org, zmo@chromium.org
Review URL: https://codereview.chromium.org/27603004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@229255 0039d316-1c4b-4281-b951-d872f2087c98
Fixed most of the files found with the following command line:
$ git grep --files-without-match --name-only "namespace content {" -- content/browser/{*.cc,*.h.*.mm}
R=jam@chromium.org
Review URL: https://codereview.chromium.org/11274038
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@164120 0039d316-1c4b-4281-b951-d872f2087c98