0
Commit Graph

149 Commits

Author SHA1 Message Date
Charlie Harrison
6f86891877 [conversions] Wire up data deletion to StoragePartition
This CL:
- Adds conversion measurement removal masks to BrowsingDataRemover and
  StoragePartition.
- Wires up the mask to DATA_TYPE_SITE_DATA to conversion data is deleted
  when deleting site data
- Adds an interface in StoragePartitionImpl to generate a Origin matcher
  that abstracts some of the complexities in the code and unifies the
  storage_origin, special storage policy, and origin matcher function.

Bug: 1045165
Change-Id: Ieaa55f39aae67aa2e7e0b42fa4ed049f19912604
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2155817
Reviewed-by: Marijn Kruisselbrink <mek@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Reviewed-by: Christian Dullweber <dullweber@chromium.org>
Reviewed-by: John Delaney <johnidel@chromium.org>
Commit-Queue: Charlie Harrison <csharrison@chromium.org>
Cr-Commit-Position: refs/heads/master@{#763108}
2020-04-28 00:10:51 +00:00
Lily Chen
96f29a136f Pass source URL when setting a cookie
Instead of only passing the scheme of the cookie's source, this now
passes the whole URL.

Most of the call sites already have the URL (e.g. they used it to create
the cookie object in the first place). These callers were previously
passing url.scheme() and were converted to just pass the url.

Some callers did not have the source URL. These were converted to use
a fake URL cobbled together from the original scheme, the cookie's
domain attribute, and the cookie's path attribute. Most of these call
sites were in tests, but a handful were in production code.

As of now, the use of a simulated source URL doesn't matter (since the
CookieStore implementation only uses its scheme anyway).

Bug: 1069642
Change-Id: If239280a3d43b7c0e2ff9af9daa9989350957b3d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2145152
Commit-Queue: Lily Chen <chlily@chromium.org>
Reviewed-by: Achuith Bhandarkar <achuith@chromium.org>
Reviewed-by: Mikel Astiz <mastiz@chromium.org>
Reviewed-by: Boris Sazonov <bsazonov@chromium.org>
Reviewed-by: Wez <wez@chromium.org>
Reviewed-by: Richard Coles <torne@chromium.org>
Reviewed-by: Maksim Orlovich <morlovich@chromium.org>
Reviewed-by: John Abd-El-Malek <jam@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Becca Hughes <beccahughes@chromium.org>
Reviewed-by: Kyle Horimoto <khorimoto@chromium.org>
Reviewed-by: Eugene But <eugenebut@chromium.org>
Reviewed-by: Joshua Bell <jsbell@chromium.org>
Reviewed-by: Tarun Bansal <tbansal@chromium.org>
Reviewed-by: Wei Li <weili@chromium.org>
Reviewed-by: Karan Bhatia <karandeepb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#759324}
2020-04-15 17:59:36 +00:00
Zhuoyu Qian
dda3e60868 Change FileSystemQuotaUtil functions to use url::Origin.
This CL update the functions GetOriginsForTypeOnFileTaskRunner and
GetOriginsForHostOnFileTaskRunner of FileSystemQuotaUtil to use
dedicated Origin type instead of GURL.
Change PluginPrivateDataDeletionHelper::CheckOriginsOnFileTaskRunner
also.

Bug: 598424
Change-Id: Ica53219f4f7acbf457195a7cb964b404bf7af98b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2074842
Reviewed-by: Victor Costan <pwnall@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Commit-Queue: Avi Drissman <avi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#746401}
2020-03-03 16:29:30 +00:00
Bill Budge
19be696ee0 [blink] Remove WasmCodeCache feature flag
- Remove WasmCodeCache feature flag, now that it has launched.

Bug: chromium:719172
Change-Id: Ic84d2efc3dd27e4abe5ade7225fc8292c568f107
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2068880
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Reviewed-by: Mark Pearson <mpearson@chromium.org>
Commit-Queue: Bill Budge <bbudge@chromium.org>
Cr-Commit-Position: refs/heads/master@{#744376}
2020-02-25 20:50:11 +00:00
Peter Kasting
8bdc8281a3 Fix scoping for GURLs/Origins in some test files.
This is a followup to
https://chromium-review.googlesource.com/c/chromium/src/+/1918828 that
updates the same files to use constants/methods scoped as narrowly as
possible, to make more clear which pieces of functionality are
interdependent.

Bug: 1042727
Change-Id: I74f54fcf92702c7b7db45b809d2ff74523de3a42
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2046535
Reviewed-by: Camille Lamy <clamy@chromium.org>
Reviewed-by: Rohit Rao <rohitrao@chromium.org>
Reviewed-by: Michael Thiessen <mthiesse@chromium.org>
Reviewed-by: Sean Topping <seantopping@chromium.org>
Reviewed-by: Ted Meyer <tmathmeyer@chromium.org>
Reviewed-by: Tim Volodine <timvolodine@chromium.org>
Commit-Queue: Peter Kasting <pkasting@chromium.org>
Cr-Commit-Position: refs/heads/master@{#741960}
2020-02-17 18:25:16 +00:00
Victor Costan
b410d1a4ad storage: Move testing code from namespace content to storage.
Testing code that was moved from //content to //storage is still under
the content namespace. This is hindering Storage Service-related
refactoring. This CL updates the namespace to reflect the directory
structure.

This CL also makes mechanical code health improvements (such as new ->
base::MakeRefCounted) applied when obvious. clang-tidy improvements are
applied where requested by Tricium.

Bug: 653751
Change-Id: I3d0b5712b531d0d33205ee2a3de3de5dce73e84d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2048986
Commit-Queue: Victor Costan <pwnall@chromium.org>
Reviewed-by: Scott Violet <sky@chromium.org>
Reviewed-by: Jarryd Goodman <jarrydg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#740558}
2020-02-12 05:03:22 +00:00
Md. Hasanur Rashid
ecfe103b8f Change FileSystemContext::OpenPluginPrivateFileSystem to use url::Origin
This CL update the function FileSystemContext::OpenPluginPrivateFileSystem
to use url::Origin instead of GURL.

Bug: 598424
Change-Id: I6d5b6326036d5e8c82eaa2e8863aa3cd664735d6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2040977
Reviewed-by: Joshua Bell <jsbell@chromium.org>
Reviewed-by: Jochen Eisinger <jochen@chromium.org>
Commit-Queue: Md. Hasanur Rashid <hasanur.r@samsung.com>
Cr-Commit-Position: refs/heads/master@{#739823}
2020-02-10 10:07:48 +00:00
Michael Thiessen
3067e4e57a Replace GURL static initializers with functions.
This is a necessary pre-cursor to cleaning up scheme initialization.
No GURLs should be created before schemes are modified/added and GURL
is ready to use. Enforcement of this will come in a followup CL.

See the bug for additional context.

Replacing static initalizers with functions ensures the GURLs are
only initialized when used, which happens after test setup.

Bug: 783819
Change-Id: Ifafe4a45b69eac0df10ac2125a328d24de130bd8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1918828
Commit-Queue: Michael Thiessen <mthiesse@chromium.org>
Reviewed-by: Scott Violet <sky@chromium.org>
Cr-Commit-Position: refs/heads/master@{#732950}
2020-01-17 19:13:24 +00:00
Gabriel Charette
b8c60e8497 [content test] Move TestBrowserThread as an impl detail!
No less than 6.5 years after TestBrowserThread was deprecated!

Moved as-is to browser_task_environment.cc % deletion on an unused constructor.

Only actual change in this CL is in
chrome/browser/android/digital_asset_links/digital_asset_links_handler_unittest.cc
to use BrowserTaskEnvironment instead (doesn't alter any logic, just
semantics).

// For minor tweaks to chrome/browser/android/digital_asset_links/digital_asset_links_handler_unittest.cc
TBR=lizeb@chromium.org
// To bypass owners on mechanical removal of unused headers.
TBR=avi@chromium.org

Bug: 272091
Change-Id: I174c23ae436c330b32f14bd12ff5f9dc4e23bab2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1978162
Commit-Queue: Gabriel Charette <gab@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Auto-Submit: Gabriel Charette <gab@chromium.org>
Cr-Commit-Position: refs/heads/master@{#726871}
2019-12-20 18:50:15 +00:00
Ken Rockot
66f4e99664 Move Local Storage into Storage Service
This is a mechanical move of content::LocalStorageContextMojo over to
storage::LocalStorageImpl within the Storage Service. No behavioral
changes.

Bug: 1000959
Change-Id: Ic71f11d4bc143c0103171b254c7f0472fca6bc85
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1945941
Commit-Queue: Ken Rockot <rockot@google.com>
Reviewed-by: Daniel Murphy <dmurph@chromium.org>
Cr-Commit-Position: refs/heads/master@{#723121}
2019-12-09 22:11:36 +00:00
Ken Rockot
9e16f0312e Move Local Storage proto into Storage Service
Mechanical move of the Local Storage metadata proto into the Storage
Service. This is in preparation for moving the Local Storage
implementation itself into service.

Bug: 1000959
Change-Id: I21a0d75556bc96b451ad1e1fb692cca02102c16f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1944322
Commit-Queue: Ken Rockot <rockot@google.com>
Reviewed-by: Daniel Murphy <dmurph@chromium.org>
Cr-Commit-Position: refs/heads/master@{#721241}
2019-12-03 23:56:00 +00:00
danakj
b9a16f21ad Convert base::Bind to base::Bind{Once,Repeating} in content/browser/browsing_data.
Also from StoragePetition it uses which is defined in content/public/.

This changes BluetoothDevice::ConnectErrorCallback to be a OnceCallback, then
the Bind() call in content can become a BindOnce().

R=clamy@chromium.org

Bug: 1007763, 1007760
Change-Id: Iaf1928397c3c913df87e1297c1ad4ffe13f907a2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1944312
Auto-Submit: danakj <danakj@chromium.org>
Commit-Queue: Camille Lamy <clamy@chromium.org>
Reviewed-by: Camille Lamy <clamy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#720943}
2019-12-03 13:53:58 +00:00
Ken Rockot
a45ebf8477 Hide LocalStorageContextMojo
This insulates LocalStorageContextMojo behind a new
LocalStorageControl mojom interface defined by the Storage Service.

DOMStorageContextWrapper no longer has direct access to the
LocalStorageContextMojo instances, instead interacting with them only
through the mojom interface.

This simplifies DOMStorageContextWrapper, but also helps prepare
LocalStorageContextMojo for migration into private Storage Service
code.

Bug: 1000959
Change-Id: I12c6ece0b1dd01c3e17e66e6249b2d01935675f6
Tbr: jam@chromium.org
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1902244
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Daniel Murphy <dmurph@chromium.org>
Reviewed-by: Victor Costan <pwnall@chromium.org>
Commit-Queue: Ken Rockot <rockot@google.com>
Cr-Commit-Position: refs/heads/master@{#717745}
2019-11-21 19:07:29 +00:00
Steven Bingler
38d9655379 Use MakeAllInclusive() in storage partition cookie unittests
Modify storage partition cookie helper functions to use
MakeAllInclusive() instead of the CookieOptions() in order to prevent
test breakage when cookies become SameSite-by-Default.

MakeAllInclusive() has a SameSite context of STRICT instead
of CookieOptions()'s CROSS_SITE.

Bug: 1016512
Change-Id: Id826eeaf0bea5c0bd60dc6380f57fd419d62388d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1879561
Reviewed-by: Alex Moshchuk <alexmos@chromium.org>
Commit-Queue: Steven Bingler <bingler@chromium.org>
Cr-Commit-Position: refs/heads/master@{#709227}
2019-10-24 21:41:43 +00:00
DongJun Kim
d6930eaba0 Rename storage/common/fileapi to file_system
In the past, "content/*/file_system" was renamed to "fileapi"
to contain both the code for the filesystem API and the blob system.

But the blob system moved out to separate directories,
we have the confusing situation that we have directories named
after one API that contain the implementation of a different API.

This patch rename "storage/common/fileapi" to "file_system"
to actually match for reducing confusion.

Bug: 921260
Change-Id: I5071d6e268aa6824c165678def35d4dfe88a6f89
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1871711
Commit-Queue: Maksim Ivanov <emaxx@chromium.org>
Reviewed-by: Maksim Ivanov <emaxx@chromium.org>
Reviewed-by: Mike West <mkwst@chromium.org>
Reviewed-by: Marijn Kruisselbrink <mek@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Reviewed-by: Devlin <rdevlin.cronin@chromium.org>
Reviewed-by: Ken Rockot <rockot@google.com>
Cr-Commit-Position: refs/heads/master@{#708948}
2019-10-24 08:49:25 +00:00
Ken Rockot
b1b9b4a144 Remove leveldb service helper library
This removes util.cc/h from the leveldb service's client library. This
is the last bit of remaining code from the service apart from
LevelDBDatabaseImpl itself, which will be simplified and moved into the
Storage Service as a wrapper around DomStorageDatabase.

The utility functions here are used almost exclusively in tests, and
are all trivial. In many cases their use can be eliminated by proving
the surrounding APIs (e.g. taking spans instead of vectors, or
introducing a more robust key/value type) or by inlining direct use of
base and STL APIs which essentially solve the same problems.

For now, their definitions have been duplicated in the few places they
are used.

Bug: 1000959
Change-Id: I568ac5d829b643d332783faddffa2bc63685e211
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1868847
Reviewed-by: Daniel Murphy <dmurph@chromium.org>
Commit-Queue: Ken Rockot <rockot@google.com>
Cr-Commit-Position: refs/heads/master@{#707926}
2019-10-21 19:56:55 +00:00
DongJun Kim
febb3c2ad5 Rename storage/browser/fileapi to file_system
In the past, "content/*/file_system" was renamed to "fileapi"
to contain both the code for the filesystem API and the blob system.

But the blob system moved out to separate directories,
we have the confusing situation that we have directories named
after one API that contain the implementation of a different API.

This patch rename "storage/browser/fileapi" to "file_system"
to actually match for reducing confusion.

Bug: 921260
Change-Id: I18a391b43c054e647d938832f2055580a083437a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1858542
Commit-Queue: DongJun Kim <djmix.kim@samsung.com>
Reviewed-by: Julian Pastarmov <pastarmovj@chromium.org>
Reviewed-by: Ken Rockot <rockot@google.com>
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Reviewed-by: Mike West <mkwst@chromium.org>
Reviewed-by: Marijn Kruisselbrink <mek@chromium.org>
Reviewed-by: Yusuke Sato <yusukes@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#707702}
2019-10-21 02:08:06 +00:00
Ken Rockot
0f84f4f96b Remove FakeLevelDBDatabase[ErrorOnWrite]
This gets rid of fake implementations of the LevelDBDatabase mojom
interface and refactors all dependent tests to use a real
in-memory LevelDBDatabaseImpl instead.

Local/SessionStorageContextMojo are updated to use a LevelDBDatabaseImpl
directly, and other DOM storage classes can by updated similarly in
follow-up CLs. This is a step in incrementally deleting the
LevelDBDatabase mojom interface and migrating DOM storage implementation
to consume a DomStorageDatabase directly.

Bug: 1000959
Change-Id: Ieaa8e46a6ebc0f41dc85b3c60423552c88cb0c6a
Tbr: sky@chromium.org
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1837145
Commit-Queue: Ken Rockot <rockot@google.com>
Reviewed-by: Marijn Kruisselbrink <mek@chromium.org>
Cr-Commit-Position: refs/heads/master@{#704376}
2019-10-09 22:35:11 +00:00
Ken Rockot
962f75b81e Move LevelDBDatabaseImpl off message pipes
This deletes LevelDBService and moves LevelDBDatabaseImpl off of Mojo
pipes. A generated mojom interface is still used for now, but calls go
directly into a LevelDBDatabaseImpl.

LevelDBDatabaseImpl is reimplemented in terms of DomStorageDatabase from
the Storage Service. This will allow the many call sites into this class
to be incrementally adapted to directly use the underlying
DomStorageDatabase. Once that migration is complete,
components/services/leveldb/ can be deleted.

Bug: 1000959
Change-Id: I8cd604b895b995de4723cd572e6cc6f67fa5d43e
Tbr: sky@chromium.org
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1827186
Commit-Queue: Ken Rockot <rockot@google.com>
Reviewed-by: Marijn Kruisselbrink <mek@chromium.org>
Reviewed-by: Robert Sesek <rsesek@chromium.org>
Cr-Commit-Position: refs/heads/master@{#701360}
2019-10-01 00:01:04 +00:00
Bill Budge
41e71f90bd [code cache] Refactor GeneratedCodeCache to split reads and writes
- Splits Write into two parts, response time and data. Uses stream 0
  for response time, stream 1 for data, to avoid a slowdown.
- Splits Read similarly.
- Eliminates the extra data copy when writing caused by passing a
  span from CodeCacheHostImpl rather than the Mojo BigBuffer received
  from the renderer.
- Changes the keyed PendingOperation queues to keep the active op at
  the head. This simplifies the helper method and callback signatures.
- PendingOperations now own the IOBuffers for Write and Fetch.
- Using stream 0 now will make deduplication of the code caches (not
  storing a copy of the code for each origin) easier in the future.

Behavior changes:
- IssuePendingOperations now runs PendingOperations through the queues
  rather than all at once. This was probably didn't happen in the real
  world but seems incorrect.
- Reads where one or more parts fail now doom the entry. We should
  help the cache eliminate inaccessible data.
- Response time is now stored in stream 0. This means any data in the
  cache from previous Chromes where response time was a prefix on
  stream 1 will cause a cache miss, since the time stamp read will fail.
  This CL then makes the data read fail, since returning data prefixed
  with a timestamp could be confusing now. Invalidating the caches
  shouldn't be a problem, since we expect a new version of Chrome/V8
  to cause the code caches to become invalid since their version/feature
  header won't match, see:
  https://cs.chromium.org/chromium/src/v8/src/snapshot/code-serializer.cc?rcl=6c89d2ffb531b3c79181532b5de04adaf7206049&l=387

Bug: chromium:992991
Change-Id: If3c5e8a83bca811fcb809a8a89c6d22942456f13
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1814685
Commit-Queue: Bill Budge <bbudge@chromium.org>
Reviewed-by: Maks Orlovich <morlovich@chromium.org>
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Reviewed-by: Mythri Alle <mythria@chromium.org>
Cr-Commit-Position: refs/heads/master@{#700307}
2019-09-26 17:21:55 +00:00
Ramin Halavati
9280a290a4 Remove RemovePluginPrivateDataWhileWriting unittest.
In the past, base::File object was passed to the CDM process and it
read/write using the handle. Now that all the reading/writing is done
in the browser process, it's no longer a concern that the handle can
exist after the underlying file was deleted.
The test is removed while removing usages of CreateOrOpen() function
that is on deprecation path.

Bug: 936722
Change-Id: Ic2ab6ffece24118e3f7384b440b77cecd12ddc5a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1768590
Auto-Submit: Ramin Halavati <rhalavati@chromium.org>
Reviewed-by: John Rummell <jrummell@chromium.org>
Reviewed-by: Marijn Kruisselbrink <mek@chromium.org>
Commit-Queue: Marijn Kruisselbrink <mek@chromium.org>
Cr-Commit-Position: refs/heads/master@{#692383}
2019-09-01 17:50:40 +00:00
Lily Chen
f53dfbcd34 CookieInclusionStatus: Support warnings and multiple exclusion reasons
Previously CookieInclusionStatus was just an enum with one value for
inclusion and a number of other values for exclusion due to different
reasons.

This changes CookieInclusionStatus to hold multiple exclusion reasons,
with inclusion represented as a lack of any exclusion reasons. This is
implemented as a bit vector with each exclusion reason represented as
a single bit.

This also adds warnings to CookieInclusionStatus, which indicate when
warnings should be emitted about a cookie (regardless of inclusion or
exclusion). This removes the need for the previous hack which indicated
warnings by making a duplicate of the cookie with a different
CookieInclusionStatus.

Bug: 993843
Change-Id: I8f4f76ea5c7225cd01342786b20f9e0b05f582c3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1756157
Commit-Queue: Lily Chen <chlily@chromium.org>
Reviewed-by: Sylvain Defresne <sdefresne@chromium.org>
Reviewed-by: Victor Costan <pwnall@chromium.org>
Reviewed-by: Boris Sazonov <bsazonov@chromium.org>
Reviewed-by: Toni Baržić <tbarzic@chromium.org>
Reviewed-by: Christian Dullweber <dullweber@chromium.org>
Reviewed-by: Kyle Horimoto <khorimoto@chromium.org>
Reviewed-by: Wez <wez@chromium.org>
Reviewed-by: Maks Orlovich <morlovich@chromium.org>
Reviewed-by: Karan Bhatia <karandeepb@chromium.org>
Reviewed-by: Balazs Engedy <engedy@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: John Abd-El-Malek <jam@chromium.org>
Reviewed-by: Andrey Kosyakov <caseq@chromium.org>
Cr-Commit-Position: refs/heads/master@{#691902}
2019-08-30 01:42:10 +00:00
Gabriel Charette
c710874894 Reland "[TaskEnvironment] Complete migration with header rename"
This is a reland of 18947083c7

The move_source_file.py script's formatting rules incorrectly
formatted services/device/generic_sensor/platform_sensor_and_provider_unittest_win.cc
after all. But we also can't rely 100% on git cl format (crbug.com/997063)
so I ended up performing a git cl format && git add -up
(+interactive addition of missing blank line after foo.h when included
from top of foo.cc)

Also added
$ tools/git/move_source_file.py net/test/test_with_scoped_task_environment.h net/test/test_with_task_environment.h

Original change's description:
> [TaskEnvironment] Complete migration with header rename
>
> This is merely:
>
> $ tools/git/move_source_file.py base/test/scoped_task_environment.h base/test/task_environment.h
> $ tools/git/move_source_file.py base/test/scoped_task_environment.cc base/test/task_environment.cc
> $ tools/git/move_source_file.py base/test/scoped_task_environment_unittest.cc base/test/task_environment_unittest.cc
> $ tools/git/move_source_file.py content/public/test/test_browser_thread_bundle.h content/public/test/browser_task_environment.h
> $ tools/git/move_source_file.py content/public/test/test_browser_thread_bundle.cc content/public/test/browser_task_environment.cc
> $ tools/git/move_source_file.py content/public/test/test_browser_thread_bundle_unittest.cc content/public/test/browser_task_environment_unittest.cc
> $ tools/git/move_source_file.py ios/web/public/test/test_web_thread_bundle.h ios/web/public/test/web_task_environment.h
> $ tools/git/move_source_file.py ios/web/test/test_web_thread_bundle.cc ios/web/test/web_task_environment.cc
>
> and a few manual renames in DEPS files missed by the script
>
> This CL uses --bypass-hooks to avoid having to git cl format because
> many headers are being reordered by git cl format and it's too many to
> figure out in a no-op CL which ones are okay with it.
> windows.h for one should typically be first and another one of the
> reorderings in PS3 even caused a compile failure:
> https://chromium-review.googlesource.com/c/chromium/src/+/1764962/3/components/services/font/font_loader_unittest.cc
>
> TBR=dcheng@chromium.org
>
> Bug: 992483
> Change-Id: I32a4afd43ef779393c95d9873c157be2d3da1dd1
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1764962
> Reviewed-by: Gabriel Charette <gab@chromium.org>
> Reviewed-by: Daniel Cheng <dcheng@chromium.org>
> Commit-Queue: Gabriel Charette <gab@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#689778}

TBR=dcheng@chromium.org

Bug: 992483
Change-Id: I6179dd1329a4d30bf5c65450ea893537f31e6f85
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1767658
Reviewed-by: Gabriel Charette <gab@chromium.org>
Commit-Queue: Gabriel Charette <gab@chromium.org>
Cr-Commit-Position: refs/heads/master@{#689794}
2019-08-23 03:31:40 +00:00
Gabriel Charette
b69fcd4f6e Revert "[TaskEnvironment] Complete migration with header rename"
This reverts commit 18947083c7.

Reason for revert: broke Win

Original change's description:
> [TaskEnvironment] Complete migration with header rename
> 
> This is merely:
> 
> $ tools/git/move_source_file.py base/test/scoped_task_environment.h base/test/task_environment.h
> $ tools/git/move_source_file.py base/test/scoped_task_environment.cc base/test/task_environment.cc
> $ tools/git/move_source_file.py base/test/scoped_task_environment_unittest.cc base/test/task_environment_unittest.cc
> $ tools/git/move_source_file.py content/public/test/test_browser_thread_bundle.h content/public/test/browser_task_environment.h
> $ tools/git/move_source_file.py content/public/test/test_browser_thread_bundle.cc content/public/test/browser_task_environment.cc
> $ tools/git/move_source_file.py content/public/test/test_browser_thread_bundle_unittest.cc content/public/test/browser_task_environment_unittest.cc
> $ tools/git/move_source_file.py ios/web/public/test/test_web_thread_bundle.h ios/web/public/test/web_task_environment.h
> $ tools/git/move_source_file.py ios/web/test/test_web_thread_bundle.cc ios/web/test/web_task_environment.cc
> 
> and a few manual renames in DEPS files missed by the script
> 
> This CL uses --bypass-hooks to avoid having to git cl format because
> many headers are being reordered by git cl format and it's too many to
> figure out in a no-op CL which ones are okay with it.
> windows.h for one should typically be first and another one of the
> reorderings in PS3 even caused a compile failure:
> https://chromium-review.googlesource.com/c/chromium/src/+/1764962/3/components/services/font/font_loader_unittest.cc
> 
> TBR=dcheng@chromium.org
> 
> Bug: 992483
> Change-Id: I32a4afd43ef779393c95d9873c157be2d3da1dd1
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1764962
> Reviewed-by: Gabriel Charette <gab@chromium.org>
> Reviewed-by: Daniel Cheng <dcheng@chromium.org>
> Commit-Queue: Gabriel Charette <gab@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#689778}

TBR=dcheng@chromium.org,gab@chromium.org

Change-Id: I9aa8ff558d1ff78cebe0c25e559c017578ad4f53
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 992483
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1767657
Reviewed-by: Gabriel Charette <gab@chromium.org>
Commit-Queue: Gabriel Charette <gab@chromium.org>
Cr-Commit-Position: refs/heads/master@{#689780}
2019-08-23 02:13:29 +00:00
Gabriel Charette
18947083c7 [TaskEnvironment] Complete migration with header rename
This is merely:

$ tools/git/move_source_file.py base/test/scoped_task_environment.h base/test/task_environment.h
$ tools/git/move_source_file.py base/test/scoped_task_environment.cc base/test/task_environment.cc
$ tools/git/move_source_file.py base/test/scoped_task_environment_unittest.cc base/test/task_environment_unittest.cc
$ tools/git/move_source_file.py content/public/test/test_browser_thread_bundle.h content/public/test/browser_task_environment.h
$ tools/git/move_source_file.py content/public/test/test_browser_thread_bundle.cc content/public/test/browser_task_environment.cc
$ tools/git/move_source_file.py content/public/test/test_browser_thread_bundle_unittest.cc content/public/test/browser_task_environment_unittest.cc
$ tools/git/move_source_file.py ios/web/public/test/test_web_thread_bundle.h ios/web/public/test/web_task_environment.h
$ tools/git/move_source_file.py ios/web/test/test_web_thread_bundle.cc ios/web/test/web_task_environment.cc

and a few manual renames in DEPS files missed by the script

This CL uses --bypass-hooks to avoid having to git cl format because
many headers are being reordered by git cl format and it's too many to
figure out in a no-op CL which ones are okay with it.
windows.h for one should typically be first and another one of the
reorderings in PS3 even caused a compile failure:
https://chromium-review.googlesource.com/c/chromium/src/+/1764962/3/components/services/font/font_loader_unittest.cc

TBR=dcheng@chromium.org

Bug: 992483
Change-Id: I32a4afd43ef779393c95d9873c157be2d3da1dd1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1764962
Reviewed-by: Gabriel Charette <gab@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Commit-Queue: Gabriel Charette <gab@chromium.org>
Cr-Commit-Position: refs/heads/master@{#689778}
2019-08-23 02:05:33 +00:00
Lily Chen
f068a76f18 CookieStore callback: Change signature to accommodate inclusion statuses
This changes the CookieStore's GetCookieListCallback from taking a
CookieList (for included cookies) and a CookieStatusList (for excluded
cookies), to taking a CookieStatusList for both. Previously, the
statuses of included cookies could be assumed to be INCLUDE, so they
did not need to be passed to the callback. The next change adds more
nuanced information to CookieInclusionStatus such that statuses must
be explicitly passed even for included cookies, hence a CookieStatusList
must be provided.

This also makes GetAllCookiesCallback take a CookieList only, since the
second CookieStatusList parameter (for excluded cookies, of which there
were none, since we are getting all cookies) was unused.

Bug: 993843
Change-Id: I4c6bedc0c161f863b9a1755bb93e615f2793202e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1758437
Commit-Queue: Lily Chen <chlily@chromium.org>
Reviewed-by: Achuith Bhandarkar <achuith@chromium.org>
Reviewed-by: Karan Bhatia <karandeepb@chromium.org>
Reviewed-by: Andrey Kosyakov <caseq@chromium.org>
Reviewed-by: John Abd-El-Malek <jam@chromium.org>
Reviewed-by: Kyle Horimoto <khorimoto@chromium.org>
Reviewed-by: Martin Šrámek <msramek@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Ryan Sturm <ryansturm@chromium.org>
Reviewed-by: Wez <wez@chromium.org>
Reviewed-by: Eugene But <eugenebut@chromium.org>
Reviewed-by: Marc Treib <treib@chromium.org>
Reviewed-by: Balazs Engedy <engedy@chromium.org>
Reviewed-by: Maks Orlovich <morlovich@chromium.org>
Reviewed-by: Richard Coles <torne@chromium.org>
Cr-Commit-Position: refs/heads/master@{#689162}
2019-08-21 21:10:50 +00:00
Bill Budge
011cb124b9 [code cache] Use Mojo BigBuffer for GeneratedCodeCache::ReadDataCallback
- Uses mojo_base::BigBuffer instead of std::vector to avoid unintentional
  copies of cache metadata. These copies can be slow.

Bug: chromium:992991
Change-Id: I2cd3a7716e7141f263927dac17b50aa990716119
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1759683
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Commit-Queue: Bill Budge <bbudge@chromium.org>
Cr-Commit-Position: refs/heads/master@{#688982}
2019-08-21 14:19:30 +00:00
Gabriel Charette
798fde7bc9 [Browser/WebTaskEnvironment] Mass-migrate away from Test(Browser|Web)ThreadBundle
This is
 1) s/TestBrowserThreadBundle/BrowserTaskEnvironment/ on src/
 2) s/([^/])\b\w*thread_bundle(_)?/\1task_environment\2/ on files modified in (1)
 3) git cl format
 4) Manually fix up remainder "ThreadBundle" and "thread_bundle" found via
    string search on the whole of src/.

For ease of review:
 * Step  is the diff between patch sets 1..2
 * Step  is the diff between patch sets 2..3

TBR=dcheng@chromium.org
(for post-review owners bypass per mechanical change)

Bug: 992483
Change-Id: I4945141f6d78bdc6c98444198e5012ddc8e5bff0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1758440
Reviewed-by: Gabriel Charette <gab@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Commit-Queue: Gabriel Charette <gab@chromium.org>
Auto-Submit: Gabriel Charette <gab@chromium.org>
Cr-Commit-Position: refs/heads/master@{#688755}
2019-08-20 22:24:04 +00:00
Mario Sanchez Prada
cd8379a161 Migrate references of blink::mojom::LevelDBDatabase to new Mojo types
Convert both the implementation and clients in the browser and renderer
processes for the blink.mojom.LevelDBDatabase interface, and adapt unit
tests.

Bug: 955171
Change-Id: I309afa09e166a75d6567f409fae46fc90a04b884
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1755905
Commit-Queue: Mario Sanchez Prada <mario@igalia.com>
Reviewed-by: Ken Rockot <rockot@google.com>
Reviewed-by: Marijn Kruisselbrink <mek@chromium.org>
Reviewed-by: Scott Violet <sky@chromium.org>
Reviewed-by: Daniel Murphy <dmurph@chromium.org>
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Cr-Commit-Position: refs/heads/master@{#688449}
2019-08-20 09:09:08 +00:00
Lily Chen
b851acc052 Split server_time out of net::CookieOptions
CookieOptions had an optional server_time field, which was used for
clock skew adjustments when creating a cookie, and nothing else.
Since CanonicalCookie::Create no longer depends on the other fields of
CookieOptions, this CL replaces its CookieOptions argument with a
base::Optional<base::Time> server_time argument. The server_time field
is removed from CookieOptions because nothing else needs it. This does
mean that CookieStore::SetCookieWithOptionsAsync needs an additional
server_time argument since CookieOptions no longer includes it. But
that method needs to be removed anyways.

Mostly but not entirely mechanical changes. This should not change any
behavior.

Bug: 989098
Change-Id: Ifd281db9c6412c8123d2f7ced954901ba33bf948
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1732689
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Rohit Rao <rohitrao@chromium.org>
Reviewed-by: Richard Coles <torne@chromium.org>
Reviewed-by: Toni Baržić <tbarzic@chromium.org>
Reviewed-by: Andrey Kosyakov <caseq@chromium.org>
Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
Reviewed-by: Maks Orlovich <morlovich@chromium.org>
Reviewed-by: Martin Šrámek <msramek@chromium.org>
Reviewed-by: Karan Bhatia <karandeepb@chromium.org>
Commit-Queue: Lily Chen <chlily@chromium.org>
Cr-Commit-Position: refs/heads/master@{#684780}
2019-08-07 15:54:44 +00:00
Sami Kyostila
8e4d5a915e content/browser: Always specify thread affinity when posting tasks
*** Note: There is no behavior change from this patch. ***

The PostTask APIs will shortly be changed to require all tasks to explicitly
specify their thread affinity, i.e., whether the task should run on the thread
pool or a specific named thread such as a BrowserThread. This patch updates all
call sites with thread affinity annotation. We also remove the "WithTraits"
suffix to make the call sites more readable.

Before:

    // Thread pool task.
    base::PostTaskWithTraits(FROM_HERE, {...}, ...);

    // UI thread task.
    base::PostTaskWithTraits(FROM_HERE, {BrowserThread::UI, ...}, ...);

After:

    // Thread pool task.
    base::PostTask(FROM_HERE, {base::ThreadPool(), ...}, ...);

    // UI thread task.
    base::PostTask(FROM_HERE, {BrowserThread::UI, ...}, ...);

This patch was semi-automatically prepared with these steps:

    1. Patch in https://chromium-review.googlesource.com/c/chromium/src/+/1635827
       to make thread affinity a build-time requirement.
    2. Run an initial pass with a clang rewriter:
       https://chromium-review.googlesource.com/c/chromium/src/+/1635623
    3. ninja -C out/Debug | grep 'requested here' | cut -d: -f1-3 | sort | \
           uniq > errors.txt
    4. while read line; do
         f=$(echo $line | cut -d: -f 1)
         r=$(echo $line | cut -d: -f 2)
         c=$(echo $line | cut -d: -f 3)
         sed -i "${r}s/./&base::ThreadPool(),/$c" $f
       done < errors.txt
    5. GOTO 3 until build succeeds.
    6. Remove the "WithTraits" suffix from task API call sites:

       $ tools/git/mffr.py -i <(cat <<EOF
       [
         ["PostTaskWithTraits",                            "PostTask"],
         ["PostDelayedTaskWithTraits",                     "PostDelayedTask"],
         ["PostTaskWithTraitsAndReply",                    "PostTaskAndReply"],
         ["CreateTaskRunnerWithTraits",                    "CreateTaskRunner"],
         ["CreateSequencedTaskRunnerWithTraits",           "CreateSequencedTaskRunner"],
         ["CreateUpdateableSequencedTaskRunnerWithTraits", "CreateUpdateableSequencedTaskRunner"],
         ["CreateSingleThreadTaskRunnerWithTraits",        "CreateSingleThreadTaskRunner"],
         ["CreateCOMSTATaskRunnerWithTraits",              "CreateCOMSTATaskRunner"]
       ]
       EOF
       )

This CL was uploaded by git cl split.

R=boliu@chromium.org, tsepez@chromium.org

Bug: 968047
Change-Id: I346372d16a3856186ea74d14e0dd8a12f7cacae5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1729589
Commit-Queue: Sami Kyöstilä <skyostil@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Bo <boliu@chromium.org>
Auto-Submit: Sami Kyöstilä <skyostil@chromium.org>
Cr-Commit-Position: refs/heads/master@{#683554}
2019-08-02 12:45:05 +00:00
Matt Menke
93156903e2 Remove SiteIsolatedCodeCaches feature flag as it's now always enabled.
Also remove code that was only reachable when it was disabled, including
most HttpCache::Transaction metadata read/write code.

Bug: 892064
Change-Id: Iaa680a54b14fa711c7057e79bde5df49f48bc1ba
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1647685
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Reviewed-by: Maks Orlovich <morlovich@chromium.org>
Commit-Queue: Matt Menke <mmenke@chromium.org>
Cr-Commit-Position: refs/heads/master@{#667557}
2019-06-10 11:38:10 +00:00
Mythri A
0e9590a956 [test] Fix a bug in StoragePartitionImplTest.ClearCodeCacheDateRange
Bug: chromium:925957
Change-Id: I40627d2e0b26d608dba2e119b3f6de834594430a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1635615
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Commit-Queue: Mythri Alle <mythria@chromium.org>
Cr-Commit-Position: refs/heads/master@{#664739}
2019-05-30 14:48:01 +00:00
Mythri A
a23081fe59 [test] Enable StoragePartitionImplTest.ClearCodeCacheDate
This was flaky because SetLastTime was flaky on the SimpleCache backend.
This was fixed in this cl:
https://chromium-review.googlesource.com/c/chromium/src/+/1409347. This
test should be stable after this fix.

Change-Id: Id90f73bc35c4a3240fba8e5e717ece9bc22f1e39
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1635260
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Commit-Queue: Mythri Alle <mythria@chromium.org>
Cr-Commit-Position: refs/heads/master@{#664418}
2019-05-29 20:01:33 +00:00
John Abd-El-Malek
85f30bd056 Fix minor failures in content_unittests when kNetworkService is enabled.
Bug: 966633
Change-Id: I840509fcf2e0cf27ed1bdf8a384023a95d424b6c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1629690
Commit-Queue: John Abd-El-Malek <jam@chromium.org>
Commit-Queue: Clark DuVall <cduvall@chromium.org>
Auto-Submit: John Abd-El-Malek <jam@chromium.org>
Reviewed-by: Clark DuVall <cduvall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#663779}
2019-05-28 16:58:24 +00:00
James Lissiak
28b21a67f0 DevTools: Replace the chrome-devtools:// URL scheme with a more generic
devtools:// scheme

This change replaces the chrome-devtools:// URL scheme, with a more
browser-agnostic equivalent.
Naturally, many files had to be touched, but it's mostly a
straightforward find/replace.

A related change is out against the catapult repo here:
https://chromium-review.googlesource.com/c/catapult/+/1606268,
which removes a test file containing the old scheme. Once it goes in,
the root DEPS file in the chromium repo needs to be updated as well.

Note:
This is a continuation of patch 1552143, but since Fabio is out on
leave and I don't have permissions to upload to his patch, I needed to
start a new one.

Bug: 960409
Change-Id: I3ede7f8d1dcbca457167eb3641ae60e9685d8d78
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1582881
Commit-Queue: James Lissiak <jalissia@microsoft.com>
Reviewed-by: Joel Einbinder <einbinder@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Scott Violet <sky@chromium.org>
Reviewed-by: Charlie Reis <creis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#659944}
2019-05-15 15:32:04 +00:00
Raul Tambre
83f40f5c17 Convert BrowsingDataRemover to use url::Origin
It's more appropriate to use url::Origin since we don't need to handle URLs.
API boundaries are updated minimally. There are no functional changes.

Bug: 598424, 915773
Change-Id: I4594b4000676a6a1d39c9ec31dfefa884487a59c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1430482
Commit-Queue: Avi Drissman <avi@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Reviewed-by: Joshua Bell <jsbell@chromium.org>
Reviewed-by: Darwin Huang <huangdarwin@chromium.org>
Auto-Submit: Raul Tambre <raul@tambre.ee>
Cr-Commit-Position: refs/heads/master@{#639368}
2019-03-11 00:04:56 +00:00
Aaron Tagliaboschi
29764f5f85 Change net::CookieStore::SetCookiesCallback to return CookieInclusionStatus
Part of an effort to send better cookie information, and more specifically information as to *when* any *why* a cookie has been blocked from sending or storing.

Matt: //net
Maks: //service
Elly: //ios
Jochen: //chrome and //content
Torne: //android_webview


Bug: 856777
Change-Id: Ide937b3d00e0d1aca2d5155c21310fa072b022df
Reviewed-on: https://chromium-review.googlesource.com/c/1470931
Reviewed-by: Matt Menke <mmenke@chromium.org>
Reviewed-by: Jochen Eisinger <jochen@chromium.org>
Reviewed-by: Richard Coles <torne@chromium.org>
Reviewed-by: Maks Orlovich <morlovich@chromium.org>
Reviewed-by: Elly Fong-Jones <ellyjones@chromium.org>
Commit-Queue: Aaron Tagliaboschi <aarontag@chromium.org>
Cr-Commit-Position: refs/heads/master@{#634238}
2019-02-21 17:19:59 +00:00
Wez
0f365ce494 [Fuchsia] Disable flaky StoragePartitionImplTest.ClearCodeCacheDateRange test.
TBR=mythria

Bug: 925957
Change-Id: I72bc4e447121cb2f615143b782d6b7d756e0269a
Reviewed-on: https://chromium-review.googlesource.com/c/1440503
Reviewed-by: Wez <wez@chromium.org>
Commit-Queue: Wez <wez@chromium.org>
Cr-Commit-Position: refs/heads/master@{#626754}
2019-01-28 22:02:12 +00:00
Mythri Alle
fadc545915 Add support to clear a subset of the code cache
Add suppoort to clear the code cache that are accessed over a
date range and/or that match particular URL. Earlier we used
to clear the entire cache by ignoring these filters.

Bug: chromium:866419
Change-Id: I9b9a6f388d6629e0e95eb7a010fe46f08e3fda96
Reviewed-on: https://chromium-review.googlesource.com/c/1396221
Commit-Queue: Mythri Alle <mythria@chromium.org>
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Reviewed-by: Lucas Gadani <lfg@chromium.org>
Reviewed-by: Maks Orlovich <morlovich@chromium.org>
Cr-Commit-Position: refs/heads/master@{#626514}
2019-01-28 13:05:43 +00:00
Sebastien Marchand
f8cbfab434 Include base/bind.h in the files that use it (in //content).
Gab, I've used your refactoring script for this, the rule is:
  matches = re.compile(r'(\n *[^/\n][^/\n]*base::Bind(Once|Repeating)?\b[^*])', re.DOTALL).findall(content)

  if not matches:
    return False

  updated_content = refactor_lib.AddInclude(file_path, content, "base/bind.h")

  if updated_content == content:
    return False

  # Write updated file
  refactor_lib.WriteFile(file_path, updated_content)

TBR=gab@chromium.org

Change-Id: I6cca9dff7fa4937fd7accdc57fe774674f6c147b
Reviewed-on: https://chromium-review.googlesource.com/c/1437100
Commit-Queue: Sébastien Marchand <sebmarchand@chromium.org>
Reviewed-by: Gabriel Charette <gab@chromium.org>
Cr-Commit-Position: refs/heads/master@{#626088}
2019-01-25 16:02:30 +00:00
Aaron Tagliaboschi
a4c64b5079 Change signature of GetCookieListCallback to include list of excluded cookies
Added CookieWithStatus and CookieStatusList typedefs to clean things up a little

TBRing reviewers:
jochen: Mostly mechanical changes all over the place. render_frame_message_filter.cc has a helper function that might be interesting

Bug: 856777
Change-Id: Icd8d4348623a602540cf5aca2865e190359d379d
Reviewed-on: https://chromium-review.googlesource.com/c/1416151
Reviewed-by: Jochen Eisinger <jochen@chromium.org>
Reviewed-by: Richard Coles <torne@chromium.org>
Reviewed-by: Matt Menke <mmenke@chromium.org>
Reviewed-by: Maks Orlovich <morlovich@chromium.org>
Reviewed-by: Elly Fong-Jones <ellyjones@chromium.org>
Commit-Queue: Aaron Tagliaboschi <aarontag@chromium.org>
Cr-Commit-Position: refs/heads/master@{#625977}
2019-01-25 03:28:49 +00:00
Mythri Alle
c7528ed7d6 Serialize read/write operations corresponding to a key in GeneratedCodeCache
Since read and write involves multiple operations (for ex: open entry,
create entry, write data) it is possible that these operations overlap
and we may read an incomplete entry. Hence it is safer to serialize
the operations at the GeneratedCodeCache layer.

Bug: 886892
Change-Id: Idc26079b6e3d4682a030b9ba04b11c624119dad4
Reviewed-on: https://chromium-review.googlesource.com/c/1398085
Commit-Queue: Mythri Alle <mythria@chromium.org>
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Reviewed-by: Maks Orlovich <morlovich@chromium.org>
Cr-Commit-Position: refs/heads/master@{#623676}
2019-01-17 14:21:17 +00:00
Avi Drissman
9d3ded9fe1 Use base::size rather than arraysize in content/.
This is purely a mechanical change; there is no intended behavior change.

BUG=837308
TBR=piman@chromium.org

Change-Id: I5ce196bbb75462a0967a95d1b5fd2e72df2c86f4
Reviewed-on: https://chromium-review.googlesource.com/c/1390894
Reviewed-by: Avi Drissman <avi@chromium.org>
Commit-Queue: Avi Drissman <avi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#618881}
2018-12-25 20:50:21 +00:00
Raul Tambre
f2a59ca504 Convert StorageUsageInfo to use url::Origin
Conversion done at API boundaries is minimal.
There are no functional changes.

Bug: 915773

Change-Id: I99c8157cde329a24d2bcaeb868c5ddf1fbffddc1
Reviewed-on: https://chromium-review.googlesource.com/c/1378978
Reviewed-by: Joshua Bell <jsbell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#617534}
2018-12-18 16:59:46 +00:00
Bill Budge
4d028f1266 [WebAssembly] Add blink::feature kWasmCodeCache.
- Adds kWasmCodeCache to blink::features.
- Checks if enabled before creating the cache in the browser.
- Checks if enabled before fetching from cache in renderer.

This is patterned after the Javascript IsolatedCodeCache feature.

Bug: chromium:719172
Change-Id: I1ffea5d8029b2b550c45e3ba25821889c7c2183c
Reviewed-on: https://chromium-review.googlesource.com/c/1341071
Commit-Queue: Bill Budge <bbudge@chromium.org>
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Reviewed-by: Mythri Alle <mythria@chromium.org>
Cr-Commit-Position: refs/heads/master@{#609705}
2018-11-20 15:05:12 +00:00
Joshua Bell
0584077e98 Browsing Data: Unify storage usage structs
Code in chrome/browser/browsing_data queries storage back-ends for
origins and the size on disk and last modified time of each origin's
data. This is done for each storage backend by unique plumbing between
a BrowsingDataXXXHelper and the corresponding XXXContext via the
BrowsingContext's StoragePartition. The same data (list of
origin/size/time tuples) is reported for each storage backend.

Replace structs specific to each type (e.g. XXXUsageInfo) with a
generic StorageUsageInfo struct. This removes several nearly identical
classes from content/public/browser (for Indexed DB, Cache Storage
API, Local Storage, Service Worker). Follow ons can remove similar
classes (e.g. PendingXXXUsageInfo) and do other code deduplication.

One functional change: The list of scopes registered for Service
Workers is no longer displayed in the "cookies tree"
(chrome://settings/siteData); this is not useful for end users and
developers should use devtools instead.

Change-Id: Ibd759c3e303188580aea8bfcaa450b44183bc100
Reviewed-on: https://chromium-review.googlesource.com/c/1308074
Commit-Queue: Joshua Bell <jsbell@chromium.org>
Reviewed-by: Scott Violet <sky@chromium.org>
Reviewed-by: Christian Dullweber <dullweber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#605521}
2018-11-06 00:18:31 +00:00
Christian Dullweber
9ed337ff98 Integrate RewriteDB() with LocalStorage
Rebuild leveldb for LocalStorage when deleting all cookies. This will
remove traces of deleted data from disk.
This change adds a RewriteDB() method to leveldb.mojom and adds
handling of error cases, where the database service becomes unusable
and closes the mojo connection.

TBR: michaelbai@chromium.org
Bug: 823071
Change-Id: I639ce21d7578d19e45ea9b7329b6ccbdfab8b527
Reviewed-on: https://chromium-review.googlesource.com/c/1162172
Commit-Queue: Christian Dullweber <dullweber@chromium.org>
Reviewed-by: Paul Meyer <paulmeyer@chromium.org>
Reviewed-by: Achuith Bhandarkar <achuith@chromium.org>
Reviewed-by: Steven Holte <holte@chromium.org>
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Reviewed-by: Marijn Kruisselbrink <mek@chromium.org>
Reviewed-by: Daniel Murphy <dmurph@chromium.org>
Cr-Commit-Position: refs/heads/master@{#603057}
2018-10-26 11:34:10 +00:00
Mythri Alle
b5aca7d5ae Fix clearing of code caches to work with network service
Http caches are owned by network service when network service is enabled
otherwise they are owned by browser thread. HttpCaches are cleared by
StoragePartitionHttpDataRemover on browser thread when network service
is not enabled. However, with network service enabled they are cleared by
a different mechanism by the network service.

GeneratedCodeCaches are owned by the browser process and clearing them
should be cleared by the browser process. Hence clearing the
GeneratedCodeCache along with HttpCaches in StoragePartitionDataRemover
doesn't work. This cl refactors the clearing of code caches into a separate
class, so it can be used both with and without network service.

Bug: chromium:892652
Change-Id: I5238de412f35f3dc90ae69c37b76e83d34a0d089
Reviewed-on: https://chromium-review.googlesource.com/c/1270946
Reviewed-by: Fady Samuel <fsamuel@chromium.org>
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Reviewed-by: Victor Costan <pwnall@chromium.org>
Reviewed-by: Maks Orlovich <morlovich@chromium.org>
Commit-Queue: Mythri Alle <mythria@chromium.org>
Cr-Commit-Position: refs/heads/master@{#601897}
2018-10-23 10:22:03 +00:00
Mythri Alle
0b8de0d338 Add support so embedder can configure code cache settings.
Add support that lets embedder specify if code caching is enabled
and if enabled the disk size that can be used by the cache. By default
code caching is disabled. This cl also adds implementation for chrome
that enables code caching.

Bug: chromium:867552
Change-Id: I6edb4c0c4f3830d44731225ec91c5e95005be9da
Reviewed-on: https://chromium-review.googlesource.com/c/1213093
Commit-Queue: Mythri Alle <mythria@chromium.org>
Reviewed-by: Bo <boliu@chromium.org>
Reviewed-by: Eric Seckler <eseckler@chromium.org>
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Cr-Commit-Position: refs/heads/master@{#601524}
2018-10-22 11:06:22 +00:00