The canonical bug format is TODO(crbug.com/<id>). TODOs of the
following forms will all be migrated to the new format:
- TODO(crbug.com/<old id>)
- TODO(https://crbug.com/<old id>)
- TODO(crbug/<old id>)
- TODO(crbug/monorail/<old id>)
- TODO(<old id>)
- TODO(issues.chromium.org/<old id>)
- TODO(https://issues.chromium.org/<old id>)
- TODO(https://issues.chromium.org/u/1/issues/<old id>)
- TODO(bugs.chromium.org/<old id>)
Bug id mapping is sourced from go/chrome-on-buganizer-prod-issues.
See go/crbug-todo-migration for details.
#crbug-todo-migration
Bug: b/321899722
Change-Id: Ibc66b8c440e4bcdef414e77fef4d9874d2ea9951
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5493800
Auto-Submit: Alison Gale <agale@chromium.org>
Commit-Queue: Alison Gale <agale@chromium.org>
Reviewed-by: Peter Boström <pbos@chromium.org>
Owners-Override: Alison Gale <agale@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1293330}
The canonical bug format is TODO(crbug.com/<id>). TODOs of the
following forms will all be migrated to the new format:
- TODO(crbug.com/<old id>)
- TODO(https://crbug.com/<old id>)
- TODO(crbug/<old id>)
- TODO(crbug/monorail/<old id>)
- TODO(<old id>)
- TODO(issues.chromium.org/<old id>)
- TODO(https://issues.chromium.org/<old id>)
- TODO(https://issues.chromium.org/u/1/issues/<old id>)
- TODO(bugs.chromium.org/<old id>)
Bug id mapping is sourced from go/chrome-on-buganizer-prod-issues.
See go/crbug-todo-migration for details.
#crbug-todo-migration
Bug: b/321899722
Change-Id: Iee14d10d544e9f0ec046117cc4ec8a55c427adc0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5469947
Reviewed-by: Darryl James <dljames@chromium.org>
Owners-Override: Alison Gale <agale@chromium.org>
Commit-Queue: Alison Gale <agale@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1290838}
With navigation queueing, assigning a RFH for a navigation is deferred
if there is a pending commit RFH and the navigation cannot reuse the
pending commit RFH. However, this means it is not possible to enforce
invariants like "there can only be 1 pending commit navigation at a
time" (which is currently CHECKed in
RenderFrameHostImpl::RecordMetricsForBlockedGetFrameHostAttempt() but
fails in some tests when RenderDocument is enabled)).
This CL drops the exception for when the pending commit RFH could be
reused and just always defers assigning the RFH when a pending commit
RFH is present, to allow a consistent set of invariants to be
maintained during navigation.
Bug: 1220337
Change-Id: I2e819411896d749eeb0c8824fa833e388fb267c0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4805448
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Commit-Queue: Rakina Zata Amni <rakina@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1187656}
Using base::FunctionRef as the callable param for a visitor function
can significantly reduce the boilerplate required to use the visitor
function. It also avoids the heap allocation required to support
base::RepeatingCallback's strong ownership semantics.
The most common transformation in this CL is converting something
like:
rfh->ForEachRenderFrameHost(base::BindRepeating(
&MyClass::HandleRFH, base::Unretained(this)));
to simply using a lambda that captures `this`:
rfh->ForEachRenderFrameHost([this] (content::RenderFrameHost* rfh) {
HandleRFH(rfh);
});
An astute reader will note that the latter is one line longer; however,
many of these callbacks currently bind other arguments as additional
input parameters or as out parameters. Using lambda captures
significantly reduces the boilerplate, improving readability, and makes
it much easier to avoid unnecessary copies.
Bug: 1303103
Change-Id: I3aeb74a0988dbddb645faef2239e9541c9adac52
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3767487
Commit-Queue: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Owners-Override: Avi Drissman <avi@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1039508}
Note that the old method is already returning the PrimaryFrameTree so
this patch is just about making that explicit.
Trivial change that renames all test files leaving the production code
for a later patch. That code will need a closer look to make sure that
call sites are really expecting the primary frame tree (note they are
already getting the primary frame tree, so this is just an extra check
for peace of mind).
Keeping the old method around for a while will also prevent this massive
patch from being reverted if an optional try-bot later fails.
Bug: 1251094
Change-Id: Ibc86aedf203013e41e61ede94e6af929f80ee477
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3231330
Reviewed-by: Alexander Timin <altimin@chromium.org>
Reviewed-by: Sreeja Kamishetty <sreejakshetty@chromium.org>
Commit-Queue: Carlos Caballero <carlscab@google.com>
Cr-Commit-Position: refs/heads/main@{#935359}
This is a reland of dd5f48e2f2
Reason for revert: fixed the flaky TC.
Original change's description:
> [mparch] Expose IsErrorDocument in RenderFrameHost
>
> This is a precursor CL of crrev.com/c/3189357 that will replace
> DidFinishNavigation with PrimaryPageChanged. To match
> NavigationHandle::IsErrorPage, this CL exposes IsErrorDocument in
> RenderFrameHost.
>
> Bug: 1218946
> Change-Id: I52332b9b3b7ec4fb4fcb5733b7a9ea0780a40a51
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3193931
> Commit-Queue: Miyoung Shin <myid.shin@igalia.com>
> Reviewed-by: Alexander Timin <altimin@chromium.org>
> Reviewed-by: Alex Moshchuk <alexmos@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#926656}
Bug: 1218946, 1254825
Change-Id: I43136515238e7c2c2c6fbb68fdce96350d7ec86c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3198011
Reviewed-by: Alexander Timin <altimin@chromium.org>
Reviewed-by: Alex Moshchuk <alexmos@chromium.org>
Commit-Queue: Miyoung Shin <myid.shin@igalia.com>
Cr-Commit-Position: refs/heads/main@{#929145}
This reverts commit dd5f48e2f2.
Reason for revert: RenderFrameHostImplBrowserTest.ErrorDocuments is failing, more details on crbug.com/1254825
Original change's description:
> [mparch] Expose IsErrorDocument in RenderFrameHost
>
> This is a precursor CL of crrev.com/c/3189357 that will replace
> DidFinishNavigation with PrimaryPageChanged. To match
> NavigationHandle::IsErrorPage, this CL exposes IsErrorDocument in
> RenderFrameHost.
>
> Bug: 1218946
> Change-Id: I52332b9b3b7ec4fb4fcb5733b7a9ea0780a40a51
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3193931
> Commit-Queue: Miyoung Shin <myid.shin@igalia.com>
> Reviewed-by: Alexander Timin <altimin@chromium.org>
> Reviewed-by: Alex Moshchuk <alexmos@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#926656}
Bug: 1218946, 1254825
Change-Id: Ie4e814f41f88116f8a72fb528e2b95ac6f3d27cf
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3197797
Auto-Submit: Owen Min <zmin@chromium.org>
Owners-Override: Owen Min <zmin@chromium.org>
Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Cr-Commit-Position: refs/heads/main@{#926858}
This is a precursor CL of crrev.com/c/3189357 that will replace
DidFinishNavigation with PrimaryPageChanged. To match
NavigationHandle::IsErrorPage, this CL exposes IsErrorDocument in
RenderFrameHost.
Bug: 1218946
Change-Id: I52332b9b3b7ec4fb4fcb5733b7a9ea0780a40a51
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3193931
Commit-Queue: Miyoung Shin <myid.shin@igalia.com>
Reviewed-by: Alexander Timin <altimin@chromium.org>
Reviewed-by: Alex Moshchuk <alexmos@chromium.org>
Cr-Commit-Position: refs/heads/main@{#926656}
This replaces DISALLOW_COPY_AND_ASSIGN with explicit constructor deletes
where a local script is able to detect its insertion place (~Foo() is
public => insert before this line).
This is incomplete as not all classes have a public ~Foo() declared, so
not all DISALLOW_COPY_AND_ASSIGN occurrences are replaced.
IWYU cleanup is left as a separate pass that is easier when these macros
go away.
Bug: 1010217
Change-Id: Iea478401b7580682c7b9f195f7af9cbbdb6ce315
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3167292
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Owners-Override: Daniel Cheng <dcheng@chromium.org>
Commit-Queue: Peter Boström <pbos@chromium.org>
Cr-Commit-Position: refs/heads/main@{#923194}
Files that use base::StringPrintf() and StringPrintV() should include
stringprintf.h. Find the files that do not using this command:
git grep -l 'base::StringPrint[fV]' | \
xargs grep -L '^#include "base/strings/stringprintf.h"$' | \
grep -E '(cc|mm)$'
and add the include to those files.
Then do a similar check for base::StringAppend.
Change-Id: Ia736e7d64eeb13dc7aff72944ebe00f6931ed584
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2849391
Reviewed-by: Peter Boström <pbos@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Owners-Override: Lei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/master@{#876342}
We used to need to account for pages with the base_url set to
kUnreachableWebDataURL when checking if a page is an error page or not
due to auto-reload. This is no longer needed after we moved error page
auto reloading to the browser, and this check also caused us to wrongly
believe that normal pages with base_url == kUnreachableWebDataURL as
error pages (e.g. an MHTML document).
This CL removes the check for base_url when determining if a page is an
error page or not. Since this is the last usage of DidCommitParams'
base_url, we can also just remove the param completely.
See: https://groups.google.com/a/google.com/g/chrome-navigation/c/x4qaF1dmszI/m/66DUFhoQCgAJ
Bug: 1131832
Change-Id: I3a51b458eda52cbe999e5b2b4226e0cee1c27a7b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2796782
Reviewed-by: Arthur Sonzogni <arthursonzogni@chromium.org>
Reviewed-by: Nasko Oskov <nasko@chromium.org>
Commit-Queue: Rakina Zata Amni <rakina@chromium.org>
Cr-Commit-Position: refs/heads/master@{#871401}
After this CL, blink::ResourceFetcher should not start HTTP requests if
an MHTML archive is present. Additionally tweak GetCacheIdentifier to
make sure that globally cached requests (e.g. fulfilled via HTTP) are
not reused for requests within MHTML archive.
Change-Id: I3b7253c22bc42b941d9abd8dec82e58f730dd815
Bug: 1168249
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2638219
Reviewed-by: Dave Tapuska <dtapuska@chromium.org>
Reviewed-by: Yutaka Hirano <yhirano@chromium.org>
Reviewed-by: Arthur Sonzogni <arthursonzogni@chromium.org>
Commit-Queue: Łukasz Anforowicz <lukasza@chromium.org>
Auto-Submit: Łukasz Anforowicz <lukasza@chromium.org>
Cr-Commit-Position: refs/heads/master@{#846266}
Move CSPEE code from the AncestorThrottle toward the NavigationRequest.
Why?
1) AncestorThrottle is a NavigationThrottle. NavigationThrottle doesn't
run for several URLs like about:blank. This fixes two two test case
introduced recently for bug 1163174
2) CSPEE can add a 'sandbox' directive. This might modify the origin.
The origin needs to be computed before running the
NavigationThrottle. So this isn't possible to check CSPEE in the
NavigationThrottle. Taking CSPEE into accounts for sandbox will be
fixed in a follow-up.
Bug: 1163174
Change-Id: I193d7821b7819339912a6ba92bdb28e8fa893256
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2611269
Commit-Queue: Arthur Sonzogni <arthursonzogni@chromium.org>
Reviewed-by: Camille Lamy <clamy@chromium.org>
Reviewed-by: Antonio Sartori <antoniosartori@chromium.org>
Cr-Commit-Position: refs/heads/master@{#845560}
Before this CL, NavigationRequest::GetOriginForURLLoaderFactory would
skip security checks for navigations happening within MHTML, *except*
for navigations to data: URLs:
// Old, incorrect code - the condition below matches MHTML
// subframes, *except* for navigations to data: URLs:
if (IsLoadedFromMhtmlArchive() && !IsInMainFrame())
return origin;
After this CL, the data: URLs are also excluded, by refactoring
NavigationRequest::IsForMhtmlSubframe and using it for avoiding
the security checks in GetOriginForURLLoaderFactory:
// New, correct code (after this CL IsForMhtmlSubframe doesn't
// exclude navigations to data: URLs).
if (IsForMhtmlSubframe())
return origin;
The CL similarly updates the security checks in RenderFrameHostImpl
(the ones based on `is_mhtml_document_`) so they also cover data:
navigations within MHTML.
// Old, incorrect code (excluding data: URLs within MHTML):
is_mhtml_document_ = [...]
navigation_request->IsLoadedFromMhtmlArchive();
// New, correct code (covering data: URLs within MHTML):
is_mhtml_document_ = [...]
navigation_request->IsMhtmlOrSubframe();
Bug: 969696
Fixed: 1155862
Change-Id: I9ba24f8ba1cf8a67454f74b0ae1f7f2493923a33
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2591287
Commit-Queue: Łukasz Anforowicz <lukasza@chromium.org>
Reviewed-by: Alex Moshchuk <alexmos@chromium.org>
Cr-Commit-Position: refs/heads/master@{#838313}
Prior to this patch RenderFrameHostImpl::is_mhtml_document_ wasn't set
for iframes. This was very confusing.
This patch makes the NavigationRequest to compute whether the new
document is an MHTML one. This is now less confusing. Moreover this
allows:
- Fixing a TODO(lukasza) [Done in this patch]
- Compute the sandbox flags for MHTML document [In follow-up].
Bug: 1041376
Change-Id: Id99f99b8daf709687986490a06906b2d96ecca0e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2450270
Commit-Queue: Arthur Sonzogni <arthursonzogni@chromium.org>
Reviewed-by: Łukasz Anforowicz <lukasza@chromium.org>
Reviewed-by: Alex Moshchuk <alexmos@chromium.org>
Cr-Commit-Position: refs/heads/master@{#814621}
Currently, state synchronization between the browser and the renderer
process is complicated and buggy for cross-process navigations. The
renderer process is responsible for processing the commit IPC and then
reporting success back up to the browser process, which then updates its
state. However, it's unclear if this can lead to races.
Instead, if it is possible to assume that one `CommitNavigation()` IPC
from the browser always maps to one committed navigation in the
renderer, the code can be simplified to remove multiphase navigation
commits. This means the browser would be able to mark a provisional
local frame as committed as soon as it sends a commit IPC to the
renderer for that frame.
As an initial step in this direction, this CL implements a renderer-side
`CHECK()` that a request to commit a navigation from the browser always
results in a committed navigation, with some initial exemptions for
fallback content for embedded content, et cetera.
However, this new `CHECK()` exposed some existing bugs in MHTMLx
handling. The browser side navigation code does not know enough about an
MHTML archive to determine if a commit will succeed or fail. Instead,
the browser always assumes that a subframe navigation request will
succeed and simply always calls `CommitNavigation()`. Unfortunately, the
renderer silently ignores commit requests in subframes if the associated
resource cannot be found in the MHTML archive, which triggers the new
`CHECK()`.
To fix this, committing a navigation to a non-existent MHTML resource
will now simply commit a document constructed from an empty string with
the text/html MIME type. This required updating the expectations for
some existing MHTML tests that tested loading of non-existent MHTML
resources. Before, the last committed URL would simply be empty, since
the commit would silently be dropped. After, the last committed URL is
now the URL of the non-existent resource.
Finally, NavigationMhtmlBrowserTest.IframeAboutBlankNotFound exhibited
a large number of complex interactions that still are not fully
understood. It looks like the renderer now reports load completion
*after* the about:blank fragment navigation completes, so update the
test expectations accordingly...
Bug: 999255
Change-Id: I2f9ac23b5668886b8b3bbbdcb7925f8784480c25
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2335323
Commit-Queue: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Alex Moshchuk <alexmos@chromium.org>
Cr-Commit-Position: refs/heads/master@{#796508}
This is a step towards doing full IWYU of browser_test.h, which will
have other benefits.
Completely mechanical and already R+ed as part of r765923.
Tbr: sky
Bug: none
Change-Id: Icb7ab728098a6cf29c0920da4b524e96a7c024c2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2186411
Commit-Queue: Peter Kasting <pkasting@chromium.org>
Reviewed-by: Peter Kasting <pkasting@chromium.org>
Cr-Commit-Position: refs/heads/master@{#766361}
Include this directly in relevant test files. This lets us convert the
HAS_OUT_OF_PROC_TEST_RUNNER checks in this file and
view_event_test_base.h into #errors, and force people to not even
include this file in files that can't use it.
Bug: none
Tbr: sky
Change-Id: I86626099eb047eb53e8b3611de38ba6bebc01a0b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2136117
Commit-Queue: Peter Kasting <pkasting@chromium.org>
Reviewed-by: Scott Violet <sky@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/master@{#765923}
Update tests under //content/browser (not including subdirectories) to
use WebContentsConsoleObserver instead of ConsoleObserverDelegate. This
allows us to observe console messages added without overriding the
existing delegate of the WebContents.
Bug: 1034150
Change-Id: Icae6452f3b7753cf6fa8da4caab8a5756687164d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2173343
Commit-Queue: Devlin <rdevlin.cronin@chromium.org>
Reviewed-by: Alex Moshchuk <alexmos@chromium.org>
Cr-Commit-Position: refs/heads/master@{#764726}
This reverts commit 8c36510cc3.
Reason for revert: Added missing include on ChromeOS.
Original change's description:
> Revert "[base] Remove base::SharedMemory and base::SharedMemoryHandle"
>
> This reverts commit fa7e8cc73e.
>
> Reason for revert: It looks like there was at least one missed instance of transitively including file_util. Sample build log: https://ci.chromium.org/p/chrome/builders/ci/chromeos-kevin-google-rel/4373
>
> Original change's description:
> > [base] Remove base::SharedMemory and base::SharedMemoryHandle
> >
> > There are no users of the deprecated shared memory left, so its code
> > can safely removed.
> >
> > To use shared memory in Chrome, please refer to
> > base::WritableSharedMemoryRegion and base::ReadOnlySharedMemoryRegion
> > classes.
> >
> > This CL removes all remaining #includes of
> > "base/memory/shared_memory.h" and
> > "base/memory/shared_memory_handle.h". They are replaced by new shared
> > memory includes when needed.
> >
> > It also appears that "base/files/file_util.h" and
> > "base/posix/eintr_wrapper.h" were transitively included in many places
> > through the removed files. This CL includes them explicitly in all
> > those files.
> >
> > TBR: wfh@chromium.org
> > Bug: 795291
> > Change-Id: I97ecac4b529c0ad6498b6e5ccf01515f750448ad
> > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1919152
> > Commit-Queue: Alex Ilin <alexilin@chromium.org>
> > Reviewed-by: Daniel Cheng <dcheng@chromium.org>
> > Reviewed-by: Jochen Eisinger <jochen@chromium.org>
> > Cr-Commit-Position: refs/heads/master@{#717588}
>
> TBR=dcheng@chromium.org,jochen@chromium.org,alexilin@chromium.org
>
> Change-Id: I16c6e4c2ada01240d577706478cf739ce1061ee5
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: 795291
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1929252
> Reviewed-by: Tommy Martino <tmartino@chromium.org>
> Commit-Queue: Tommy Martino <tmartino@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#717644}
TBR=dcheng@chromium.org,tmartino@chromium.org,jochen@chromium.org,alexilin@chromium.org
Change-Id: I437cf7f93965858840170eb49b2d611b37e79b25
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 795291
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1929221
Reviewed-by: Alex Ilin <alexilin@chromium.org>
Commit-Queue: Alex Ilin <alexilin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#717663}
This reverts commit fa7e8cc73e.
Reason for revert: It looks like there was at least one missed instance of transitively including file_util. Sample build log: https://ci.chromium.org/p/chrome/builders/ci/chromeos-kevin-google-rel/4373
Original change's description:
> [base] Remove base::SharedMemory and base::SharedMemoryHandle
>
> There are no users of the deprecated shared memory left, so its code
> can safely removed.
>
> To use shared memory in Chrome, please refer to
> base::WritableSharedMemoryRegion and base::ReadOnlySharedMemoryRegion
> classes.
>
> This CL removes all remaining #includes of
> "base/memory/shared_memory.h" and
> "base/memory/shared_memory_handle.h". They are replaced by new shared
> memory includes when needed.
>
> It also appears that "base/files/file_util.h" and
> "base/posix/eintr_wrapper.h" were transitively included in many places
> through the removed files. This CL includes them explicitly in all
> those files.
>
> TBR: wfh@chromium.org
> Bug: 795291
> Change-Id: I97ecac4b529c0ad6498b6e5ccf01515f750448ad
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1919152
> Commit-Queue: Alex Ilin <alexilin@chromium.org>
> Reviewed-by: Daniel Cheng <dcheng@chromium.org>
> Reviewed-by: Jochen Eisinger <jochen@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#717588}
TBR=dcheng@chromium.org,jochen@chromium.org,alexilin@chromium.org
Change-Id: I16c6e4c2ada01240d577706478cf739ce1061ee5
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 795291
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1929252
Reviewed-by: Tommy Martino <tmartino@chromium.org>
Commit-Queue: Tommy Martino <tmartino@chromium.org>
Cr-Commit-Position: refs/heads/master@{#717644}
There are no users of the deprecated shared memory left, so its code
can safely removed.
To use shared memory in Chrome, please refer to
base::WritableSharedMemoryRegion and base::ReadOnlySharedMemoryRegion
classes.
This CL removes all remaining #includes of
"base/memory/shared_memory.h" and
"base/memory/shared_memory_handle.h". They are replaced by new shared
memory includes when needed.
It also appears that "base/files/file_util.h" and
"base/posix/eintr_wrapper.h" were transitively included in many places
through the removed files. This CL includes them explicitly in all
those files.
TBR: wfh@chromium.org
Bug: 795291
Change-Id: I97ecac4b529c0ad6498b6e5ccf01515f750448ad
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1919152
Commit-Queue: Alex Ilin <alexilin@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Jochen Eisinger <jochen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#717588}
Frames with the `allow-popup` and `allow-popup-to-escape-sandbox` flags
can cause JavaScript execution in their origin by navigating to a
`javascript:` URL via `target=_blank` or similar. This is technically
correct, but surprising.
https://github.com/whatwg/html/pull/5083 aims to tighten that check to
match developers' expectations that `javascript:` URLs controlled by a
page that's been sandboxed away from script will not execute.
Bug: 1014371
Change-Id: I3b5fa676e73cbf78485b85ce2593284bce2e68cc
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1916467
Reviewed-by: Daniel Vogelheim <vogelheim@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Commit-Queue: Avi Drissman <avi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#716035}
This CL replaces strict-equality comparisons like
if (url == GURL(content::kAboutSrcDocURL)) ...
with
if (url.IsAboutSrcdoc()) ...
Unlike the old code, the new code correctly handles about:srcdoc#ref and
other corner-cases (see gurl_unittest.cc for more examples). Note that
in the long-term URLs like about:srcdoc#ref should not be encountered in
practice (see https://crbug.com/974300), but for now such navigations
are still possible (e.g. frames can directly navigate to
about:srcdoc#ref by setting window.location). Using IsAboutSrcdoc
instead of strict-equality should correctly account for the current
implementation state (and should remain correct in the long-term).
To prevent reoccurence of strict-equality comparisons, the CL also
removes the content::kAboutSrcDocURL constant.
Bug: 973922
Change-Id: I2bd80c82c395a4659ccb50f4caf236baa5ad3c8d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1659195
Auto-Submit: Łukasz Anforowicz <lukasza@chromium.org>
Reviewed-by: Nasko Oskov <nasko@chromium.org>
Reviewed-by: Alex Moshchuk <alexmos@chromium.org>
Commit-Queue: Łukasz Anforowicz <lukasza@chromium.org>
Cr-Commit-Position: refs/heads/master@{#670330}
Is Content-Security-Policy: frame-ancestors enforced in MHTML iframes?
Currently, it isn't.
Add the test NavigationMhtmlBrowserTest.CspFrameAncestor to document the
current behavior and for being notified when it will change.
Bug: 969711
Change-Id: I94f882cd00ec838f944d6dec41932be1447af2b0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1641246
Commit-Queue: Arthur Sonzogni <arthursonzogni@chromium.org>
Auto-Submit: Arthur Sonzogni <arthursonzogni@chromium.org>
Reviewed-by: Camille Lamy <clamy@chromium.org>
Reviewed-by: Mike West <mkwst@chromium.org>
Cr-Commit-Position: refs/heads/master@{#667970}
In an MHTML document, blink::DocumentLoader::archive_ is transmitted
from parent to children. data-URL aren't loaded from the MHTML archive.
In this case, does it means children of data-URL aren't able to be
loaded from the MHTML archive? Hopefully, it is currently working. They
are able to load from the MHTML document, because |archive_| continue to
be transmitted.
This CL adds a test to ensure this continue to work in the future.
Bug: None.
Change-Id: Icb51dc48691112cf9e45dfe8cb81d389544a0c41
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1635669
Commit-Queue: Arthur Sonzogni <arthursonzogni@chromium.org>
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Cr-Commit-Position: refs/heads/master@{#665876}
Navigation to MHTML document needs to be tested. There are some blink web tests,
but no real browser tests. This adds the NavigationMhtmlBrowserTest set of
tests. It contains an helper class to quickly build and use MHTML archives
easily in tests.
New tests:
+ NavigationMhtmlBrowserTest.IframeFound
+ NavigationMhtmlBrowserTest.IframeNotFound
+ NavigationMhtmlBrowserTest.IframeDataUrlNotFound
+ NavigationMhtmlBrowserTest.IframeDataUrlFound
+ NavigationMhtmlBrowserTest.IframeAboutSrcDocFound
+ NavigationMhtmlBrowserTest.IframeAboutSrcDocNotFound
+ NavigationMhtmlBrowserTest.IframeAboutBlankFound
+ NavigationMhtmlBrowserTest.IframeAboutBlankNotFound
+ NavigationMhtmlBrowserTest.IframeJavascriptUrlFound
+ NavigationMhtmlBrowserTest.IframeJavascriptUrlNotFound
+ NavigationMhtmlBrowserTest.IframeContentIdUrlFound
+ NavigationMhtmlBrowserTest.IframeContentIdUrlNotFound
Some weird expectations have been found, but not investigated yet.
The test NavigationMhtmlBrowserTest.IframeDataUrl is not enabled, because it
reaches a DCHECK. See https://crbug.com/967307. It needs to be fixed in a follow
up.
The main goal for this CL is to prepare for:
https://chromium-review.googlesource.com/c/chromium/src/+/1547521
New tests will make us a bit more confident.
Bug: 967307, 936696
Change-Id: I71cee7a4377467126f10b22b9d828f539045e102
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1631399
Commit-Queue: Arthur Sonzogni <arthursonzogni@chromium.org>
Reviewed-by: Łukasz Anforowicz <lukasza@chromium.org>
Reviewed-by: Charlie Reis <creis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#665860}