0
Commit Graph

117 Commits

Author SHA1 Message Date
Michael Thiessen
2add7d4477 Lock SchemeRegistry on first use.
This change locks the SchemeRegistry on first use, which required
refactoring url_util.cc to differentiate between SchemeRegistry use for
adding Schemes, and SchemeRegistry use for using Schemes.

Tests can now only modify schemes after initialization by calling
url::UnlockForTests(), which creates a scoped object that resets the
schemes, so tests can't mistakenly leave global scheme state modified.

This change required changes to browser startup to decouple scheme
registration from ContentMain, found here:
https://chromium-review.googlesource.com/c/chromium/src/+/1945926

Doc: https://docs.google.com/document/d/1kDKqBaq-b6EbUm0F4ea7ARoksUcj1KUx3qxFuSXEwM4/edit

Bug: 783819
Change-Id: Idcac37ccae297735176eba20b50ced3f9e63f9db
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1901591
Reviewed-by: Jeremy Roman <jbroman@chromium.org>
Reviewed-by: Yaron Friedman <yfriedman@chromium.org>
Reviewed-by: Gauthier Ambard <gambard@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Commit-Queue: Michael Thiessen <mthiesse@chromium.org>
Cr-Commit-Position: refs/heads/master@{#738544}
2020-02-05 13:49:38 +00:00
sreejakshetty@chromium.org
ee8ae33b2d Refactor: Move content/public/common methods to content/common
Methods declared in content/public/common/navigation_policy.h
|IsBackForwardCacheEnabled()|, |isProactivelySwapBrowsingInstanceEnabled()|
are not used outside content/ are exposed in public.

Moving these methods to content/common/ API to follow the policy:
-> browser process only -> content/browser
-> renderer process only -> content/renderer
-> browser & renderer process -> content/common

Change-Id: I42dd780646f7da832dba9067974ddbd9909fe1c6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2019033
Commit-Queue: Sreeja Kamishetty <sreejakshetty@chromium.org>
Reviewed-by: Alex Moshchuk <alexmos@chromium.org>
Reviewed-by: Arthur Sonzogni <arthursonzogni@chromium.org>
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Reviewed-by: Alexander Timin <altimin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#736222}
2020-01-29 03:49:45 +00:00
Julie Jeongeun Kim
144f819db4 Move FrameHostMsg_GoToEntryAtOffset to mojo
This CL changes FrameHostMsg_GoToEntryAtOffset so that it is
implemented in the LocalFrameHost interface.

It removes WebLocalFrameClient::NavigateBackForwardSoon() from
web_local_frame_client.h since LocalFrameClientImpl have access to
mojom::blink::LocalFrameHost.

Bug: 1039286
Change-Id: If565c4fffb3f785d3518dc38171cf7092c7ef30d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2000267
Commit-Queue: Julie Kim <jkim@igalia.com>
Reviewed-by: Dave Tapuska <dtapuska@chromium.org>
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Cr-Commit-Position: refs/heads/master@{#733150}
2020-01-18 06:59:03 +00:00
Devlin Cronin
90e6b3b399 [Cleanup] Use WebContentsConsoleObserver in NavigationBrowserTests
Update NavigationBrowserTests to use WebContentsConsoleObserver
instead of ConsoleObserverDelegate. This allows us to observe
console messages added without overriding the existing delegate of the
WebContents. Additionally, we no longer have to worry about the lifetime
of the observer (since it handles its own cleanup), so these can be
properly scoped.

Bug: 1034150
Change-Id: Idf52898484da7e5ec3fd0d3210580acba8294096
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1983591
Reviewed-by: Alex Moshchuk <alexmos@chromium.org>
Commit-Queue: Devlin <rdevlin.cronin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#729546}
2020-01-08 23:43:49 +00:00
Erik Chen
465931c14f Disable two already flaky tests on Android.
The test NavigationUrlRewriteBrowserTest.RewriteToNoAccess was already disabled
for debug Android builds. Unfortunately, the test also flakes on release android
builds with is_java_debug set to true. Rather than plumb that through as a
compile time flag, this CL simply disables the test on Android.

The test SitePerProcessHitTestBrowserTest.TouchpadDoubleTapZoomOverOOPIF was
already disabled for being flaky on windows, macOS and Linux. This CL disables
it on Android as well.

Bug: 1021779, 947193, 1029936
Change-Id: I055e06b16b94ee2f4485049c649be957e7b23e13
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1965479
Auto-Submit: Erik Chen <erikchen@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Commit-Queue: Erik Chen <erikchen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#724308}
2019-12-12 20:09:57 +00:00
Ilia Samsonov
188d9c82a5 Add prefix to empty param tests.
googletest will no longer support empty prefix
for parameterized INSTANTIATE_TEST_SUITE_P.
Adding "All" prefix to existing empty prefix test suites.

This CL was uploaded by git cl split.

R=boliu@chromium.org

Bug: 1023677
Change-Id: I75f39ee4040392f4a8e757b00b387047e2b0a2db
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1957494
Auto-Submit: Ilia Samsonov <isamsonov@google.com>
Reviewed-by: Bo <boliu@chromium.org>
Commit-Queue: Bo <boliu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#722948}
2019-12-09 16:03:07 +00:00
Aran Gilman
249eb129ec Remove DCHECKs asserting deterministic URL rewrites during navigation.
As noted in the comment next to one of the DCHECKs,
RewriteUrlForNavigation has non-deterministic behavior in practice.

This is particularly relevant to Reader Mode, which includes a random
string into the distiller's URL, causing each call to the URL-
generating method to be different.

Bug: 992073
Change-Id: I78eb582adc48c9fe90a460adeeab9efc66d9fea9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1873957
Commit-Queue: Aran Gilman <gilmanmh@google.com>
Reviewed-by: Alex Moshchuk <alexmos@chromium.org>
Reviewed-by: Arthur Sonzogni <arthursonzogni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#720710}
2019-12-02 23:32:46 +00:00
Gyuyoung Kim
6c9ce902de Migrate all old uses of InterfaceProvider to new Mojo types
This CL converts InterfaceProviderPtr|Request to the new Mojo
types. Major changes are as below,

  - Convert mojom::InterfaceProviderPtr to
    mojo::PendingRemote|Remote<mojom::InterfaceProvider>
  - Convert mojo::InterfaceProviderRequest to
    mojo::PendingReceiver<mojom::InterfaceProvider>
  - Convert mojo::Binding to mojo::Receiver
  - Convert mojom::InterfaceProviderPtrInfo to
    mojo::PendingRemote<mojom::InterfaceProvider>

Bug: 955171, 978694
Change-Id: I94b956bb60e20810a84f7714e23c4da836bfd8c6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1928429
Reviewed-by: Wei Li <weili@chromium.org>
Reviewed-by: Frank Liberato <liberato@chromium.org>
Reviewed-by: Matt Falkenhagen <falken@chromium.org>
Reviewed-by: Ken Rockot <rockot@google.com>
Reviewed-by: Sam McNally <sammc@chromium.org>
Reviewed-by: Hiroki Nakagawa <nhiroki@chromium.org>
Commit-Queue: Gyuyoung Kim <gyuyoung@igalia.com>
Cr-Commit-Position: refs/heads/master@{#719007}
2019-11-26 05:40:08 +00:00
Alex Ilin
cf96655e16 Reland "[base] Remove base::SharedMemory and base::SharedMemoryHandle"
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}
2019-11-21 16:13:52 +00:00
Tommy Martino
8c36510cc3 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}
2019-11-21 15:14:58 +00:00
Alex Ilin
fa7e8cc73e [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}
2019-11-21 11:05:52 +00:00
Minggang Wang
83f7f371a8 Remove kNavigationImmediateResponse flag
Currently, the NavigationImmediateResponse feature is enabled by
default through a flag kNavigationImmediateResponseBody.

As this feature has been landed for some time, this patch removes this
flag and the support for the old behavior.

Bug: 1017705
Change-Id: If02d58b28ccaadfa1ca94e080217321521a009fa
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1911148
Commit-Queue: Minggang Wang <minggang.wang@intel.com>
Reviewed-by: Shakti Sahu <shaktisahu@chromium.org>
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Reviewed-by: Matt Falkenhagen <falken@chromium.org>
Cr-Commit-Position: refs/heads/master@{#716024}
2019-11-16 11:28:16 +00:00
Aaron Colwell
c5881eb00a Temporarily disable NavigationUrlRewriteBrowserTest on Android.
Bug: 1021779, 1016711
Change-Id: I77763126e83505a49f086de87a4e4dd08304ca7c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1904813
Commit-Queue: Aaron Colwell <acolwell@chromium.org>
Reviewed-by: Alex Moshchuk <alexmos@chromium.org>
Auto-Submit: Aaron Colwell <acolwell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#713745}
2019-11-08 05:10:55 +00:00
Aaron Colwell
4696a7b2fa Add CanCommitOriginAndUrl() exception for 'no access' URLs.
Temporary fix that creates an exception for 'no access' URLs like
chrome-native://history. These URLs can cause a origin mismatch in the
commit code because of slight differences between how url::Origin and
blink::SecurityOrigin handle 'no access' URLs. This is intended as a
low risk change that can be easily merged to the M79 branch.

Bug: 1016711, 923144
Change-Id: I8ab833744f45ebfbc489118313c59d7bbfdaff78
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1900358
Auto-Submit: Aaron Colwell <acolwell@chromium.org>
Commit-Queue: Alex Moshchuk <alexmos@chromium.org>
Reviewed-by: Alex Moshchuk <alexmos@chromium.org>
Cr-Commit-Position: refs/heads/master@{#713635}
2019-11-07 22:28:56 +00:00
Oksana Zhuravlova
977b4b7245 Reland "[mojo] Remove DocumentInterfaceBroker"
This is a reland of 3e01d61b62

Removed the remaining #include for frame_host_test_interface.mojom.h

Original change's description:
> [mojo] Remove DocumentInterfaceBroker
>
> This change removes the DocumentInterfaceBroker mojom interface and all
> related plumbing. No functional changes since the interface was not used
> by anything (clients migrated to BrowserInterfaceBroker).
>
> TBR=tommycli@chromium.org,rbpotter@chromium.org,arthursonzogni@chromium.org,kenrb@chromium.org,alexmos@chromium.org,rdevlin.cronin@chromium.org,haraken@chromium.org
>
> Bug: 985120
> Change-Id: I893f940bc2c5d237aac5fb6b3962c06bfa98e938
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1881394
> Reviewed-by: Oksana Zhuravlova <oksamyt@chromium.org>
> Reviewed-by: Tommy Li <tommycli@chromium.org>
> Reviewed-by: Devlin <rdevlin.cronin@chromium.org>
> Reviewed-by: Alex Moshchuk <alexmos@chromium.org>
> Reviewed-by: Kentaro Hara <haraken@chromium.org>
> Reviewed-by: Chrome Cunningham <chcunningham@chromium.org>
> Reviewed-by: Daniel Cheng <dcheng@chromium.org>
> Reviewed-by: Arthur Sonzogni <arthursonzogni@chromium.org>
> Reviewed-by: Rebekah Potter <rbpotter@chromium.org>
> Commit-Queue: Oksana Zhuravlova <oksamyt@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#713278}

Bug: 985120
Change-Id: If3a080592aef38d0c143f6a0d150991c091a4b6d

TBR=tommycli@chromium.org,rbpotter@chromium.org,arthursonzogni@chromium.org,kenrb@chromium.org,alexmos@chromium.org,rdevlin.cronin@chromium.org,haraken@chromium.org

Change-Id: If3a080592aef38d0c143f6a0d150991c091a4b6d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1903007
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Chrome Cunningham <chcunningham@chromium.org>
Commit-Queue: Oksana Zhuravlova <oksamyt@chromium.org>
Cr-Commit-Position: refs/heads/master@{#713528}
2019-11-07 19:21:55 +00:00
Tsuyoshi Horo
8856509043 Revert "[mojo] Remove DocumentInterfaceBroker"
This reverts commit 3e01d61b62.

Reason for revert: Caused build failure
https://ci.chromium.org/p/chromium/builders/ci/linux-archive-dbg/5699

[56914/72140] CXX obj/content/test/content_browsertests/render_frame_impl_browsertest.o
FAILED: obj/content/test/content_browsertests/render_frame_impl_browsertest.o
/b/s/w/ir/cache/goma/client/gomacc ../../third_party/llvm-build/Release+Asserts/bin/clang++ -MMD -MF...(too long)
../../content/renderer/render_frame_impl_browsertest.cc:50:10: fatal error: 'third_party/blink/public/mojom/frame/frame_host_test_interface.mojom.h' file not found
#include "third_party/blink/public/mojom/frame/frame_host_test_interface.mojom.h"
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.


Original change's description:
> [mojo] Remove DocumentInterfaceBroker
> 
> This change removes the DocumentInterfaceBroker mojom interface and all
> related plumbing. No functional changes since the interface was not used
> by anything (clients migrated to BrowserInterfaceBroker).
> 
> TBR=tommycli@chromium.org,rbpotter@chromium.org,arthursonzogni@chromium.org,kenrb@chromium.org,alexmos@chromium.org,rdevlin.cronin@chromium.org,haraken@chromium.org
> 
> Bug: 985120
> Change-Id: I893f940bc2c5d237aac5fb6b3962c06bfa98e938
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1881394
> Reviewed-by: Oksana Zhuravlova <oksamyt@chromium.org>
> Reviewed-by: Tommy Li <tommycli@chromium.org>
> Reviewed-by: Devlin <rdevlin.cronin@chromium.org>
> Reviewed-by: Alex Moshchuk <alexmos@chromium.org>
> Reviewed-by: Kentaro Hara <haraken@chromium.org>
> Reviewed-by: Chrome Cunningham <chcunningham@chromium.org>
> Reviewed-by: Daniel Cheng <dcheng@chromium.org>
> Reviewed-by: Arthur Sonzogni <arthursonzogni@chromium.org>
> Reviewed-by: Rebekah Potter <rbpotter@chromium.org>
> Commit-Queue: Oksana Zhuravlova <oksamyt@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#713278}

TBR=dcheng@chromium.org,kenrb@chromium.org,tommycli@chromium.org,rdevlin.cronin@chromium.org,haraken@chromium.org,alexmos@chromium.org,chcunningham@chromium.org,rbpotter@chromium.org,arthursonzogni@chromium.org,oksamyt@chromium.org

Change-Id: I6c25e96111dca691e007353a27710251b125659e
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 985120
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1902181
Reviewed-by: Tsuyoshi Horo <horo@chromium.org>
Commit-Queue: Tsuyoshi Horo <horo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#713294}
2019-11-07 02:26:51 +00:00
Oksana Zhuravlova
3e01d61b62 [mojo] Remove DocumentInterfaceBroker
This change removes the DocumentInterfaceBroker mojom interface and all
related plumbing. No functional changes since the interface was not used
by anything (clients migrated to BrowserInterfaceBroker).

TBR=tommycli@chromium.org,rbpotter@chromium.org,arthursonzogni@chromium.org,kenrb@chromium.org,alexmos@chromium.org,rdevlin.cronin@chromium.org,haraken@chromium.org

Bug: 985120
Change-Id: I893f940bc2c5d237aac5fb6b3962c06bfa98e938
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1881394
Reviewed-by: Oksana Zhuravlova <oksamyt@chromium.org>
Reviewed-by: Tommy Li <tommycli@chromium.org>
Reviewed-by: Devlin <rdevlin.cronin@chromium.org>
Reviewed-by: Alex Moshchuk <alexmos@chromium.org>
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Reviewed-by: Chrome Cunningham <chcunningham@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Arthur Sonzogni <arthursonzogni@chromium.org>
Reviewed-by: Rebekah Potter <rbpotter@chromium.org>
Commit-Queue: Oksana Zhuravlova <oksamyt@chromium.org>
Cr-Commit-Position: refs/heads/master@{#713278}
2019-11-07 01:50:52 +00:00
Fergal Daly
42fe086047 Revert "Add CanCommitOriginAndUrl() exception for 'no access' URLs."
This reverts commit 29392d0009.

Reason for revert: <INSERT REASONING HERE>

Original change's description:
> Add CanCommitOriginAndUrl() exception for 'no access' URLs.
> 
> Temporary fix that creates an exception for 'no access' URLs like
> chrome-native://history. These URLs can cause a origin mismatch in the
> commit code because of slight differences between how url::Origin and
> blink::SecurityOrigin handle 'no access' URLs. This is intended as a
> low risk change that can be easily merged to the M79 branch.
> 
> Bug: 1016711
> Change-Id: I20734fe68b6919c06849a1ce1439624d6332898c
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1896863
> Commit-Queue: Aaron Colwell <acolwell@chromium.org>
> Reviewed-by: Alex Moshchuk <alexmos@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#712415}

TBR=acolwell@chromium.org,alexmos@chromium.org

Change-Id: I6ac033436b2719090e9fd198c90c410f509c845c
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 1016711,1021779
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1900513
Reviewed-by: Fergal Daly <fergal@chromium.org>
Commit-Queue: Fergal Daly <fergal@chromium.org>
Cr-Commit-Position: refs/heads/master@{#712902}
2019-11-06 05:00:40 +00:00
arthursonzogni
1b0a991d37 Force error page to be classified as cross-document.
Bug https://crbug.com/1018385 is caused by navigation initially
classified as "same-document" committing error pages.

During the commit phase of the navigation, the NavigationRequest is
transfered in one of these RenderFrameHostImpl's bucket:
 - same_document_navigation_request_
 - navigation_requests_

A navigation classified as "same-document" ends up in the bucket
incompatible with error pages.
DidCommitPerNavigationMojoInterfaceNavigation expects to find the
navigation is the other bucket.

Add several regressions tests, including WPT tests.

Bug: 1018385
Change-Id: I3d92af1dd487f7b60a3e50a792716a07b074e5eb
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1886339
Commit-Queue: Arthur Sonzogni <arthursonzogni@chromium.org>
Reviewed-by: Nasko Oskov <nasko@chromium.org>
Cr-Commit-Position: refs/heads/master@{#712541}
2019-11-05 12:51:49 +00:00
Aaron Colwell
29392d0009 Add CanCommitOriginAndUrl() exception for 'no access' URLs.
Temporary fix that creates an exception for 'no access' URLs like
chrome-native://history. These URLs can cause a origin mismatch in the
commit code because of slight differences between how url::Origin and
blink::SecurityOrigin handle 'no access' URLs. This is intended as a
low risk change that can be easily merged to the M79 branch.

Bug: 1016711
Change-Id: I20734fe68b6919c06849a1ce1439624d6332898c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1896863
Commit-Queue: Aaron Colwell <acolwell@chromium.org>
Reviewed-by: Alex Moshchuk <alexmos@chromium.org>
Cr-Commit-Position: refs/heads/master@{#712415}
2019-11-05 02:31:33 +00:00
Maksim Orlovich
09c4f971fd Reland "Adjust tests for upcoming cross-site cookie requirements"
This reverts commit a88c5fe6e6.

Reason for reland: The test was/is flaky on that bot in the first place,
                   the name change just makes it look different.

Original change's description:
> Revert "Adjust tests for upcoming cross-site cookie requirements"
>
> This reverts commit 83b71438dc.
>
> Reason for revert: SitePerProcessSSLBrowserTest.UnloadHandlersArePowerful*
> failing on Android. Please see bug.
>
> Bug: 1014956
> Original change's description:
> > Adjust tests for upcoming cross-site cookie requirements
> >
> > They will need to be marked explicitly and secure, so adjust some tests to
> > be over SSL and mark those cookies appropriately
> >
> > Bug: 1006816
> > Change-Id: I6da53ea64a7c03530335913fadb9099992e8ca33
> > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1863389
> > Reviewed-by: Avi Drissman <avi@chromium.org>
> > Commit-Queue: Maksim Orlovich <morlovich@chromium.org>
> > Cr-Commit-Position: refs/heads/master@{#706108}
>
> TBR=avi@chromium.org,morlovich@chromium.org
>
> Change-Id: I982bc1590171f92883000c8315d3be77f7b35b9f
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: 1006816
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1865249
> Reviewed-by: Parastoo Geranmayeh <parastoog@google.com>
> Commit-Queue: Parastoo Geranmayeh <parastoog@google.com>
> Cr-Commit-Position: refs/heads/master@{#706453}

TBR=avi@chromium.org,parastoog@google.com,morlovich@chromium.org

Change-Id: I51c863c89ade36edddc4b1b7a3f16d82c9f855f3
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 1014956, 1006816
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1866614
Reviewed-by: Avi Drissman <avi@chromium.org>
Reviewed-by: Maksim Orlovich <morlovich@chromium.org>
Commit-Queue: Maksim Orlovich <morlovich@chromium.org>
Cr-Commit-Position: refs/heads/master@{#707918}
2019-10-21 19:51:41 +00:00
Alexander Timin
84fcc8ea15 [bfcache] Clean up the previous navigation
Before restoring a RenderFrameHost from the back-forward cache,
cleanup existing pending RenderFrameHost. Without the back-forward cache,
this is done automatically when GetRenderFrameHostForNavigation is used.

R=arthursonzogni@chromium.org,lowell@chromium.org
CC=​alexmos@chromium.org,nasko@chromium.org
BUG=1003744

Change-Id: I52375bca1c69f02cca367434342670ae287c1ba6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1855924
Reviewed-by: Alex Moshchuk <alexmos@chromium.org>
Reviewed-by: Lowell Manners <lowell@chromium.org>
Reviewed-by: Arthur Sonzogni <arthursonzogni@chromium.org>
Commit-Queue: Alexander Timin <altimin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#706512}
2019-10-16 17:31:55 +00:00
Parastoo Geranmayeh
a88c5fe6e6 Revert "Adjust tests for upcoming cross-site cookie requirements"
This reverts commit 83b71438dc.

Reason for revert: SitePerProcessSSLBrowserTest.UnloadHandlersArePowerful*
failing on Android. Please see bug.

Bug: 1014956
Original change's description:
> Adjust tests for upcoming cross-site cookie requirements
> 
> They will need to be marked explicitly and secure, so adjust some tests to
> be over SSL and mark those cookies appropriately
> 
> Bug: 1006816
> Change-Id: I6da53ea64a7c03530335913fadb9099992e8ca33
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1863389
> Reviewed-by: Avi Drissman <avi@chromium.org>
> Commit-Queue: Maksim Orlovich <morlovich@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#706108}

TBR=avi@chromium.org,morlovich@chromium.org

Change-Id: I982bc1590171f92883000c8315d3be77f7b35b9f
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 1006816
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1865249
Reviewed-by: Parastoo Geranmayeh <parastoog@google.com>
Commit-Queue: Parastoo Geranmayeh <parastoog@google.com>
Cr-Commit-Position: refs/heads/master@{#706453}
2019-10-16 15:12:36 +00:00
Hans Wennborg
5ffd1393b3 Include bloat: reduce number of includes in content_browser_client.h
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}
2019-10-16 11:00:02 +00:00
Maks Orlovich
83b71438dc Adjust tests for upcoming cross-site cookie requirements
They will need to be marked explicitly and secure, so adjust some tests to
be over SSL and mark those cookies appropriately

Bug: 1006816
Change-Id: I6da53ea64a7c03530335913fadb9099992e8ca33
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1863389
Reviewed-by: Avi Drissman <avi@chromium.org>
Commit-Queue: Maksim Orlovich <morlovich@chromium.org>
Cr-Commit-Position: refs/heads/master@{#706108}
2019-10-15 20:02:30 +00:00
Lukasz Anforowicz
9666a169b8 Remove view-source: and file: related ShouldFork considerations.
Site Isolation and process allocation should work correctly even in
absence of a cooperating renderer process - there should be no need for
the renderer-side ChromeContentRendererClient::ShouldFork.  This CL
removes the view-source: and file: related ShouldFork considerations.

Bug: 1003957, 883549
Change-Id: I5598807c358bf81f9c9e827383d0d1dd51d5ba17
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1841667
Commit-Queue: Łukasz Anforowicz <lukasza@chromium.org>
Reviewed-by: Alex Moshchuk <alexmos@chromium.org>
Cr-Commit-Position: refs/heads/master@{#705329}
2019-10-12 00:54:20 +00:00
Ken Rockot
289101268d Fix misc ScopedFeatureList usage (8/8)
ScopedFeatureList is unsafe to use after browser threads have been
started. This constraint will imminently be enforced by DCHECK to
prevent further erroneous usage from landing.

This CL corrects usage within miscellaneous Content browser tests
as well as Chrome tests related to site islation.

This is split from a larger CL where in some rare cases, correction
was too complex to resolve before landing the DCHECK, so corresponding
test(s) may be disabled instead of fixed.

Bug: 846380
Change-Id: Idf6fcaabc37d09b49acb70ad3bd177985bed91cc
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1850736
Commit-Queue: Ken Rockot <rockot@google.com>
Reviewed-by: Avi Drissman <avi@chromium.org>
Reviewed-by: Łukasz Anforowicz <lukasza@chromium.org>
Cr-Commit-Position: refs/heads/master@{#704749}
2019-10-10 19:07:58 +00:00
arthursonzogni
66f711cb89 Clear matching pending NavigationEntry on NavigationRequest deletion.
The goal is to fix a big class of URL spoof issues. They happen when
a NavigationRequest is canceled, but the associated pending navigation
entry remains. This causes the wrong URL to be displayed in the
omnibox.

To fix it, delete the matching pending NavigationEntry in the
NavigationRequest's destructor.

This is a bit more complex:
1) During an history navigation, several NavigationRequest can starts
   at the same time for iframes. All of them are associated with the
   same pending NavigationEntry.
2) A pending NavigationEntry can be used, discarded and reused. It can
   is used twice, but not associated with the same NavigationRequest(s)
   on every use.
The class PendingEntryRef is used to track one NavigationRequest being
associated with a pending NavigationEntry for a given history
navigation.

Bug: 999932
Change-Id: I14582fd1d954a6f831959db0bb5d96eb1f5d53b5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1815129
Commit-Queue: Arthur Sonzogni <arthursonzogni@chromium.org>
Reviewed-by: Charlie Reis <creis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#703713}
2019-10-08 14:40:36 +00:00
Nick Burris
23748e6012 Change text directive to text=
Change the targetText= directive to text=. Also remove the
non-fragment-directive case and the ## delimiter since we definitely
won't be using them.

Updated all tests to use :~:text= syntax.

Updated web platform tests to reflect text= change and delimiter change
to :~:. Tested updated WPT locally with
run_web_tests.py --additional-driver-flag=
  '--enable-blink-features=TextFragmentIdentifiers'

Bug: 1008874,1007016
Change-Id: Ic7f3db39e0a17d5adb8186b2ab5081d60553bd8d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1835892
Commit-Queue: Nick Burris <nburris@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Reviewed-by: David Bokan <bokan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#703317}
2019-10-07 15:56:57 +00:00
arthursonzogni
4f83af07de Revisit cookie_url inheritance.
This makes the following statement to be true:
- about:srcdoc should inherit |cookie_url| from its owner.
- about:blank should inherit |cookie_url| from its owner (if any)

Bug: 1003167, 1009963
Change-Id: Ie0d5d1310cf3a76f0466191528316a55a900332e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1829350
Reviewed-by: Nate Chapin <japhet@chromium.org>
Reviewed-by: Łukasz Anforowicz <lukasza@chromium.org>
Reviewed-by: Matt Falkenhagen <falken@chromium.org>
Commit-Queue: Arthur Sonzogni <arthursonzogni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#702789}
2019-10-04 10:19:24 +00:00
arthursonzogni
cd49c294e3 Test srcdoc/blank/data-url vs cookies inheritance.
Add regression tests for https://crbug.com/1003167.

This checks what happens with cookies in iframes when using special
URLs like about:srcdoc, about:blank, and data-URLs. This checks
normal navigations and history navigations.

This is able to trigger the DumpWithoutCrashing() in:
network::RestrictedCookieManager::ValidateAccessToCookiesAt

Tests=
 - NavigationBaseBrowserTest.CookiesInheritedSrcDoc
 - NavigationBaseBrowserTest.CookiesInheritedAboutBlank
 - NavigationBaseBrowserTest.CookiesInheritedAboutBlank2
 - NavigationBaseBrowserTest.CookiesInheritedDataUrl

Bug: 1003167
Change-Id: I73b9e62021490cfb74caf49c32009171dd9bea00
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1831762
Reviewed-by: Arthur Sonzogni <arthursonzogni@chromium.org>
Reviewed-by: Nasko Oskov <nasko@chromium.org>
Reviewed-by: Łukasz Anforowicz <lukasza@chromium.org>
Commit-Queue: Nasko Oskov <nasko@chromium.org>
Cr-Commit-Position: refs/heads/master@{#701630}
2019-10-01 17:06:57 +00:00
Mohamed Abdelhalim
f03d4a2a72 Navigation: Remove NavigationHandleImpl usages 9.
This is the 9th CL of multiple CLs to remove the usages of
NavigationHandleImpl completely and replace it with NavigationRequest.

This CL completely removes NavigationHandleImpl and now
NavigationRequest implement NavigationHandle.

Bug: 995268
Change-Id: Iddb81aa13135ee630a189c165a9cfb087e99e1b2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1816469
Commit-Queue: Mohamed Abdelhalim <zetamoo@chromium.org>
Reviewed-by: Camille Lamy <clamy@chromium.org>
Reviewed-by: Lowell Manners <lowell@chromium.org>
Reviewed-by: Arthur Sonzogni <arthursonzogni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#701540}
2019-10-01 13:34:31 +00:00
Henrique Ferreiro
3a9751c1ad Migrate frame.mojom to the new Mojo types
Convert the implementation and all users of the content::mojom::Frame,
FrameBindingsControl, FrameFactory, KeepAliveHandle and FrameHost
interfaces.

Bug: 955171
Change-Id: I46cf976922f67cdce6b27bc9b3c21583f25fd375
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1798346
Commit-Queue: Henrique Ferreiro <hferreiro@igalia.com>
Reviewed-by: Oksana Zhuravlova <oksamyt@chromium.org>
Reviewed-by: Emily Stark <estark@chromium.org>
Reviewed-by: Camille Lamy <clamy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#701092}
2019-09-30 13:54:07 +00:00
Alex Moshchuk
aeb20fe347 Fix remaining NavigateToURL expectations in content_browsertests.
This is hopefully the last step before finally adding
WARN_UNUSED_RESULT to NavigateToURL().

Apart from adding straightforward expectations for regular and redirect
cases, this fixes a couple more bugs:

- AppendingFrameInWebUIDoesNotCrash was broken on Android, because it
  used chrome://tracing, which doesn't exist on Android.

- A couple of tests in WebContentsImplBrowserTest (e.g.,
  ChangeDisplayMode) were navigating to about://blank (instead of
  about:blank), which results in an error rather than a blank page.

Bug: 425335
Change-Id: Id80040de9c3383c517f2df95b819f314e6b29f30
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1819852
Reviewed-by: Łukasz Anforowicz <lukasza@chromium.org>
Commit-Queue: Alex Moshchuk <alexmos@chromium.org>
Cr-Commit-Position: refs/heads/master@{#699854}
2019-09-25 17:40:01 +00:00
Charlie Reis
7660406698 Remove stale TODOs in navigation test.
These have already been fixed in r697145.

Bug: 998284
Change-Id: I53d4770246300cdd0c40716f67de23cf60566312
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1819643
Auto-Submit: Charlie Reis <creis@chromium.org>
Commit-Queue: Arthur Sonzogni <arthursonzogni@chromium.org>
Reviewed-by: Arthur Sonzogni <arthursonzogni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#699251}
2019-09-24 08:37:05 +00:00
arthursonzogni
ca6496df42 Test and fix about:srcdoc inheritance.
Make about:srcdoc to inherit CSP from its parent.

Bug: 1001982
Change-Id: I5e750a8d821e6a8e8cc81e6c8a0feeb7583de020
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1789541
Reviewed-by: Dave Tapuska <dtapuska@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Camille Lamy <clamy@chromium.org>
Commit-Queue: Arthur Sonzogni <arthursonzogni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#698438}
2019-09-20 11:20:49 +00:00
Dominic Farolino
191ccfc5d9 Add browser-initiated navigation referrer policy tests
This CL adds navigation browsertests ensuring that
NavigationController::LoadURLParams::referrer's referrer policy is
honored. This is a regression test that fails with my referrer policy CL
that we reverted (crrev.com/c/1806618) due to incorrectly cancelled
requests. The tests in this CL ensures that browser-initiated navigations
have the correct referrer set for all referrer policies.

Bug: 1004083
Change-Id: Ifbca8d2847de53a63494a58f8fb73d323e9bdb0a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1809128
Commit-Queue: Dominic Farolino <dom@chromium.org>
Reviewed-by: Yutaka Hirano <yhirano@chromium.org>
Reviewed-by: Jochen Eisinger <jochen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#698104}
2019-09-19 17:49:42 +00:00
Mohamed Abdelhalim
8262385adf Navigation: Remove NavigationHandleImpl usages 5.
This is the 5th CL of multiple CLs to remove the usages of
NavigationHandleImpl completely and replace it with NavigationRequest.

This CL aims at replacing navigation_request->navigation_handle()->*
pattern with navigation_request->*.

Bug: 995268
Change-Id: I40a10f674ee5adecefbfe9183654a3a3b9a3f4e9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1807196
Reviewed-by: Arthur Sonzogni <arthursonzogni@chromium.org>
Reviewed-by: Lowell Manners <lowell@chromium.org>
Reviewed-by: Camille Lamy <clamy@chromium.org>
Commit-Queue: Mohamed Abdelhalim <zetamoo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#697569}
2019-09-18 12:06:10 +00:00
arthursonzogni
69a6a1b82a Invalidate the URL systematically when DiscardNonCommittedEntries()
The NavigationController was not invalidating the URL when a pending
entry was removed.

To fix this, be more systematic, more stupid. Always invalidate the URL
when DiscardNonCommittedEntries() is called.

Bug: 998284.
Change-Id: I01f1d16bcb25fa827bf68a52db4de531429a8564
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1781434
Commit-Queue: Arthur Sonzogni <arthursonzogni@chromium.org>
Reviewed-by: Tao Bai <michaelbai@chromium.org>
Reviewed-by: Tommy Li <tommycli@chromium.org>
Reviewed-by: Charlie Reis <creis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#697145}
2019-09-17 09:23:00 +00:00
Julie Jeongeun Kim
ed2e5ba73d Convert NavigationClient to new Mojo types
This CL converts NavigationClientAssociatedPtrInfo,
NavigationClientAssociatedPtr, NavigationClientPtr,
and NavigationClientAssociatedRequest to new
Mojo types.

It also updates BeginNavigation from frame.mojom
and methods and members which implements it with
new Mojo types.

Bug: 955171
Change-Id: I2ed4aa7cdf57361c982e3adc696cc9ead797630b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1797823
Reviewed-by: Oksana Zhuravlova <oksamyt@chromium.org>
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Commit-Queue: Julie Kim <jkim@igalia.com>
Cr-Commit-Position: refs/heads/master@{#695984}
2019-09-12 10:14:17 +00:00
arthursonzogni
55d9c72fd3 Add regression test for bug 998284.
Content's embedders are not notified the visible URL has been
invalidated. This CL adds a regression test showing this.

Bug: 998284.
Change-Id: Ib3a239d65f98209688b3b682cbe9a6184707c371
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1780822
Commit-Queue: Arthur Sonzogni <arthursonzogni@chromium.org>
Reviewed-by: Charlie Reis <creis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#695543}
2019-09-11 09:43:16 +00:00
Miyoung Shin
2be9da7a00 Convert DocumentInterfaceBroker to new Mojo types
This CL converts DocumentInterfaceBroker{Ptr, Request} in content,
blink, extension and media to the new Mojo types and uses
pending_remote<blink.mojom.DocumentInterfaceBroker> in
document_scoped_interface_bundle.mojom and
pending_receiver<blink.mojom.DocumentInterfaceBroker> in
frame_messages.mojom.

Bug: 955171, 978694
Change-Id: Ic0ccabb445febbf8b2bd81aa754fc0abecfb77b2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1781900
Commit-Queue: Miyoung Shin <myid.shin@igalia.com>
Reviewed-by: John Abd-El-Malek <jam@chromium.org>
Reviewed-by: Oksana Zhuravlova <oksamyt@chromium.org>
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Cr-Commit-Position: refs/heads/master@{#693066}
2019-09-04 09:04:10 +00:00
arthursonzogni
2ce31ab03b Use the correct process for about:srcdoc
It turns out the process used to load about:srcdoc was not always
correct. For instance, when starting from A(B), if B navigates to
about:srcdoc, it was sometimes loading in B's process instead of
A's process. This is now fixed and enforced.
This is not a regression. The previous code about srcdoc in
RenderFrameHostManager::CanSubframeSwapProcess() isn't really effective
when the about:srcdoc navigation happens AFTER a cross-process one.

Bug: 996044, 996725
Change-Id: I670ee6dc917cfe4cb02721a58a79a1a415b45e61
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1773264
Reviewed-by: Arthur Sonzogni <arthursonzogni@chromium.org>
Reviewed-by: Alex Moshchuk <alexmos@chromium.org>
Reviewed-by: Łukasz Anforowicz <lukasza@chromium.org>
Commit-Queue: Arthur Sonzogni <arthursonzogni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#692853}
2019-09-03 21:12:00 +00:00
Miyoung Shin
da5da32e4b Convert NavigationInitiator to new Mojo types
This CL converts NavigationInitiator{Ptr, Request} in content and
blink to the new Mojo types, and uses
pending_remote<blink.mojom.NavigationInitiator> in frame.mojom.

Bug: 955171, 978694
Change-Id: I89d54747b61cc1cfa4e0ee46c1013b560150c07e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1776157
Commit-Queue: Miyoung Shin <myid.shin@igalia.com>
Reviewed-by: Oksana Zhuravlova <oksamyt@chromium.org>
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Cr-Commit-Position: refs/heads/master@{#692429}
2019-09-02 10:07:37 +00:00
Julie Jeongeun Kim
249cfbb257 Convert BlobURLTokenPtr/PtrInfo to new Mojo types
This CL converts BlobURLTokenPtr and BlobURLTokenPtrInfo
to new Mojo types.
It updates BeginNavigation from frame.mojom,
CreateWorkerHostAndStartScriptLoad from
dedicated_worker_host_factory.mojom, and Connect from
shared_worker_connector.mojom

Bug: 955171, 978694
Change-Id: If9cbac3e3500803e9f9bb8914c59c8ba14ea2149
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1774422
Commit-Queue: Julie Kim <jkim@igalia.com>
Reviewed-by: Ken Rockot <rockot@google.com>
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Reviewed-by: Matt Falkenhagen <falken@chromium.org>
Cr-Commit-Position: refs/heads/master@{#691955}
2019-08-30 06:44:05 +00:00
arthursonzogni
e4b1d2dcf2 [revert] Allow about:srcdoc{#foo,?bar}
As a defensive measure, navigation to about:srcdoc#foo and
about:srcdoc? were disallowed by:
https://chromium-review.googlesource.com/c/chromium/src/+/1663421
The assumption were wrong. It is totally possible to make a same-document
navigation into about:srcdoc. This CL reverts parts of the previous CL.

Bug: 996044, 996725
Change-Id: I53ac8efa9ec7f0adb4cecc85163b8d037497c0e0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1773263
Commit-Queue: Łukasz Anforowicz <lukasza@chromium.org>
Reviewed-by: Łukasz Anforowicz <lukasza@chromium.org>
Reviewed-by: Nasko Oskov <nasko@chromium.org>
Cr-Commit-Position: refs/heads/master@{#691275}
2019-08-28 19:09:05 +00:00
arthursonzogni
52236e1436 Cleanup: Remove unused NavigationRecorder class.
Bug: None.
Change-Id: Icdc78e4134664feb9fca3c27c907bec11b093466
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1768138
Auto-Submit: Arthur Sonzogni <arthursonzogni@chromium.org>
Reviewed-by: Camille Lamy <clamy@chromium.org>
Commit-Queue: Camille Lamy <clamy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#690374}
2019-08-26 15:53:27 +00:00
arthursonzogni
79120c0f68 Run NavigationBrowserTest.
They were disabled by mistake by commit:
https://chromium-review.googlesource.com/c/chromium/src/+/1699374

Bug: 996725
Change-Id: Iab5bfa3dba506119bb1093d53e5db7dec2cd4c98
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1764199
Auto-Submit: Arthur Sonzogni <arthursonzogni@chromium.org>
Reviewed-by: Nasko Oskov <nasko@chromium.org>
Commit-Queue: Nasko Oskov <nasko@chromium.org>
Cr-Commit-Position: refs/heads/master@{#689515}
2019-08-22 17:02:02 +00:00
Stephen Chenney
bccdd030fb [Reland] Disable input until we present something to the user
Reland of https://chromium-review.googlesource.com/c/chromium/src/+/1590415

When a document loads, there is a significant period between when
the frame is created and when the user sees content. During this time,
the document is not processing lifecycle updates but Javascript is
scheduled and the RenderWidget exists to handle input.

A major concern is that users might click on some place where there is
something reactive laid-out and available for hit testing and processing
(an ad, a link, start a video) before they have actually seen anything to
click on. Think of something like a last ditch attempt to click on
something on the page you're navigating away from only to hit something
on the page you're navigating to.

It seems safer to avoid this rather than have unexpected and potentially
very nasty behavior. In theory this situation was possible before with
deferred lifecycle updates though it apparently never warranted concern.
But we're preparing to enable the flag that defers the first compositor
commit until we have some content ready to raster (or a timeout), in
which case document lifecycles are running and there is content there
to hit-test against and send events to, but the user hasn't seen it yet
(for half a second at most, right now).

This patch suppresses all input from the time when RenderWidget navigates
to a frame to the time we are notified of the first compositor commit and
paint, which is the best estimate we have for the user seeing something.

This patch may affect the FirstInputDelay (FID) web platform metric.
FID may improve because dropped input won't be measured at all, and
the delay for the first event we actually process will be smaller because
it will come when the system is less stressed. i.e. after initial layout
and paint. Regardless, the impact on FID will be monitored when this
patch lands.

A command line switch is added to allow early input for tests. Many tests
are flaky with this patch because they do not reliably wait for input,
and in some cases we cannot easily modify the tests to wait (for example,
web_tests and Android java-based tests). The open issue crbug.com/987626
exists to burn down the set of tests needing the flag, and possibly remove it.

Sheriffs, please to not revert this for flakiness. Flakiness can be
addressed by modifying individual flaky tests with the
"allow-pre-commit-input" command line flag.

Bug: 958424
Change-Id: Iea30f5b3bb2b1505a7ab7bfe749d0700f6db1027
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1729803
Commit-Queue: Stephen Chenney <schenney@chromium.org>
Reviewed-by: Richard Coles <torne@chromium.org>
Reviewed-by: Rouslan Solomakhin <rouslan@chromium.org>
Reviewed-by: Reilly Grant <reillyg@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Reviewed-by: David Bokan <bokan@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/master@{#687220}
2019-08-15 12:21:28 +00:00
Matt Menke
ddf8dfc200 Prevent untrusted consumers from setting a param on ResourceRequest.
|update_network_isolation_key_on_redirect| should only be set on
navigation requests, and renderers are not trusted to set it.

This CL introduces ResourceRequest::TrustedParams, which contains fields
only the browser process is trusted to set, and an |is_trusted| bit that
can be set when creating URLLoaderFactories. If TrustedParams are sent
to a URLLoaderFactory without that bit set, the request will fail.

Bug: 991736
TBR: alexilin@chromium.org
Change-Id: Id3263e03e663b330ee9c21682a4d0de753c5331a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1744926
Commit-Queue: Matt Menke <mmenke@chromium.org>
Reviewed-by: Shivani Sharma <shivanisha@chromium.org>
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Cr-Commit-Position: refs/heads/master@{#686472}
2019-08-13 17:44:48 +00:00