NOTREACHED() and NOTREACHED_IN_MIGRATION() are both CHECK-fatal now.
The former is [[noreturn]] so this CL also performs dead-code removal
after the NOTREACHED().
This CL does not attempt to do additional rewrites of any surrounding
code, like:
if (!foo) {
NOTREACHED();
}
to CHECK(foo);
Those transforms take a non-trivial amount of time (and there are
thousands of instances). Cleanup can be left as an exercise for the
reader.
This does clean up kCrashOnDanglingBrowserContext as both paths of the
kill switch are currently fatal. This has been rolled out for a long
time.
Bug: 40580068, 40062641
Change-Id: Ib88e710d003e2e48df3fc502ca54d2341d157a0e
Cq-Include-Trybots: luci.chromium.try:linux-dcheck-off-rel
Low-Coverage-Reason: OTHER Should-be-unreachable code
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5974816
Reviewed-by: Łukasz Anforowicz <lukasza@chromium.org>
Commit-Queue: Łukasz Anforowicz <lukasza@chromium.org>
Reviewed-by: Rakina Zata Amni <rakina@chromium.org>
Auto-Submit: Peter Boström <pbos@chromium.org>
Reviewed-by: Sam McNally <sammc@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1376522}
This CL moves
`third_party/blink/public/common/browser_interface_broker_proxy.h`
to
`third_party/blink/public/platform/browser_interface_broker_proxy.h`
Motivation:
* This header is not included from any browser-process code and
therefore doesn't need to be in `.../common/...`.
* This resolves layering ickiness introduced by the previous CL (see
https://crrev.com/c/5647559) which moved implementation of this type
deeper into Blink (e.g. using `CrossVariantMojoRemote` and similar
utilities which are normally available to the `platform` code but not
to the `common` code).
This CL has been generated semi-automatically - most of the files
changed by this CL have just been updated to use the new `#include` path
(as generated by `tools/git/mass-rename.sh`). Manual changes are
concentrated in the following files:
* Moving
`third_party/blink/public/common/browser_interface_broker_proxy.h`
to
`third_party/blink/public/platform/browser_interface_broker_proxy.h`
- This also removed a `nogncheck` ickiness left by the previous CL
- This had to switch from `BLINK_COMMON_EXPORT` to
`BLINK_PLATFORM_EXPORT`
* Removing layering ickiness in `third_party/blink/public/common/DEPS`
* `DEPS` update and/or simplification in:
- `chromecast/media/DEPS`
- `components/page_image_annotation/content/renderer/DEPS`
- `components/translate/content/renderer/DEPS`
- `media/mojo/clients/DEPS`
* Changing a dependency in `media/fuchsia/video/BUILD.gn` and
`chromecast/media/audio/BUILD.gn`
* Adjusting which target builds the moved files:
- `third_party/blink/common/BUILD.gn`
- `third_party/blink/public/BUILD.gn`
* Deleting `third_party/blink/common/browser_interface_broker_proxy.cc`
- This also involves tweaking
`third_party/blink/public/common/BUILD.gn`
- Parts of that `.cc` file have been preserved in
`.../platform/mojo/browser_interface_broker_proxy_impl.cc`
(e.g. `EmptyBrowserInterfaceBrokerProxy` and default definitions
of `BrowserInterfaceBrokerProxy`'s constructor and destructor)
Bug: 41482945
Change-Id: I6048c855279c438b7dbfc8467b859df70e2d2012
AX-Relnotes: n/a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5651622
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Auto-Submit: Łukasz Anforowicz <lukasza@chromium.org>
Commit-Queue: Daniel Cheng <dcheng@chromium.org>
Owners-Override: Daniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1327283}
Suppress unsafe buffer usage on a file-by-file basis. Out of
approximately 5850 .cc and .h files only roughly 160 files fail
compilation with the unsafe buffers warning.
Suppress only, by inserting boilerplate into affected files. Do not
re-write any code to work around the issues. Properly fixing each file
will be done in follow-up CLs.
//content/ is not removed from unsafe_bufers_paths.txt file and will be
also done as a follow-up, so it makes potential reverts simpler.
Bug: 342213636
Change-Id: I4a936e63dea95a78951f7bfae6d5487708ae3c0b
AX-Relnotes: n/a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5608913
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Owners-Override: Daniel Cheng <dcheng@chromium.org>
Commit-Queue: Nasko Oskov <nasko@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1312393}
This was generated by replacing " NOTREACHED()" with
" NOTREACHED_IN_MIGRATION()" and running git cl format.
This prepares for making NOTREACHED() [[noreturn]] alongside
NotReachedIsFatal migration of existing inventory.
Bug: 40580068
Change-Id: I3b48b89911ac5e9ffcb211622992f917f8f9e8d9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5539619
Auto-Submit: Peter Boström <pbos@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Owners-Override: Lei Zhang <thestig@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Peter Boström <pbos@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1301096}
In the past couple of days we've started to see a handful of crashes
on WebView Canary only. The crashes do not make sense so add some
additional state checks.
Bug: 1517105
Change-Id: Ic04c2e6c3955016337413f22f0af0ca42853f50b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5190331
Commit-Queue: Dave Tapuska <dtapuska@chromium.org>
Reviewed-by: Richard (Torne) Coles <torne@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1246004}
Requesting a Remote interface via GetBrowserInterfaceBroker can get
dropped if it is in between a navigation. This can happen because
the DidClearWindow is invoked first then the GetRemoteObjectHost can
get called followed by the BrowserInterfaceBroker getting reset.
Avoid this by just passing in the Host to the GinJavaBridge when
it is bound. It simplifies code and avoids the race.
Bug: 1501450
Change-Id: I5e20ddb7fdb271277e2db3a05a3e3c78ea2f5b60
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5033241
Reviewed-by: Avi Drissman <avi@chromium.org>
Commit-Queue: Dave Tapuska <dtapuska@chromium.org>
Reviewed-by: Richard (Torne) Coles <torne@chromium.org>
Reviewed-by: Robert Sesek <rsesek@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1225169}
ForEachRenderFrameHostIncludingSpeculative visits every
RenderFrameHost we should not send the named objects to
RenderFrameHosts that are not alive yet as this can lead to dropped
mojo messages.
RenderFrameCreated will get called when the RenderFrame on the renderer has been indeed created and it is safe then to send the
mojo messages.
Handle the host being disconnected and rebind.
Bug: 1501450
Change-Id: I74c4b053662ad60bce4968062753af5b091e18b4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5029320
Commit-Queue: Dave Tapuska <dtapuska@chromium.org>
Reviewed-by: Richard (Torne) Coles <torne@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1224502}
Code prior to mojom based bridge did not initialize error value
correctly which caused a CheckError when the mojo object failed
to send the InvokeMethod call. Check the return code and assign
the correct initialization value to error.
Bug: 1501450
Change-Id: I001bb6dc370dab1835e7b649eed5b9b2bbccef86
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5029575
Reviewed-by: Richard (Torne) Coles <torne@chromium.org>
Commit-Queue: Dave Tapuska <dtapuska@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1224410}
This is a slightly different approach as taken in the past.
- The GinJavaBridge needs to be an associated interface so that the
AddNamedObject doesn't race with the navigation messages.
- The serialization is kept the same (no onion souping yet), all
serialization still occurs in content/renderer/java
- The content.mojom.GinJavaBridge interfaces are similar to the
blink.mojom.RemoteObject interfaces in the hopes that once this
approach proves correct and we have removed the legacy IPC we
can then proceed to change the serialization (and hosting where
the objects on the renderer side are bound but keeping the
content/browser/android/java implementation) and as well remove
the java based implementation that doesn't support associated
interfaces.
This interface is disabled by default and is toggled via the
GinJavaBridgeMojo feature flag.
Bug: 794320
Change-Id: Ifb0ad0b71ccb69f7149bbb772eee925adccb2050
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4968451
Reviewed-by: Richard (Torne) Coles <torne@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Reviewed-by: Ken Buchanan <kenrb@chromium.org>
Commit-Queue: Dave Tapuska <dtapuska@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1220543}
Mojo's bindings for ListValue require transfer of ownership not a
const ref, so change the definition in preparation for conditionally
compiling this against a mojo target.
Bug: 1286517
Change-Id: Ifc4e248f82eeac72db024c0e37e1d823e66dfc7f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4960974
Reviewed-by: Richard (Torne) Coles <torne@chromium.org>
Commit-Queue: Dave Tapuska <dtapuska@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1213854}
This change is not intended to change any behavior. This is a
mediumweight rewrite applied primarily to renderer code, promoting a
bunch of `T*` into `raw_ptr<T>` (or `T&` to `raw_ref<T>`).
MiraclePtr is not yet generally enabled in the renderer process,
so this should only affect rewritten members by turning them into
no-op `raw_ptr` (thought to have negligible overhead).
Given the scope of the rewrite and the security benefits, we feel that
the binary size increase is unavoidable.
AX-Relnotes: n/a.
Binary-Size: Size increase is unavoidable (see above).
Bug: 1444624
Change-Id: I1cda6fe446b1a8552cb3c98c1afeae0f15218619
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4904523
Owners-Override: Keishi Hattori <keishi@chromium.org>
Commit-Queue: Kalvin Lee <kdlee@chromium.org>
Reviewed-by: Keishi Hattori <keishi@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1203810}
Switch to base::Value::List from deprecated base::ListValue. Along the
way, convert "new" keyword usage to std::make_unique() and
base::MakeRefcounted(), and also apply various code modernizations that
ClangTidy would warn about.
Bug: 1187062
Change-Id: I4558f4a3986d65ea778344465275f253c227d875
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3945688
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Matthew Denton <mpdenton@chromium.org>
Reviewed-by: Richard Coles <torne@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1057685}
This CL removes calls to this deprecated member function. When
it's not too intrusive, this CL attempts to modernize the use
of DictionaryValue and ListValue to base::Value::Dict and
base::Value::List to avoid using Value::FromUniquePtrValue.
This CL was uploaded by git cl split.
R=michaelbai@chromium.org
Bug: 1187097
Change-Id: I7b38bb7611ccbc31dc82e305110f59fbc6d080f4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3516602
Auto-Submit: David Bertoni <dbertoni@chromium.org>
Reviewed-by: Michael Bai <michaelbai@chromium.org>
Commit-Queue: Michael Bai <michaelbai@chromium.org>
Cr-Commit-Position: refs/heads/main@{#980245}
It's unneeded since we always use an isolate from a single thread, and causes trouble with other tests in content_unittests also covering v8 (see e.g. crbug.com/1228034, crbug.com/1228033)
Further, we might need to use renderer processes on Android, in which case configuring V8 differently from blink will be trouble.
This CL also reverts previous workarounds in other tests for the trouble our use of locker caused that were added in https://chromium-review.googlesource.com/c/chromium/src/+/3173813
Bug: 1228034
Bug: 1228033
Change-Id: Ie205e19a4a10887b20d9f8ecd8684d66c45b3a1e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3216493
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: Matt Menke <mmenke@chromium.org>
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Commit-Queue: Maks Orlovich <morlovich@chromium.org>
Cr-Commit-Position: refs/heads/main@{#976742}
To remove base::ListValue::Get(), this CL replaces it with
base::Value::GetListDeprecated(). GetListDeprecated() is also marked as
deprecated but this should be a good intermediate step to remove both
the functions.
Bug: 1187084
Change-Id: I0122f1f692b2620734b5b42a89604c1936f55063
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3440088
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Owners-Override: Daniel Cheng <dcheng@chromium.org>
Commit-Queue: Hiroki Nakagawa <nhiroki@chromium.org>
Cr-Commit-Position: refs/heads/main@{#968219}
GetList() will be reimplemented in a future CL with an updated
signature, so existing uses need to be renamed out of the way.
Unlike TakeList() and TakeDict(), GetList() is used quite widely. This
CL migrates a number of uses using the following set of automated steps:
sed -i "s|->GetList()|->GetListDeprecated()|g" \
$(git gs "GetList()" --name-only)
git checkout -- base/values_unittest.cc third_party/dom_distiller_js
git cl format
Bug: 1291666
Change-Id: I1b7a92fcb4874e7afb82d4bd092c1c9de2cc3d05
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3430698
Reviewed-by: danakj chromium <danakj@chromium.org>
Owners-Override: danakj chromium <danakj@chromium.org>
Commit-Queue: Daniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/main@{#966487}
This inlines all remaining DISALLOW_* macros in content/. This is done
manually (vim regex + manually finding insertion position).
IWYU cleanup is left as a separate pass that is easier when these macros
go away.
Bug: 1010217
Change-Id: I8b5ea6dd9f8a3f584cf3eef82634017a38b15be8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3193883
Commit-Queue: Peter Boström <pbos@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Auto-Submit: Peter Boström <pbos@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Owners-Override: Lei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/main@{#936160}
Once v8::Locker is active, HandleScope will crash without any proper
locking. Since *WorkletTest, SharedStorageObjectMethodTest and so on use
v8::Locker, after running one of the tests, HandleScope needs locking.
Change-Id: Ia5cd093ae139f2ff18c559783fac1d2f69c78f53
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3173813
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Reviewed-by: Michael Bai <michaelbai@chromium.org>
Commit-Queue: Takashi Sakamoto <tasak@google.com>
Cr-Commit-Position: refs/heads/main@{#924612}
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}
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 change removes the use of Value::GetAsDouble
and replaces with Value::is_double(), Value::GetDouble(),
Value::GetIfDouble().
Bug: 1187006
Change-Id: Iff2bddce1e88fd50610c192a786dc9a87e224530
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2870489
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Commit-Queue: Ayu Ishii <ayui@chromium.org>
Cr-Commit-Position: refs/heads/master@{#879638}
This is just a convoluted way of writing nullptr, so rewrite it in the
simpler form. PRESUBMIT.py already disallows new instances of
std::unique_ptr<T>(). This removes existing instances.
Change-Id: Id2bbf661765d1ef149164d655c09a4ea6e2e476c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2824941
Reviewed-by: Nasko Oskov <nasko@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/master@{#872501}
This CL fixes problems that -1 of Int8Array is converted to 255 since it
is the casting as the char type and that a maximum value of
Uint{16, 32}Arrays are converted to -1 since they are the casting as the
signed types in TypedArraySerializerImpl.
For Uint32Array, this CL serializes/deserializes the value as the binary
type since base::Value supports the only int for the integer type.
Bug: 1148997
Change-Id: I52af228070606e4cd3f293dd80e4f0ca53b6b082
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2589535
Reviewed-by: Bo <boliu@chromium.org>
Reviewed-by: Richard Coles <torne@chromium.org>
Reviewed-by: Shimi Zhang <ctzsm@chromium.org>
Commit-Queue: Miyoung Shin <myid.shin@igalia.com>
Cr-Commit-Position: refs/heads/master@{#841033}
Nothing especially interesting here, just using OnceCallback where
possible, and BindRepeating for places that expect a RepeatingCallback.
Renamed "Callback" type alias in the fetcher code to "StartCallback" to
not look like the base::Callback type.
R=avi@chromium.org
Bug: 953861, 751838
Change-Id: Ifac10f07a90a86fa5b784b3e1c6dbdee4ce626d2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1626345
Reviewed-by: Avi Drissman <avi@chromium.org>
Reviewed-by: Frank Liberato <liberato@chromium.org>
Commit-Queue: danakj <danakj@chromium.org>
Cr-Commit-Position: refs/heads/master@{#663299}
The PostTaskToInProcessRendererAndWait() method can take a OnceCallback
since it runs it once, so we do, and callers are changed use BindOnce().
The V8ValueConverter takes a Callback which it never uses, so remove it
from the parameters instead of converting it to an appropriate type.
A few other simple conversions in content/renderer/worker and service_worker.
R=avi@chromium.org
Bug: 953861
Change-Id: I8e77532b6d5e40b5961b6f5193acde6bc9818389
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1623489
Reviewed-by: Avi Drissman <avi@chromium.org>
Reviewed-by: Ken Rockot <rockot@google.com>
Commit-Queue: danakj <danakj@chromium.org>
Cr-Commit-Position: refs/heads/master@{#662297}