0
Commit Graph

83 Commits

Author SHA1 Message Date
Sandor «Alex» Major
e9545a72e6 Reland "Move PermissionsPolicyFeature from Blink to the Network service"
This is a reland of commit 1b851527a0

A new usage of `PermissionsPolicyFeature` appeared in the meantime.
Fixed in this CL.

Original change's description:
> Move `PermissionsPolicyFeature` from Blink to the Network service
>
> The network service is going to need access to the "storage-access"
> Permissions Policy. This is the first step of moving some of the
> Permissions Policy logic out of Blink to maintain a single
> implementation of https://w3c.github.io/webappsec-permissions-policy
> across Chromium.
>
> Tha main change here is moving the `PermissionsPolicyFeature` type from
> `blink.mojom` to `network.mojom`:
> https://crrev.com/c/6180431/7/services/network/public/mojom/permissions_policy/permissions_policy_feature.mojom
>
> Bug: 382291442
> Change-Id: Ib99fbd285031936dbf40d5f210816cc775c51dfa
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6180431
> Auto-Submit: Sandor «Alex» Major <sandormajor@chromium.org>
> Reviewed-by: Ari Chivukula <arichiv@chromium.org>
> Reviewed-by: Maks Orlovich <morlovich@chromium.org>
> Owners-Override: Rick Byers <rbyers@chromium.org>
> Reviewed-by: Rick Byers <rbyers@chromium.org>
> Commit-Queue: Sandor «Alex» Major <sandormajor@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1414133}

Bug: 382291442
Change-Id: I853b73f61ab7ecd807fc3d16cd2895c353ebd126
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6219635
Auto-Submit: Sandor «Alex» Major <sandormajor@chromium.org>
Owners-Override: Rick Byers <rbyers@chromium.org>
Reviewed-by: Ari Chivukula <arichiv@chromium.org>
Reviewed-by: Maks Orlovich <morlovich@chromium.org>
Reviewed-by: Rick Byers <rbyers@chromium.org>
Commit-Queue: Sandor «Alex» Major <sandormajor@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1414345}
2025-01-31 12:40:46 -08:00
Kevin McNee
4a02d170a9 Revert "Move PermissionsPolicyFeature from Blink to the Network service"
This reverts commit 1b851527a0.

Reason for revert: Broke the build https://ci.chromium.org/ui/p/chromium/builders/ci/Linux%20MSan%20Builder/86647/overview

Original change's description:
> Move `PermissionsPolicyFeature` from Blink to the Network service
>
> The network service is going to need access to the "storage-access"
> Permissions Policy. This is the first step of moving some of the
> Permissions Policy logic out of Blink to maintain a single
> implementation of https://w3c.github.io/webappsec-permissions-policy
> across Chromium.
>
> Tha main change here is moving the `PermissionsPolicyFeature` type from
> `blink.mojom` to `network.mojom`:
> https://crrev.com/c/6180431/7/services/network/public/mojom/permissions_policy/permissions_policy_feature.mojom
>
> Bug: 382291442
> Change-Id: Ib99fbd285031936dbf40d5f210816cc775c51dfa
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6180431
> Auto-Submit: Sandor «Alex» Major <sandormajor@chromium.org>
> Reviewed-by: Ari Chivukula <arichiv@chromium.org>
> Reviewed-by: Maks Orlovich <morlovich@chromium.org>
> Owners-Override: Rick Byers <rbyers@chromium.org>
> Reviewed-by: Rick Byers <rbyers@chromium.org>
> Commit-Queue: Sandor «Alex» Major <sandormajor@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1414133}

Bug: 382291442
Change-Id: I068a9cbfb77057ded4295dc214aee51bee8a503c
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6219376
Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Auto-Submit: Kevin McNee <mcnee@chromium.org>
Owners-Override: Kevin McNee <mcnee@google.com>
Cr-Commit-Position: refs/heads/main@{#1414150}
2025-01-31 08:22:14 -08:00
Sandor Major
1b851527a0 Move PermissionsPolicyFeature from Blink to the Network service
The network service is going to need access to the "storage-access"
Permissions Policy. This is the first step of moving some of the
Permissions Policy logic out of Blink to maintain a single
implementation of https://w3c.github.io/webappsec-permissions-policy
across Chromium.

Tha main change here is moving the `PermissionsPolicyFeature` type from
`blink.mojom` to `network.mojom`:
https://crrev.com/c/6180431/7/services/network/public/mojom/permissions_policy/permissions_policy_feature.mojom

Bug: 382291442
Change-Id: Ib99fbd285031936dbf40d5f210816cc775c51dfa
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6180431
Auto-Submit: Sandor «Alex» Major <sandormajor@chromium.org>
Reviewed-by: Ari Chivukula <arichiv@chromium.org>
Reviewed-by: Maks Orlovich <morlovich@chromium.org>
Owners-Override: Rick Byers <rbyers@chromium.org>
Reviewed-by: Rick Byers <rbyers@chromium.org>
Commit-Queue: Sandor «Alex» Major <sandormajor@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1414133}
2025-01-31 07:48:32 -08:00
Peter Kasting
1557e5fbe4 [cleanup] Replace base::ranges with std::ranges: content/
Done entirely with `git grep` and `sed` + `git cl format`, no
hand-editing.

Bug: 386918226
Change-Id: I8561612cb02c9d62c455836dba414ab402e40694
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6199140
Auto-Submit: Peter Kasting <pkasting@chromium.org>
Commit-Queue: Peter Kasting <pkasting@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Owners-Override: Peter Kasting <pkasting@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1412009}
2025-01-27 17:14:08 -08:00
Fergal Daly
5ec9927e9c Enable AllowSensorsToEnterBfcache by default.
This is at 10% in stable and ready to launch to 100%.

Bug: 335768341
Change-Id: I99cc264b620c7699a52ade1c23fedcf65407bfe2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6193086
Reviewed-by: Reilly Grant <reillyg@chromium.org>
Auto-Submit: Fergal Daly <fergal@chromium.org>
Commit-Queue: Reilly Grant <reillyg@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1410649}
2025-01-23 16:43:46 -08:00
rubberyuzu
0cf4385a2d [bfcache] Unblock sensors with a flag
This CL unblocks various sensors API from entering bfcache.

We can simply unblock them without changing the implementation because
sensors are already suspended when the page becomes not visible or
unfocused.[1]

Note that the new browsertests added are disabled on Android, as Android
seems to have a bug where focus is not retrieved after coming out of
bfcache and thus sensor is not resumed. (crbug.com/364143617)

Another note on the browsertest - though we test that Suspend() and
Resume() are called on bfcache entrance / restore, we cannot test that
sensor readings are actually suspended / resumed. This is because
FakeSensor does not have Suspend()/Resume() implementation.

Doc: https://docs.google.com/document/d/1xvop3wlsMMVYPFCpp9hyict_uCQ0Qri5iRHQRlzCe2Y/edit?usp=sharing

[1]: https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/modules/sensor/sensor_proxy.cc;l=79;drc=42debe0b0e6bf90175dd0d121eb0e7dc11a6d29c;bpv=1;bpt=1

Bug: 335768341
Change-Id: I6ccf7959c12610e48a6fbeb382f0576fe458e1c4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5464569
Reviewed-by: Fergal Daly <fergal@chromium.org>
Reviewed-by: Reilly Grant <reillyg@chromium.org>
Commit-Queue: Yuzu Saijo <yuzus@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1357468}
2024-09-19 03:43:44 +00:00
Reilly Grant
56e566276e sensors: Remove the PROXIMITY and PRESSURE sensor types
These sensor types are not implemented on any platform. This change
removes them from the Mojo interface to avoid needing to handle the case
of an unsupported sensor type in the browser process.

Some unit tests needed to be rewritten because they were using these
types since they don't limit update frequency or precision.

Change-Id: I7bdd52f1966a7b002f8a28695ec4120118d1c82e
Fixed: 364119459
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5852174
Reviewed-by: Alex Rudenko <alexrudenko@chromium.org>
Commit-Queue: Reilly Grant <reillyg@chromium.org>
Reviewed-by: Raphael Kubo Da Costa <raphael.kubo.da.costa@intel.com>
Cr-Commit-Position: refs/heads/main@{#1356111}
2024-09-16 20:46:26 +00:00
Peter Boström
01ab59ae08 Migrate NOTREACHED_NORETURN -> NOTREACHED
NOTREACHED() has turned [[noreturn]] so the former macro isn't needed
anymore.

This does not attempt to do a rewrite 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.

NO_IFTTT=No-op-rename migration.

Bug: 40580068
Change-Id: I068c5fdce9dc4c352d8bdd62bb3cd2c0a2d59659
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5782602
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Owners-Override: Daniel Cheng <dcheng@chromium.org>
Commit-Queue: Daniel Cheng <dcheng@chromium.org>
Commit-Queue: Peter Boström <pbos@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1342096}
2024-08-15 02:39:49 +00:00
Lei Zhang
05c13df891 Remove unnecessary ContentBrowserTest::SetUpCommandLine() calls
ContentBrowserTest::SetUpCommandLine() is actually not defined. Calls to
this method ends up running BrowserTestBase::SetUpCommandLine(), which
is always going to be empty. Since there is no point in calling this
method, delete all the callers from SetUpCommandLine() overrides. When
the override becomes empty, delete the override altogether.

Make a note of this in the comments in content_browser_test.h. Also fix
some lint errors along the way.

Change-Id: I81f263286d72ebdab68dfd9575ad4cf2b6378a3c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5691227
Reviewed-by: Avi Drissman <avi@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1325736}
2024-07-10 20:59:12 +00:00
Alison Gale
81f4f2c793 Migrate TODOs referencing old crbug IDs to the new issue tracker IDs
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}
2024-04-22 19:33:31 +00:00
Max Ihlenfeldt
f0a053a746 IWYU for content/browser/generic_sensor/frame_sensor_provider_proxy.cc
Bug: None
Change-Id: I0fb1b493b6b6b37c213fa3a5f90dd8597e863c64
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5119742
Reviewed-by: Reilly Grant <reillyg@chromium.org>
Auto-Submit: Max Ihlenfeldt <max@igalia.com>
Commit-Queue: Reilly Grant <reillyg@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1237073}
2023-12-13 18:38:31 +00:00
Raphael Kubo da Costa
32a9c9efaa Update sensors documentation after the recent virtual sensor commits
//content/browser/generic_sensor/README.md:
- Document the DevTools integration and how the CDP commands are
  implemented by EmulationHandler and the classes in this directory.
- Document the content_shell implementation of the virtual sensor
  commands.

//services/device/generic_sensor:
- Document //content classes and describe how VirtualPlatformSensor and
  VirtualPlatformSensorProvider work and integrated into the rest of the
  architecture.

Bug: 1278377
Change-Id: I7494523f8548e19944a982a4ade2a13deeb9b7e7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4770868
Reviewed-by: Matt Reynolds <mattreynolds@chromium.org>
Auto-Submit: Raphael Kubo Da Costa <raphael.kubo.da.costa@intel.com>
Commit-Queue: Raphael Kubo Da Costa <raphael.kubo.da.costa@intel.com>
Cr-Commit-Position: refs/heads/main@{#1217843}
2023-10-31 20:15:28 +00:00
Raphael Kubo da Costa
7a99b78b8e sensors: Add virtual sensor commands to browser_protocol.pdl and CDP implementation
Design doc:
https://docs.google.com/document/d/1JS2Wnyc9GiS_u1Ry3w4KsCyd51g8fm4RDEUcanZgzbM/edit?usp=sharing

This adds a few types and 3 new commands to the Emulation domain:
* getOverriddenSensorInformation(type: SensorType) -> { requestedSamplingFrequency: number }
* setSensorOverrideEnabled(enabled: boolean, type: SensorType, optional metadata: SensorMetadata)
* setSensorOverrideReadings(type: SensorType, reading: SensorReading)

Together, they allow us to implement the create/get/update/remove
virtual sensor WebDriver commands from the Automation section of the
Generic Sensor spec (the ChromeDriver bits will come later).

Most of the code has already been implemented elsewhere in content and
services. The CDP bits involve exposing the virtual sensor operations
from WebContentsSensorProviderProxy via an RAII object called
ScopedVirtualSensorForDevTools: since the entry point to the virtual
sensor operations is always CDP, this object is responsible for
automatically creating and removing virtual sensors while WCSPP takes
care of creating only one ScopedVirtualSensorForDevTools per sensor
type. This way, each EmulationHandler instance has its own set of
virtual sensors that are cleared when it is disabled, and other handlers
that exist at the same time are unable to create, interact with or
remove these virtual sensors.

[The increase in binary size for Fuchsia cannot be avoided, it all comes
mostly from the generated code for the new data in browser_protocol.pdl and
the new code in content::protocol::EmulationHandler]

Bug: 1278377
Fuchsia-Binary-Size: Size increase is unavoidable.
Change-Id: Ie891bea3f46ff90192ed860f8ffe5361c8485df7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4770864
Commit-Queue: Raphael Kubo Da Costa <raphael.kubo.da.costa@intel.com>
Reviewed-by: Matt Reynolds <mattreynolds@chromium.org>
Auto-Submit: Raphael Kubo Da Costa <raphael.kubo.da.costa@intel.com>
Reviewed-by: Andrey Kosyakov <caseq@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1211361}
2023-10-18 08:04:48 +00:00
Raphael Kubo da Costa
d238424d52 sensors: Add support for virtual sensors in //services
Design doc:
https://docs.google.com/document/d/1JS2Wnyc9GiS_u1Ry3w4KsCyd51g8fm4RDEUcanZgzbM/edit?usp=sharing

This implements the concept of "virtual sensors" from the Automation
section of the Generic Sensor spec. From a spec perspective, virtual
sensors act like device sensors whose readings and properties are
controlled by users.

In Chromium, virtual sensors are represented by the
VirtualPlatformSensor class. There is a specific provider for them,
VirtualPlatformSensorProvider.

There is one VirtualPlatformSensorProvider instance per Mojo connection
that calls CreateVirtualSensor(), so that virtual sensors created in one
tab (not frame, and they persist across navigations) do not interfere
with other tabs (virtual sensors of the same type may be used with
completely different properties, constraints, and readings in different
pages and they should not affect each other).

On the //service side, SensorProviderImpl's `provider_` remains the same
and manages real sensors. The new `virtual_providers_` member maps a
mojo::ReceiverId to a VirtualPlatformSensorProvider.

On the //content side, WebContentsSensorProviderProxy is responsible for
invoking the Mojo operations on SensorProviderImpl. As before, it is not
accessible to Blink.

One consequence of this design is that fusion sensors will continue to
attempt to use only real sensors as sources, unless the fusion sensor
itself is created as a virtual sensor. Another consequence of this
design is that it is possible for real and virtual sensors of the same
type to coexist in the same page: real sensors are used as long as
CreateVirtualSensor() is not called; once that happens new sensors will
be virtual, but existing ones will not be affected.

Finally, the new code is tested by making GenericSensorServiceTest use
virtual sensors. GenericSensorServiceTest already tested the behavior of
the SensorImpl and SensorProviderImpl layer, so it is the ideal place to
start testing how SensorProviderImpl handles virtual sensors. It also
allows us to test a lot of VirtualPlatformSensorProvider directly.

This also helps with bug 1427302 now that usage of
FakePlatformSensor{Provider} usage has reduced considerably.

Bug: 1278377, 1427302
Change-Id: Iebe3e70bfe1d154e305243f876d9ae8b436757c9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4770863
Commit-Queue: Raphael Kubo Da Costa <raphael.kubo.da.costa@intel.com>
Reviewed-by: Ken Buchanan <kenrb@chromium.org>
Reviewed-by: Reilly Grant <reillyg@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1208711}
2023-10-12 08:30:22 +00:00
Raphael Kubo da Costa
73975654a1 sensors: Make Blink Mojo requests go through a new WebSensorProvider interface
This is being done in preparation for adding the concept of "virtual
sensors" that implement the Automation section of the Generic Sensor
spec.

Virtual sensors manipulation is a privileged operation that should not
be exposed to Blink, so we now add a blink.mojom.WebSensorProvider
interface that it is supposed to use instead of
device.mojom.SensorProvider. FrameSensorProviderProxy in //content is
responsible for receiving WebSensorProvider requests and translating
them into SensorProvider ones that reach //services via
WebContentsSensorProviderProxy.

At the moment, both Mojo interfaces expose the same GetSensor() method,
but the idea is for SensorProvider to have extra virtual sensor methods
that WebSensorProvider will not.

Bug: 1278377
Change-Id: I96ea78f66cd6219cb46a49b90791dd17fde2d085
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4916233
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Reviewed-by: Reilly Grant <reillyg@chromium.org>
Reviewed-by: Alex Moshchuk <alexmos@chromium.org>
Reviewed-by: Emily Stark <estark@chromium.org>
Commit-Queue: Raphael Kubo Da Costa <raphael.kubo.da.costa@intel.com>
Reviewed-by: Ben Pastene <bpastene@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1206683}
2023-10-06 22:41:53 +00:00
Raphael Kubo da Costa
853b2990b3 sensors: Rework cardinality of SensorProviderProxyImpl, rename classes
This is done in preparation for the upcoming virtual sensor patches that
implement the Automation section of the Generic Sensor spec, as a
virtual sensor created in an iframe should be visible and used by other
frames in the same page. Virtual sensor settings should also persist
across navigations in the same tab (so that WebDriver users can do the
setup before loading the page under test, for example).

SensorProviderProxyImpl has been split into two classes:
- WebContentsSensorProviderProxy is a per-WebContents object (i.e. there
  is only one regardless of the number of frames in the same tab, and it
  persists across navigations in the same tab). It contains the
  mojo::Remote that communicates with //services and calls GetSensor()
  in SensorProviderImpl.
- FrameSensorProviderProxy is a per-RenderFrameHost object that contains
  the mojo::ReceiverSet that Blink reaches when calling GetSensor(). It
  performs all permission checks and then reaches into
  WebContentsSensorProviderProxy to forward the call to //services.

This means that all calls to e.g. GetSensor() from Blink coming from the
same page (regardless of the frame) are routed to //services via the
same object (and therefore same mojo::ReceiverId from a //services
perspective), which also results in fewer Mojo connections between
content and services. The existing permission and permission policy
checks remain though, so this change has no user-visible effects.

WebContentsSensorProviderProxy still needs to be aware of
FrameSensorProviderProxy because it needs to notify one or more
instances that its mojo::ReceiverSet needs to be cleared due to a Mojo
connection error on the //services side.

Bug: 1278377
Change-Id: I2d38f406c52b7d3f73b9d6f0db60638367fefb79
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4770862
Reviewed-by: Fergal Daly <fergal@chromium.org>
Commit-Queue: Raphael Kubo Da Costa <raphael.kubo.da.costa@intel.com>
Reviewed-by: Nasko Oskov <nasko@chromium.org>
Reviewed-by: Reilly Grant <reillyg@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1206601}
2023-10-06 20:28:34 +00:00
Andy Paicu
0a6d4b5069 [PEPC] Add new structs to contain permission request data
This CL adds new struct PermissionRequestDescription and
PermissionRequestData that groups all information we will need to make
a permission request to permission infrastructure.
This is one in a series of CLs implementing the design:
https://docs.google.com/document/d/1a1gjlJ4VkAWoG8AeGKZDcQXm_c0q-cFTs_5MxmjWVYI/edit, next step is to parse the fields within the structs handle permission request from <permission> element properly.

Bug: 1271543,1462930
Change-Id: I4a7b64149bc3323075f802f832766aa2211455fc
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4756727
Commit-Queue: Andy Paicu <andypaicu@chromium.org>
Reviewed-by: Peter Beverloo <peter@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Reviewed-by: Kamila Hasanbega <hkamila@chromium.org>
Reviewed-by: Yuchen Liu <yucliu@chromium.org>
Reviewed-by: Sergey Ulanov <sergeyu@chromium.org>
Reviewed-by: Florent Castelli <orphis@chromium.org>
Reviewed-by: Eric Seckler <eseckler@chromium.org>
Reviewed-by: Arthur Sonzogni <arthursonzogni@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1189522}
2023-08-29 15:13:09 +00:00
Raphael Kubo da Costa
ad322d1412 sensors: Move binding code to BindToDeviceServiceIfNeeded()
Bug: 1278377
Change-Id: Idd0a6eb439c0e09879c725742867db053c9b9e82
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4770861
Reviewed-by: Reilly Grant <reillyg@chromium.org>
Commit-Queue: Raphael Kubo Da Costa <raphael.kubo.da.costa@intel.com>
Cr-Commit-Position: refs/heads/main@{#1189423}
2023-08-29 09:49:21 +00:00
Raphael Kubo da Costa
3e27aaea0b sensors: Remove DCHECK in SensorProviderProxyImpl's constructor.
DocumentUserData's constructor already CHECK()s the RenderFrameHost*
passed to it, so there is no need to DCHECK() it in
SensorProviderProxyImpl as well.

Change-Id: I3aae63b0795bd19e7afaafed227fa5ba6258486f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4290970
Commit-Queue: Raphael Kubo Da Costa <raphael.kubo.da.costa@intel.com>
Reviewed-by: Reilly Grant <reillyg@chromium.org>
Auto-Submit: Raphael Kubo Da Costa <raphael.kubo.da.costa@intel.com>
Cr-Commit-Position: refs/heads/main@{#1109681}
2023-02-24 18:39:05 +00:00
Avi Drissman
adac219925 Update header includes for /base/functional in /content
bind.h, callback.h, callback_forward.h, and callback_helpers.h
moved into /base/functional/. Update the include paths to
directly include them in their new location.

Bug: 1364441
Change-Id: I32ec425b9c0e52ec4b50047bf3290fecc5c905ff
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4148554
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Auto-Submit: Avi Drissman <avi@chromium.org>
Owners-Override: Avi Drissman <avi@chromium.org>
Owners-Override: Daniel Cheng <dcheng@chromium.org>
Commit-Queue: Daniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1091567}
2023-01-11 23:46:39 +00:00
Avi Drissman
4e1b7bc33d Update copyright headers in content/
The methodology used to generate this CL is documented in
https://crbug.com/1098010#c34.

No-Try: true
No-Presubmit: true
Bug: 1098010
Change-Id: I8c0f009d16350271f07d8e5e561085822cc9dd27
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3895935
Owners-Override: Avi Drissman <avi@chromium.org>
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Mark Mentovai <mark@chromium.org>
Auto-Submit: Avi Drissman <avi@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1047456}
2022-09-15 14:03:50 +00:00
Peter Kasting
d568594ee8 Change calls to std::{all,any,none}_of() to base:: functions: content/
This generally allows for slightly shorter, simpler calls, and in some
cases more clearly expresses the intent of the underlying code.

Bug: none
Change-Id: Iee8c9729a70780f28acf868f1eb8dcf2d1bb6416
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3865590
Commit-Queue: Peter Kasting <pkasting@chromium.org>
Reviewed-by: Charlie Reis <creis@chromium.org>
Reviewed-by: Łukasz Anforowicz <lukasza@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1042666}
2022-09-02 17:52:17 +00:00
Raphael Kubo da Costa
6728490876 Make SensorProviderProxyImpl inherit from DocumentUserData.
This allows us to remove |sensor_provider_proxy_| from
RenderFrameHostImpl, as SensorProviderProxyImpl is now self-managed as a
DocumentUserData instance.

Change-Id: I6493a4e30c865e97d598c15cd3a7e376aac8fa42
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3745466
Reviewed-by: Alexander Timin <altimin@chromium.org>
Commit-Queue: Raphael Kubo Da Costa <raphael.kubo.da.costa@intel.com>
Cr-Commit-Position: refs/heads/main@{#1020991}
2022-07-05 21:40:29 +00:00
Dave Tapuska
327c06c9c7 Rename GetMainFrame to GetPrimaryMainFrame
Progressively rename some usages of GetMainFrame to GetPrimaryMainFrame.

This is an automated change via git grep & sed.

BUG=1250404

Change-Id: I5e8fda4f11104cf9fcde8a690a33dc6ab7c34f3f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3696741
Reviewed-by: Nasko Oskov <nasko@chromium.org>
Commit-Queue: Dave Tapuska <dtapuska@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1013636}
2022-06-13 20:31:51 +00:00
Illia Klimov
27239edc5a The permissions API code cleanup.
PermissionManager contains duplicated methods that differentiate by permissions type enum (ContentSettingsType vs PermissionType). This CL removed most of the ContentSettingsType-related methods, because they had limited usage, mostly in tests.

Methods removed from PermissionManager:
* RequestPermission(ContentSettingsType)
* RequestPermissions(ContentSettingsType)
* RequestPermissionFromCurrentDocument
(ContentSettingsType)
* PermissionManager::RequestPermissionsFromCurrentDocument
(ContentSettingsType)
* GetPermissionStatusForFrame(ContentSettingsType)
* GetPermissionStatusForWorker(ContentSettingsType)
* GetPermissionStatusForFrame(PermissionType)

Methods removed from PermissionControllerDelegate:
* GetPermissionStatusForFrame(PermissionType)

Methods added to PermissionControllerDelegate:
* RequestPermissionsFromCurrentDocument(PermissionType)

Methods added to PermissionManager:
* RequestPermissionsFromCurrentDocument(PermissionType)

Bug: 1271543
Change-Id: I7c718e3a1a390cd5be6f143ad8f7a07477473e3a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3599030
Reviewed-by: Sergey Ulanov <sergeyu@chromium.org>
Commit-Queue: Peter Kvitek <kvitekp@chromium.org>
Reviewed-by: Ravjit Uppal <ravjit@chromium.org>
Reviewed-by: Sean Topping <seantopping@chromium.org>
Reviewed-by: Arthur Sonzogni <arthursonzogni@chromium.org>
Commit-Queue: Illia Klimov <elklm@google.com>
Reviewed-by: Michael Bai <michaelbai@chromium.org>
Reviewed-by: Florent Castelli <orphis@chromium.org>
Reviewed-by: Peter Kvitek <kvitekp@chromium.org>
Quick-Run: Peter Kvitek <kvitekp@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1002151}
2022-05-11 17:14:59 +00:00
Andy Paicu
a6d6d85580 Remove content::PermissionType references and replace them with...
...blink::PermissionType

This is a follow-up of https://chromium-review.googlesource.com/c/chromium/src/+/3359620
which moved PermissionType to blink but left a `using` statement to
avoid modifying a large amount of files in an already complicated
enough CL.

This CL removes that statement and modifies all references to use the
blink type.

Bug: 1122423
Change-Id: Ia2e992d1cb1456bbba72c4d9ee38b74fca8cab1e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3593199
Commit-Queue: Andy Paicu <andypaicu@chromium.org>
Reviewed-by: Clark DuVall <cduvall@chromium.org>
Reviewed-by: Scott Violet <sky@chromium.org>
Reviewed-by: Illia Klimov <elklm@chromium.org>
Reviewed-by: Reilly Grant <reillyg@chromium.org>
Reviewed-by: Eugene Zemtsov <eugene@chromium.org>
Reviewed-by: Joshua Bell <jsbell@chromium.org>
Reviewed-by: Eric Seckler <eseckler@chromium.org>
Reviewed-by: Peter Beverloo <peter@chromium.org>
Reviewed-by: Ted Choc <tedchoc@chromium.org>
Reviewed-by: Sean Topping <seantopping@chromium.org>
Reviewed-by: Daseul Lee <dslee@chromium.org>
Reviewed-by: Kevin Marshall <kmarshall@chromium.org>
Reviewed-by: Andrey Kosyakov <caseq@chromium.org>
Reviewed-by: Alexander Timin <altimin@chromium.org>
Cr-Commit-Position: refs/heads/main@{#997288}
2022-04-28 18:08:36 +00:00
Wei4 Wang
8f9888e10a [GenericSensor] Remove useless namespace prefix.
Change-Id: I05647ff32952c49c5f19d8864bdcce8eb16dee7d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3534683
Reviewed-by: Reilly Grant <reillyg@chromium.org>
Commit-Queue: Wei4 Wang <wei4.wang@intel.com>
Cr-Commit-Position: refs/heads/main@{#984148}
2022-03-23 02:09:15 +00:00
Illia Klimov
a181b7dda5 Add new API into PermissionController.
This CL adds the following APIs:
1. `RequestPermission()`
2. `RequestPermissionFromCurrentDocument()`

More details here:
go/permission-controller
go/permission-manager-hardening

Bug: 1271543
Change-Id: I80f1ae00aa1ef0afabd00999a89bd58397a5d678
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3498341
Reviewed-by: Andy Paicu <andypaicu@chromium.org>
Reviewed-by: Arthur Sonzogni <arthursonzogni@chromium.org>
Reviewed-by: Victor Costan <pwnall@chromium.org>
Commit-Queue: Illia Klimov <elklm@google.com>
Cr-Commit-Position: refs/heads/main@{#981014}
2022-03-15 08:17:47 +00:00
Keishi Hattori
0e45c020c4 Rewrite most Foo* field_ pointer fields to raw_ptr<Foo> field_.
DO NOT REVERT (unless absolutely necessary)! Report build breaks to keishi@(APAC)/glazunov@(EMEA)/sebmarchand@(NA) as soon as you see them. Fixes are expected to be trivial.

This commit was generated automatically, by running the following script: tools/clang/rewrite_raw_ptr_fields/rewrite-multiple-platforms.sh on commit fe74bc434e

For more information, see MiraclePtr One Pager [1], the PSA at chromium-dev@ [2], and the raw_ptr documentation in //base/memory/raw_ptr.md.

FYI This CL does not enable MiraclePtr protection and we expect no behavior change from this.

[1] https://docs.google.com/document/d/1pnnOAIz_DMWDI4oIOFoMAqLnf_MZ2GsrJNb_dbQ3ZBg/edit?usp=sharing
[2] https://groups.google.com/a/chromium.org/g/chromium-dev/c/vAEeVifyf78/m/SkBUc6PhBAAJ

Binary-Size: Increase of around 500kb was approved for MiraclePtr
Include-Ci-Only-Tests: true
No-Tree-Checks: true
No-Presubmit: true
Bug: 1272324, 1073933
Change-Id: I05c86a83bbb4b3f4b017f361dd7f4e7437697f69
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3305132
Commit-Queue: Keishi Hattori <keishi@chromium.org>
Reviewed-by: Bartek Nowierski <bartekn@chromium.org>
Owners-Override: Bartek Nowierski <bartekn@chromium.org>
Cr-Commit-Position: refs/heads/main@{#945735}
2021-11-27 09:25:52 +00:00
Peter Boström
1d6a095400 Remove unused "base/macros.h" in content/
Removes `#include "base/macros.h"` from files in content/ that do not
contain `ignore_result(`.

Bug: 1010217
No-Try: true
Change-Id: I887403408704241047e3bd66e953ff7df195368b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3274993
Commit-Queue: 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@{#940781}
2021-11-11 16:07:03 +00:00
Yuzu Saijo
08d13d4860 [bfcache] Rename SchedulerTrackedFeature to BFCacheDisablingFeature
This CL renames BackForwardCacheDisabling Feature related functions on
the browser side so that the names are clear. Now sticky blocking
features need to call OnBackForwardCacheDisablingStickyFeature().

Bug: 1257067,1254588
Change-Id: Ibd240491eaa29182cb8f944dc3583431861a1c57
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3225745
Reviewed-by: Alexander Timin <altimin@chromium.org>
Reviewed-by: Rakina Zata Amni <rakina@chromium.org>
Commit-Queue: Yuzu Saijo <yuzus@chromium.org>
Cr-Commit-Position: refs/heads/main@{#933334}
2021-10-20 05:25:13 +00:00
Mike West
800532c0bf Deprecate returning a GURL from GURL::GetOrigin().
This patch renames `GURL::GetOrigin()` to
`GURL::DeprecatedGetOriginAsURL()`. A subsequent patch will
reintroduce a `GURL::GetOrigin()` that returns a `url::Origin`
rather than a `GURL`.

This patch was brought to you by sed, followed by a little manual
work to deal with look-alike methods (most notably
`CascadePriority::GetOrigin()` and `NudgeTracker::GetOrigin()`) and
two or three spots that held pointers to GURLs:

```
git grep -n -l ".GetOrigin(" | \
  xargs -L1 sed -i '' \
    -e 's/\.GetOrigin(/.DeprecatedGetOriginAsURL(/g'
```

Bug: 512374
Change-Id: I03fb290650b8759d9849af0911cad9bdc92a5132
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3220292
Commit-Queue: Mike West <mkwst@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Owners-Override: Daniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/main@{#931431}
2021-10-14 09:26:52 +00:00
Nodir Turakulov
de11715e63 [dirmd] Use metadata mixins
Use the new "mixins" feature in dirmd.
Derive mixins from file:// links in OWNERS files.

This CL is machine-generated, in two parts.

Part 1: use mixins.

1. Save current metadata to JSON files, in ORIGINAL and REDUCED forms.
   dirmd read -form original > ~/tmp/dirmd/original.json
   dirmd read -form reduced  > ~/tmp/dirmd/reduced.json
2. Run mixins.py.
   Source code: https://gist.github.com/nodirg/b59d3df338a72a8944f957c5b3a15e22

The script finds related directories, connected by file:// links
in OWNERS files. For those directories that have the same base
name, e.g.
  components/autofill
  chrome/android/java/src/org/chromium/chrome/browser/autofill
if importing the "parent" to the "child" reduces metadata, or adds
missing metadata, extract the common metadata to COMMON_METADATA
and import it in both directories.

Part2: deduplicate metadata.
Apply same instructions as in
https://chromium-review.googlesource.com/c/chromium/src/+/2795985/16

Bug: 1179786
Change-Id: I2e6378004ce433e02f1c9360b09eb72354083bf6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2897943
Reviewed-by: John Abd-El-Malek <jam@chromium.org>
Reviewed-by: Fred Mello <fredmello@chromium.org>
Owners-Override: John Abd-El-Malek <jam@chromium.org>
Commit-Queue: Nodir Turakulov <nodir@chromium.org>
Cr-Commit-Position: refs/heads/main@{#925648}
2021-09-28 06:50:47 +00:00
Juha Vainio
8ad10e2509 [SensorProviderProxyImpl] Fixing the crash of callback destroyed before its execution
Changing the order of fields in class definition to prevent situation
where callback was destroyed before its execution.

Also added unittest to test this situation.

Bug: 1240814
Change-Id: I33fdd1c8a2fb93aa6ebf23c2eba4aa78bd5ab49f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3173359
Reviewed-by: Raphael Kubo da Costa <raphael.kubo.da.costa@intel.com>
Reviewed-by: Reilly Grant <reillyg@chromium.org>
Commit-Queue: Raphael Kubo da Costa <raphael.kubo.da.costa@intel.com>
Cr-Commit-Position: refs/heads/main@{#924712}
2021-09-24 10:30:23 +00:00
Peter Boström
828b902994 Replace DISALLOW_COPY_AND_ASSIGN in content/
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}
2021-09-21 02:28:43 +00:00
Arthur Sonzogni
b146f06e6c Stop using --ignore-certificate-errors in test [2/N]
'--ignore-certificate-errors' is bad, because its behavior is not
plumbed correctly everywhere. As a result, its behavior is different
from using a real SSL certificate.

For tests that need to use multiple distinct sites (and not
just different origins), using either MockCertVerifier or
the net::EmbeddedTestServer::CERT_TEST_NAMES can allow multiple
distinct sites to talk to the test server.

Currently folks, are copy-pasting existing tests with
"ignore-certificate-errors". It would be lovely to update existing test
so that folks can start copy-pasting the "good" way instead.

This patch updates:
generic_sensor_browsertest.cc

Bug: 1236525, 1124775
Change-Id: I2a159474808b523c1a6796383b20d9bc703e84f7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3074599
Auto-Submit: Arthur Sonzogni <arthursonzogni@chromium.org>
Reviewed-by: Ryan Sleevi <rsleevi@chromium.org>
Commit-Queue: Arthur Sonzogni <arthursonzogni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#909285}
2021-08-06 13:56:03 +00:00
Peter Boström
dd7e40ec31 Apply modernize-make-unique to content/
This is a large-scale change: go/chromium-modernize-make-unique

Bug: 1194272
Change-Id: Id035e6a5058ab109a4333f1b8f8225da1c6989e4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2803034
Commit-Queue: 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/master@{#869261}
2021-04-05 20:40:10 +00:00
Charlie Hu
1b9da2c5b4 [Permissions Policy] Rename FeaturePolicyFeature terms
This CL does a global replace on
mojom::FeaturePolicyFeature => mojom::PermissionsPolicyFeature
blink::FeaturePolicyFeatureState => blink::PermissionsPolicyFeatureState

Note: histogram enum FeaturePolicyFeature is untouched.

Bug: 1123116
Change-Id: Ib3373f24363558ae07d240663815a421f143bd85
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2705646
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Ian Clelland <iclelland@chromium.org>
Owners-Override: Daniel Cheng <dcheng@chromium.org>
Commit-Queue: Charlie Hu <chenleihu@google.com>
Cr-Commit-Position: refs/heads/master@{#859858}
2021-03-04 18:51:30 +00:00
Charlie Hu
e010cf2a55 [Permissions Policy] Rename 'feature_policy' in file names
This CL renames 'feature_policy' in file names to 'permissions_policy'
with 2 exceptions:

- dom_feature_policy
- feature_policy_violation_report_body

Both files are closely related to V8 bindings. Changing the file name
would require change to class name defined in the file.

Bug: 1123116
Change-Id: I17968f745fa983df30dcf94fe37c6b4b91616f1e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2704785
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Ian Clelland <iclelland@chromium.org>
Owners-Override: Daniel Cheng <dcheng@chromium.org>
Commit-Queue: Charlie Hu <chenleihu@google.com>
Cr-Commit-Position: refs/heads/master@{#859569}
2021-03-03 23:09:51 +00:00
Daniel Cheng
28a5ac480d Use std::move() with base::Passed() for base::BindOnce(), part 1.
std::move() and base::Passed() mean the same thing for base::BindOnce,
so use the standard library idiom instead.

Bug: 1180750
Change-Id: I10737d95c52b69c2bf594058ff46047d16d80858
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2711965
Reviewed-by: Colin Blundell <blundell@chromium.org>
Reviewed-by: Nico Weber <thakis@chromium.org>
Reviewed-by: Joe Downing <joedow@chromium.org>
Reviewed-by: Bill Budge <bbudge@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Reviewed-by: Reilly Grant <reillyg@chromium.org>
Reviewed-by: Thomas Guilbert <tguilbert@chromium.org>
Reviewed-by: Sean Topping <seantopping@chromium.org>
Commit-Queue: Daniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/master@{#856429}
2021-02-22 21:03:08 +00:00
Arnaud Mandy
5e4d15e15d [sensors] Gravity sensor bindings and platform support
This CL implements blink bindings for Gravity sensor [1] and
adds Android, Win, Linux, CrOs platform support to get Gravity values.

Gravity Sensor can either be a physical sensor, in some phones for
example. In this case, the value is read directly from the sensor.
Otherwise if gravity sensor is not found, gravity value can be extracted
from the accelerometer.

The gravity fusion sensor implementation is similar to the linear
acceleration fusion sensor, since gravity extraction is a step in the
linear acceleration calculation.

[1] ED specification for Gravity Sensor:
https://w3c.github.io/accelerometer/#gravitysensor

https://chromestatus.com/feature/5384099747332096

Bug: 1163993
Change-Id: I756f2450176c2e3d96a9934bdadac133d57186e9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2636160
Reviewed-by: Raphael Kubo da Costa <raphael.kubo.da.costa@intel.com>
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Reviewed-by: Reilly Grant <reillyg@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Commit-Queue: Arnaud Mandy <arnaud.mandy@intel.com>
Cr-Commit-Position: refs/heads/master@{#849487}
2021-02-02 07:22:42 +00:00
Josip Sokcevic
32c10f4d66 [2/N] Add DIR_METADATA files to directories under //content
Generate DIR_METADATA files and remove metadata from OWNERS
files for directories under //content.

R=boliu@chromium.org

Bug: 1113033
Change-Id: I409968b2318bd07214affd931c3db1b07431403a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2544853
Commit-Queue: Josip Sokcevic <sokcevic@google.com>
Reviewed-by: Bo <boliu@chromium.org>
Auto-Submit: Josip Sokcevic <sokcevic@google.com>
Cr-Commit-Position: refs/heads/master@{#828511}
2020-11-18 00:56:22 +00:00
danakj
db9ae7941a Rename includes from bind_helpers.h to callback_helpers.h
R=dcheng@chromium.org
NOPRESUBMIT=true
TBR=
NOTRY=true

Change-Id: I93bc6a9360997fae7adeab8c01f56e08fc025dd2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2523543
Commit-Queue: danakj <danakj@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: danakj <danakj@chromium.org>
Cr-Commit-Position: refs/heads/master@{#826289}
2020-11-11 16:01:35 +00:00
danakj
30f5b7dd00 Point includes to content/browser/renderer_host instead of frame_host/ (6/x)
The code has moved, so update the includes.

R=avi@chromium.org

Bug: 1091083
Change-Id: I2c9a5c20b78756fc0b460a85f00d8560f1883979
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2412947
Commit-Queue: Avi Drissman <avi@chromium.org>
Auto-Submit: danakj <danakj@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#807483}
2020-09-16 15:38:45 +00:00
Raphael Kubo da Costa
6e404b1ff9 Add a README.md to content/browser/generic_sensor.
Change-Id: I578967a8b3d2690597e740eccd440c43b33f6619
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2270441
Auto-Submit: Raphael Kubo da Costa <raphael.kubo.da.costa@intel.com>
Commit-Queue: Reilly Grant <reillyg@chromium.org>
Reviewed-by: Reilly Grant <reillyg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#783207}
2020-06-26 21:57:47 +00:00
Raphael Kubo da Costa
9d5b826d4a sensors: Remove outdated comment in SensorProviderProxyImpl.
The code the comment is referring to was changed to use base::BindOnce() in
commit 8c74db02c8 ("[base] Apply BindOnceRewriter in //content").

TBR=reillyg

Change-Id: I37a15e5d8b36c2839a46bfb7c250005faf73f7c8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2192735
Reviewed-by: Raphael Kubo da Costa <raphael.kubo.da.costa@intel.com>
Commit-Queue: Raphael Kubo da Costa <raphael.kubo.da.costa@intel.com>
Cr-Commit-Position: refs/heads/master@{#767239}
2020-05-11 09:59:30 +00:00
Peter Kasting
919ce657e4 Add missing #includes of browser_test.h.
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}
2020-05-07 10:22:36 +00:00
Balazs Engedy
683d2c7a8f Revert "IWYU for browser_test.h."
This reverts commit 66a53c909a.

Reason for revert: Breaks compile on official branded builders.

Original change's description:
> IWYU for browser_test.h.
> 
> 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}

TBR=sky@chromium.org,pkasting@chromium.org,thestig@chromium.org

Change-Id: I4583916602404c310a93f571dd2c78645c6bd567
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: none
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2184132
Reviewed-by: Balazs Engedy <engedy@chromium.org>
Commit-Queue: Balazs Engedy <engedy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#765931}
2020-05-06 10:36:40 +00:00
Peter Kasting
66a53c909a IWYU for browser_test.h.
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}
2020-05-06 09:38:56 +00:00
Jan Wilken Dörrie
8c74db02c8 [base] Apply BindOnceRewriter in //content
This change applies the BindOnceRewriter in //content.
This rewriter replaces calls to base::Bind and base::BindRepeating with
calls to base::BindOnce, in case the result is immediately assigned to a
base::OnceCallback. Given that base::RepeatingCallback is implicitly
convertible to base::OnceCallback, there is no change in functionality.

Steps:
  1. run_tool.py --tool base_bind_rewriters \
                 --tool-arg='--rewriter=bind_to_bind_once'
  2. git cl format

This CL was uploaded by git cl split.

R=boliu@chromium.org, raymes@chromium.org, tguilbert@chromium.org

Bug: 714018
Change-Id: Icff62462cb0aa894ab23cce94862928d429ed572
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2132410
Commit-Queue: Jan Wilken Dörrie <jdoerrie@chromium.org>
Reviewed-by: Bo <boliu@chromium.org>
Reviewed-by: Thomas Guilbert <tguilbert@chromium.org>
Reviewed-by: Raymes Khoury <raymes@chromium.org>
Cr-Commit-Position: refs/heads/master@{#760417}
2020-04-20 09:05:00 +00:00