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}
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}
This CL also fixes a missing lock that was found by the compile-time
analysis in ChildProcessSecurityPolicyImpl::HasPermissionsForFileSystemFile.
Bug: 887645
Change-Id: I940ade66bb2d754669c2b5bd408b63c91a1a8d5a
Reviewed-on: https://chromium-review.googlesource.com/1237145
Commit-Queue: Łukasz Anforowicz <lukasza@chromium.org>
Reviewed-by: Charlie Reis <creis@chromium.org>
Reviewed-by: Alex Moshchuk <alexmos@chromium.org>
Cr-Commit-Position: refs/heads/master@{#593334}
This CL adds a feature for always keeping a separate RenderProcessHost
for the most recently used BrowserContext. The feature is enabled by
default, but only consulted in presence of site-per-process. Having a
spare renderer should hopefully avoid regressing page load metrics in
cross-site navigations (which before this CL needed to wait in
site-per-process mode until a new process was spawned).
After this CL, MaybeTakeSpareRenderProcessHost won't discard a
mismatched spare when in site-per-process mode (unless over the process
limit). SpareRenderProcessHostManager::PrepareForFutureRequests method
has also been added - this method is responsible for warming-up another
spare in site-per-process mode. PrepareForFutureRequests is called
when:
1. The previous spare was taken
(in RenderProcessHostImpl::GetProcessHostForSiteInstance)
Note: A new spare is not warmed-up when the previous spare was
mismatched and not taken to avoid spawning two processes at the
same time.
2. A navigation redirects into a SiteInstance that needs a new process
(in NavigationRequest::OnRequestRedirected)
3. A navigation is ready to commit (this handles postponing spawning
of the spare in the scenario handled in the note of scenario #1
above; this happens in NavigationRequest::CommitNavigation)
4. A same-site navigation happens (this retains the behavior from before
the CL that allows discarding of the spare in this scenario; this
happens in RenderFrameHostManager::GetSiteInstanceForNavigation)
This CL also ensures that the spare is considered (and potentially
discarded) before considering process reuse because of the process
limit. The change of the order of operations helps avoid process reuse
in some scenarios.
Remaining changes in this CL update various tests, so they can properly
account for the extra spare renderer.
Bug: 808114
Change-Id: Ica0226c2dc390102789b2c33f6b538c3e27eea82
Tbr: sky@chromium.org, sadrul@chromium.org, pavely@chromium.org
Reviewed-on: https://chromium-review.googlesource.com/963405
Commit-Queue: Łukasz Anforowicz <lukasza@chromium.org>
Reviewed-by: Bernhard Bauer <bauerb@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Reviewed-by: Vasilii Sukhanov <vasilii@chromium.org>
Reviewed-by: Alex Moshchuk <alexmos@chromium.org>
Reviewed-by: Istiaque Ahmed <lazyboy@chromium.org>
Reviewed-by: Kenneth Russell <kbr@chromium.org>
Reviewed-by: Peter Kasting <pkasting@chromium.org>
Reviewed-by: Albert J. Wong <ajwong@chromium.org>
Cr-Commit-Position: refs/heads/master@{#550287}
The Shutdown() API was added to RenderProcessHost with parameters
reflecting those of the underlying base::Process::Terminate() API,
which include a synchronous |wait| option.
We never use Shutdown(.., wait=true) in production code, and in tests
we can instead use a RenderProcessHostObserver to wait for a process
to crash or exit, so we can remove the |wait| parameter and simplify
both callers and the implementation.
Bug: 806451
Change-Id: I2aeae32a3d20488b4970cf96959eaa287642b7ed
Reviewed-on: https://chromium-review.googlesource.com/936450
Commit-Queue: Wez <wez@chromium.org>
Reviewed-by: John Abd-El-Malek <jam@chromium.org>
Cr-Commit-Position: refs/heads/master@{#540713}
WebContents::GetRenderProcessHost is an API that doesn't behave as
expected with out-of-process iframes, as multiple processes can be
associated with a single WebContents. This CL replaces callers of this
API, so that they go through an equivalent API that explicitly selects
which frame's process is needed.
This CL was started by using an ad-hoc clang-plugin that replaced
existing callsites of WebContents::GetRenderProcessHost() with a call to
something like wc->GetMainFrame()->GetProcess(). This was followed-up
by manually adding an include of render_frame_host.h and git cl format
and git cl lint and then a self-review with small tweaks (e.g. sometimes
using a wc->GetRenderViewHost()->GetProcess() is more appropriate).
This CL was uploaded by git cl split.
R=boliu@chromium.org
Bug: 666525
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_site_isolation
Change-Id: I13380dbc5c3339e7b7acdd28c574517b668d4cf2
Reviewed-on: https://chromium-review.googlesource.com/689026
Reviewed-by: Avi Drissman <avi@chromium.org>
Commit-Queue: Łukasz Anforowicz <lukasza@chromium.org>
Cr-Commit-Position: refs/heads/master@{#505111}
base::KillProcess doesn't work on android because a renderer process is running as an isolated process.
So we need to use StopChildProcess to kill it.
BUG=433068
Review URL: https://codereview.chromium.org/740813004
Cr-Commit-Position: refs/heads/master@{#306931}
The Google C++ style guide states:
Explicitly annotate overrides of virtual functions or virtual
destructors with an override or (less frequently) final specifier.
Older (pre-C++11) code will use the virtual keyword as an inferior
alternative annotation. For clarity, use exactly one of override,
final, or virtual when declaring an override.
To better conform to these guidelines, the following constructs have
been rewritten:
- if a base class has a virtual destructor, then:
virtual ~Foo(); -> ~Foo() override;
- virtual void Foo() override; -> void Foo() override;
- virtual void Foo() override final; -> void Foo() final;
This patch was automatically generated. The clang plugin can generate
fixit hints, which are suggested edits when it is 100% sure it knows how
to fix a problem. The hints from the clang plugin were applied to the
source tree using the tool in https://codereview.chromium.org/598073004.
BUG=417463
R=nasko@chromium.org
Review URL: https://codereview.chromium.org/678073006
Cr-Commit-Position: refs/heads/master@{#301534}
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
Move the WebContentsImpl class to files in web_contents.
BUG=105875
TEST=no change
Review URL: http://codereview.chromium.org/10054012
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@131845 0039d316-1c4b-4281-b951-d872f2087c98
interface lives in content\browser\child_process_security_policy_impl.cc/.h.
Moved some security checks from the TabContentsDelegate implementation (chrome\browser) to the TabContents
code in content.
BUG=98716
Review URL: https://chromiumcodereview.appspot.com/9360014
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@121137 0039d316-1c4b-4281-b951-d872f2087c98
on win,linux,mac.
Original change: Rename TabContents::controller() to GetController and put it into the WebContents namespace.
BUG=98716
TBR=dpranke
Review URL: http://codereview.chromium.org/8956050
TBR=jam
Review URL: http://codereview.chromium.org/9018016
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@115346 0039d316-1c4b-4281-b951-d872f2087c98
The RenderProcessHost public interface was created from the now deleted RenderProcessHost class defined in content\browser\renderer_host\render_process_host.h.
Additional methods have been added to the interface to ensure that it works correctly with the MockRenderProcessHost class used by unit tests. I had to implement a number of overrides in the MockRenderProcessHost class to ensure that tests work correctly. This was because of assumptions in the tests that the MockRPH class was a real RPH which it was till now.
Added a TODO for the methods which could potentially be removed from this interface. Will revisit that in a subsequent CL.
BUG=98716
TEST=No change in functionality. Hopefully it all compiles and works.
Review URL: http://codereview.chromium.org/8515027
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@110615 0039d316-1c4b-4281-b951-d872f2087c98
content/common/result_codes.h contains only the codes defined in content. chrome/common/chrome_result_codes.h contains the codes defined in chrome and also includes (for convenience) the content header.
R=jam@chromium.org
BUG=76699
TEST=everything compiles
Review URL: http://codereview.chromium.org/7397004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@93082 0039d316-1c4b-4281-b951-d872f2087c98
This adds a new file into chrome/common and does a lot of renaming.
The current version is just a sketch of the headers, and nothing will
compile.
R=jam@chromium.org
BUG=76699
TEST=everything still compiles and runs
Review URL: http://codereview.chromium.org/7377010
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@92730 0039d316-1c4b-4281-b951-d872f2087c98