0
Commit Graph

272 Commits

Author SHA1 Message Date
Aaron Colwell
4fcbe41517 Introduce ChildProcessSecurityPolicyImpl::Handle.
This change introduces a Handle object so that Mojo services can
preserve the security state beyond the lifetime of the
RenderProcessHostImpl object. This allows consistent security
checks to occur even during the period when the renderer process is
shutting down and there are still pending Mojo operations in flight.
This will be used to remove all remaining uses of
ChildProcessSecurityPolicyImpl::HasSecurityState() in follow-up CLs.

- Implements new Handle object that allows security checks to provide
  consistent results after ChildProcessSecurityPolicyImpl::Remove() is
  called.
- Convert blob code to use Handle instead of the HasSecurityState()
  workaround.

This is an updated version of https://crrev.com/c/1534368 . Further
discussion of the history and reasons for this CL can be found there.

Bug: 1035399, 943887
Change-Id: I6165fad4308643a1ddc845690443e8efceac65f4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1975165
Reviewed-by: Aaron Colwell <acolwell@chromium.org>
Reviewed-by: Alex Moshchuk <alexmos@chromium.org>
Reviewed-by: Łukasz Anforowicz <lukasza@chromium.org>
Reviewed-by: Marijn Kruisselbrink <mek@chromium.org>
Commit-Queue: Aaron Colwell <acolwell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#732296}
2020-01-16 07:10:59 +00:00
Lukasz Anforowicz
7b6b1f9bdc Add DwoC for DCHECK(was_notify_will_be_destroyed_called_).
This CL adds a DumpWithoutCrashing call when a destructor of
content::BrowserContext gets called without an earlier call
to BrowserContext::NotifyWillBeDestroyed.

This CL will hopefully help
1) verify if there are scenarios in the wild, where a
   BrowserContext/Profile gets destroyed without calling
   BrowserContext::NotifyWillBeDestroyed first
2) find root cause of these scenarios

Bug: 1038844
Change-Id: Ifb40daa27b7b4a4fc301df2ea6f09ffa499fe7d1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1986262
Auto-Submit: Łukasz Anforowicz <lukasza@chromium.org>
Reviewed-by: Nasko Oskov <nasko@chromium.org>
Commit-Queue: Łukasz Anforowicz <lukasza@chromium.org>
Cr-Commit-Position: refs/heads/master@{#728321}
2020-01-03 22:46:32 +00:00
Greg Thompson
3294209a2a Fix shutdown order of BackgroundSyncScheduler.
BackgroundSyncScheduler must be shut down before StorageParitions, as
the former holds raw pointers to the latter in its delayed processing
maps.

BUG=546640,996166

Change-Id: Id15613bd28ace2c6dbb727cabdb9c89352696d7a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1967079
Commit-Queue: Greg Thompson <grt@chromium.org>
Reviewed-by: Mugdha Lakhani <nator@chromium.org>
Reviewed-by: Nasko Oskov <nasko@chromium.org>
Auto-Submit: Greg Thompson <grt@chromium.org>
Cr-Commit-Position: refs/heads/master@{#724929}
2019-12-14 07:48:55 +00:00
danakj
151f8fdd0c Convert Callbacks to {Once,Repeating}Callback in content/browser/
Use OnceCallback where possible because the callback is only used once
and RepeatingCallback and BindRepeating otherwise.

Pass RepeatingCallback ownership by value instead of const ref.

R=avi@chromium.org

Bug: 1007760
Change-Id: I18ea04793d877ab91733dc3ecba363c2509ea68a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1961134
Commit-Queue: danakj <danakj@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Auto-Submit: danakj <danakj@chromium.org>
Cr-Commit-Position: refs/heads/master@{#723678}
2019-12-11 03:11:14 +00:00
danakj
6a28d7d586 Convert base::Bind to base::Bind{Once,Repeating} in content/public/.
Use OnceCallback where possible, otherwise rename to RepeatingCallback
and BindRepeating.

R=avi@chromium.org

Bug: 1007763
Change-Id: I06c210dafc3066d4b26da90e484d3099dcf28b4d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1958891
Commit-Queue: danakj <danakj@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#723401}
2019-12-10 18:56:29 +00:00
Adrienne Walker
c67465b8c5 idb: Remove the explicit use of BrowserThread::IO from idb
As a part of moving to storage service, the indexeddb code can't depend
on BrowserThread::IO and will need some other new IO thread.  To handle
this, the idb context now exposes an IOTaskRunner (which for now is
still the browser IO thread) which is plumbed everywhere that is needed.

Change-Id: Idef64cb47ab4483b2584ce6d7b19aee25d6add18
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1954724
Reviewed-by: John Abd-El-Malek <jam@chromium.org>
Reviewed-by: Daniel Murphy <dmurph@chromium.org>
Commit-Queue: enne <enne@chromium.org>
Cr-Commit-Position: refs/heads/master@{#722662}
2019-12-06 22:52:11 +00:00
Aaron Colwell
dd0ae764d5 Replace site URL with partition_domain in BrowserContext::AsyncObliterateStoragePartition()
This change simply removes the need to wrap the extension ID in a site URL and then
immediately extract it to delete the partition. The partition_domain is always the
extension ID so I'm just making that fact explicit.

Bug: None
Change-Id: Ie138d70a3489d6bbdf927190ebb811664c47d398
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1947813
Commit-Queue: Aaron Colwell <acolwell@chromium.org>
Reviewed-by: Devlin <rdevlin.cronin@chromium.org>
Reviewed-by: Alex Moshchuk <alexmos@chromium.org>
Auto-Submit: Aaron Colwell <acolwell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#722246}
2019-12-05 22:24:57 +00:00
Ken Rockot
6b5017edcd Move Multidevice Setup Service off Service Manager
The service always runs in the browser process. This stuffs a service
instance directly into the MultiDeviceSetupClientFactory KeyedService
and makes it accessible directly to browser code.

Where necessary, minimal changes have been made to allow code outside
of chrome/browser to get at the service instance to bind interfaces.

Bug: 977637
Change-Id: I795683f352dac09cff4fc36cc4eb225df0c03d6a
Tbr: avi@chromium.org
No-Presubmit: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1931563
Commit-Queue: Ken Rockot <rockot@google.com>
Reviewed-by: Kyle Horimoto <khorimoto@chromium.org>
Reviewed-by: Xiyuan Xia <xiyuan@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/master@{#722179}
2019-12-05 20:39:41 +00:00
Ken Rockot
3f90e70e07 Move Content Service off Service Manager
This sticks a Content Service instance directly in each BrowserContext
rather than having them owned indirectly by BrowserContext via
Service Manager APIs.

The two existing uses are refactored to get NavigableContentsFactory
receivers bound directly through the BrowserContext rather than using
a Service Manager Connector.

Bug: 977637
Change-Id: I4a3e41235e15a8b93973f152e8313d8612bfc290
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1931444
Commit-Queue: Ken Rockot <rockot@google.com>
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Reviewed-by: Robert Sesek <rsesek@chromium.org>
Reviewed-by: Xiyuan Xia <xiyuan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#721729}
2019-12-04 23:27:23 +00:00
Matt Falkenhagen
b5f46c457c Convert to OnceCallback in content/public/browser_context.h
Bug: 1007763
Change-Id: I4d8ff83c57851b4dc5d470b046ef76510eb36253
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1942900
Commit-Queue: Matt Falkenhagen <falken@chromium.org>
Reviewed-by: Hiroki Nakagawa <nhiroki@chromium.org>
Cr-Commit-Position: refs/heads/master@{#720391}
2019-12-02 05:25:58 +00:00
Marijn Kruisselbrink
2ba0ef323a Use disk-backed file system backend when in guest mode on Chrome OS.
Guest mode on Chrome OS is stored in a in-memory file system anyway,
so using the disk backed sandboxed file system backend should be fine.
This in turn should then make QuickOffice work again in guest mode, as
the disk backed backend supports some PPAPI features that QuickOffice
depends on, which aren't supported by the in-memory backend.

Bug: 1005594
Change-Id: Id65760efe278d5479b68fb7b4cba2df4336c6f73
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1922431
Commit-Queue: Marijn Kruisselbrink <mek@chromium.org>
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Reviewed-by: Colin Blundell <blundell@chromium.org>
Reviewed-by: Ramin Halavati <rhalavati@chromium.org>
Cr-Commit-Position: refs/heads/master@{#719691}
2019-11-27 19:12:41 +00:00
Mario Sanchez Prada
fa6dda8c41 Migrate blink.mojom.GeolocationService to BrowserInterfaceBroker
This CL migrates code to the new BrowserInterfaceBroker class. This
allows retrieving the remote implementation in the browser process
from the renderer process without relying on InterfaceProvider.

Bug: 955171, 978694, 936482
Change-Id: I0f962d8f9a21d95b376062fdc2d585130fa0e71b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1893165
Commit-Queue: Mario Sanchez Prada <mario@igalia.com>
Reviewed-by: Camille Lamy <clamy@chromium.org>
Reviewed-by: Arthur Sonzogni <arthursonzogni@chromium.org>
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Reviewed-by: Bo <boliu@chromium.org>
Reviewed-by: Oksana Zhuravlova <oksamyt@chromium.org>
Reviewed-by: Dominick Ng <dominickn@chromium.org>
Cr-Commit-Position: refs/heads/master@{#718711}
2019-11-25 18:20:19 +00:00
Francois Doray
94f7983b1f Remove unused SequencedTaskRunner member in BrowserContextServiceManagerConnectionHolder.
Change-Id: I543ef610bdd8b6ff75033fc6014a37b871b07086
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1909386
Auto-Submit: François Doray <fdoray@chromium.org>
Reviewed-by: Nasko Oskov <nasko@chromium.org>
Commit-Queue: François Doray <fdoray@chromium.org>
Cr-Commit-Position: refs/heads/master@{#714942}
2019-11-13 16:26:16 +00:00
Adrienne Walker
ac6a9e5033 storage: pass around blob bytes as uint8_t
This is a followup to this patch:
https://chromium-review.googlesource.com/c/chromium/src/+/1830360

There's sort of a mismatch between whether code uses uint8_t or
char for bytes.  I think uint8_t is a little bit better of a
representation and matches what BigBuffer does.  This cleans up
a bit of storage code and apis to use that in more places.

Bug: 1012869

Change-Id: I7b1e8eb7d9b967f451b19f9c1c6d86c0d89d3ccd
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1857648
Commit-Queue: enne <enne@chromium.org>
Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
Reviewed-by: Ben Wells <benwells@chromium.org>
Reviewed-by: Daniel Murphy <dmurph@chromium.org>
Reviewed-by: Marijn Kruisselbrink <mek@chromium.org>
Auto-Submit: enne <enne@chromium.org>
Cr-Commit-Position: refs/heads/master@{#710035}
2019-10-28 20:59:33 +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
Hans Wennborg
5ffd1393b3 Include bloat: reduce number of includes in content_browser_client.h
This reduces the number of preprocessor tokens in
content_browser_client.h from 1,335,281 to 754,474. Since this is a
widely included file, reducing build times a fair bit (see bug).

TBR=tsepez for content/browser/child_process_security_policy_*

Bug: 1014009
Change-Id: Id3c2de29f5b08cab80820d01aff722afeb1618e6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1857126
Commit-Queue: Hans Wennborg <hans@chromium.org>
Reviewed-by: Richard Coles <torne@chromium.org>
Reviewed-by: Ken Rockot <rockot@google.com>
Reviewed-by: Nico Weber <thakis@chromium.org>
Reviewed-by: Camille Lamy <clamy@chromium.org>
Reviewed-by: Sami Kyöstilä <skyostil@chromium.org>
Cr-Commit-Position: refs/heads/master@{#706388}
2019-10-16 11:00:02 +00:00
Takashi Toyoshima
1284414620 OOR-CORS: Introduce enterprise policies
This patch introduces two enterprise policies, one is
kCorsLegacyModeEnabled, and the other is kCorsMitigationList.

kCorsLegacyModeEnabled disbles OOR-CORS feature completely,
and uses the legacy Blink CORS instead. The policy can not be
dynamically modified, and a consistent value is managed by
per-profile instance in the browser process.

Call sites in the browser process checks the OOR-CORS mode
via BrowserContext, and if the actual instance inherits
Profile class, it counts in the policy. If call sites do
not have a corresponding BrowserContext, it directly checks
base::FeatureList.

Call sites in the renderer processes are managed via a
command line flag. The browser process properly sets the
flag based on the OOR-CORS mode that is checked by the steps
described above.

Call sites in the network process should ask the relevant
NetworkContext. Each NetworkContext should initialize the
OOR-CORS mode based on the NetworkContextParams that should
be properly set by the browser process. If the constructor
that does not have the NetworkContextParams argument is called,
base::FeatureList is directly checked to initialize the mode.

Thus, all components for chromium can use a consistent CORS
mode during each profile session.

kCorsMitigationList still activate the OOR-CORS as long as the
feature is not disabled for other reasons. But it adopts
compatibility mitigation to mimic the legacy behavior. E.g.,
it enforces all Extensions to call webRequest API with
"extraHeaders" option, and specified header names are assumed
as CORS-safelisted so that it does not trigger CORS preflights.

Bug: 1000977, 1000984, 1000982
Change-Id: I4166e26405482e479c895db639bb73a4388fc0b5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1830253
Reviewed-by: Karan Bhatia <karandeepb@chromium.org>
Reviewed-by: Matt Menke <mmenke@chromium.org>
Reviewed-by: Scott Violet <sky@chromium.org>
Reviewed-by: Maksim Ivanov <emaxx@chromium.org>
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Reviewed-by: Yutaka Hirano <yhirano@chromium.org>
Commit-Queue: Takashi Toyoshima <toyoshim@chromium.org>
Cr-Commit-Position: refs/heads/master@{#706301}
2019-10-16 04:19:17 +00:00
Ken Rockot
47c47d8620 Remove most Connector usage from child processes
This removes almost all remaining usage of Connector from child
processes, instead preferring use of ChildProcessHost.BindHostReceiver
to acquire process-scoped interfaces from the browser.

The one remaining use case after this CL is for the Device Service's
PowerMonitor API. This is left as a separate change because it requires
substantial additional support code for testing.

Bug: 977637
Change-Id: I679c6d7f5ec01d1bc1bb6852e0f79a3f1650df34
Tbr: penghuang@chromium.org
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1815731
Commit-Queue: Ken Rockot <rockot@google.com>
Reviewed-by: Sadrul Chowdhury <sadrul@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/master@{#700317}
2019-09-26 17:38:07 +00:00
Ken Rockot
f99d286e3c Reland "Move File Service off Service Manager"
This is a reland of 749dcc3bc7

PS1->PS4 shows the exclusive delta from the original patch, fixing a subtle
lifetime issue in FileService. This turns out to have always been wrong:
LevelDBServiceImpl can be destroyed before its created
LevelDBDatabaseImpl objects have received all messages, and the service
impl owns the shared message pipe for the associated database interfaces; thus
messages can be dropped and data lost. This never mattered before because
FileService instances effectively lived forever anyway.

The fix here makes LevelDBServiceImpl lifetime independent of FileService
lifetime, tying it instead to client lifetime.

Original change's description:
> Move File Service off Service Manager
>
> This is a first step towards eliminating the File Service and migrating
> DOM Storage code into the Storage Service.
>
> File Service and its only clients (DOM storage objects) are moved off of
> Service Manager APIs. LocalStorageContextMojo and
> SessionStorageContextMojo are changed to own their own FileService
> instance, now constructed directly over a directory path.
>
> No functional changes intended in this CL.
>
> Bug: 994911,977637
> Change-Id: I2ffd0bef670304a0dc3c103981139603521a14ac
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1778801
> Commit-Queue: Ken Rockot <rockot@google.com>
> Reviewed-by: Avi Drissman <avi@chromium.org>
> Reviewed-by: Robert Sesek <rsesek@chromium.org>
> Reviewed-by: Marijn Kruisselbrink <mek@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#698487}

NOPRESUBMIT=true

Bug: 994911, 977637
Change-Id: I12658247e428f2e5eee32a2e3eabe3eb35381238
Tbr: avi@chromium.org
Tbr: mek@chromium.org
Tbr: rsesek@chromium.org
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1816582
Commit-Queue: Ken Rockot <rockot@google.com>
Reviewed-by: Ken Rockot <rockot@google.com>
Cr-Commit-Position: refs/heads/master@{#699231}
2019-09-24 07:41:48 +00:00
Ken Rockot
2899210a86 Revert "Move File Service off Service Manager"
This reverts commit 749dcc3bc7.

Reason for revert: Inexplicable Fuchsia failures https://logs.chromium.org/logs/chromium/buildbucket/cr-buildbucket.appspot.com/8901777180770604000/+/steps/content_unittests/0/logs/Deterministic_failure:_SessionStorageContextMojoTest.Scavenging__status_FAILURE_/0

Original change's description:
> Move File Service off Service Manager
> 
> This is a first step towards eliminating the File Service and migrating
> DOM Storage code into the Storage Service.
> 
> File Service and its only clients (DOM storage objects) are moved off of
> Service Manager APIs. LocalStorageContextMojo and
> SessionStorageContextMojo are changed to own their own FileService
> instance, now constructed directly over a directory path.
> 
> No functional changes intended in this CL.
> 
> Bug: 994911,977637
> Change-Id: I2ffd0bef670304a0dc3c103981139603521a14ac
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1778801
> Commit-Queue: Ken Rockot <rockot@google.com>
> Reviewed-by: Avi Drissman <avi@chromium.org>
> Reviewed-by: Robert Sesek <rsesek@chromium.org>
> Reviewed-by: Marijn Kruisselbrink <mek@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#698487}

TBR=avi@chromium.org,rockot@google.com,mek@chromium.org,rsesek@chromium.org

Change-Id: I62995f899ebb399f929b1a95d415a79d675480e6
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 994911, 977637
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1815727
Reviewed-by: Ken Rockot <rockot@google.com>
Commit-Queue: Ken Rockot <rockot@google.com>
Cr-Commit-Position: refs/heads/master@{#698564}
2019-09-20 18:32:32 +00:00
Ken Rockot
749dcc3bc7 Move File Service off Service Manager
This is a first step towards eliminating the File Service and migrating
DOM Storage code into the Storage Service.

File Service and its only clients (DOM storage objects) are moved off of
Service Manager APIs. LocalStorageContextMojo and
SessionStorageContextMojo are changed to own their own FileService
instance, now constructed directly over a directory path.

No functional changes intended in this CL.

Bug: 994911,977637
Change-Id: I2ffd0bef670304a0dc3c103981139603521a14ac
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1778801
Commit-Queue: Ken Rockot <rockot@google.com>
Reviewed-by: Avi Drissman <avi@chromium.org>
Reviewed-by: Robert Sesek <rsesek@chromium.org>
Reviewed-by: Marijn Kruisselbrink <mek@chromium.org>
Cr-Commit-Position: refs/heads/master@{#698487}
2019-09-20 15:12:07 +00:00
liberato@chromium.org
3af28f1aaf Added MediaLearningTasks.
This CL just adds a place for us to define the LearningTasks for all
the renderer-side media experiments.

Change-Id: I1253506541f1bc87a859f7a212d3f0894281de66
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1809112
Reviewed-by: Charlie Reis <creis@chromium.org>
Reviewed-by: Thomas Guilbert <tguilbert@chromium.org>
Commit-Queue: Frank Liberato <liberato@chromium.org>
Cr-Commit-Position: refs/heads/master@{#698059}
2019-09-19 16:32:14 +00:00
Julie Jeongeun Kim
bc4a76d589 Convert BlobPtr in //third_party/blink and //storage to new Mojo types
This CL converts BlobPtr in //third_party/blink and //storage
to mojo::PendingRemote or mojo::Remote.

It also renames GetBlobPtr() to GetBlobRemote() from
BrowserContext and cleans up TakeBlobPtr() from
storage/browser/blob/blob_handle.h.

Bug: 955171, 978694
Change-Id: Iff9bc1862ba9fda0de0a5c29d982dfcd7ec87dd9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1792210
Commit-Queue: Julie Kim <jkim@igalia.com>
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Reviewed-by: Reilly Grant <reillyg@chromium.org>
Reviewed-by: Oksana Zhuravlova <oksamyt@chromium.org>
Cr-Commit-Position: refs/heads/master@{#695456}
2019-09-11 02:28:23 +00:00
Thomas Guilbert
a424bb2e59 Add LearningSession to BrowserContext
This CL adds a singleton LearningSession to BrowserContext. This
provides a single location from which to get LearningTaskControllers,
which will allow aggregating observations accross multiple frames.

Bug: 994831
Change-Id: Ibeaf47a09ae7408d0afab9bc113a98e9f1532199
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1758625
Reviewed-by: Matt Falkenhagen <falken@chromium.org>
Reviewed-by: Frank Liberato <liberato@chromium.org>
Commit-Queue: Thomas Guilbert <tguilbert@chromium.org>
Cr-Commit-Position: refs/heads/master@{#688733}
2019-08-20 21:33:41 +00:00
ssid
554500e127 [leveldb_proto] Migrated video_decode_stats to new API
leveldb_proto is a component that allows storing proto objects in a
leveldb database. A client can get a leveldb_proto database by calling a
static method.

This simple API made it easy for developers to integrate leveldb_proto
in their components, this resulted in a large amount of clients, with
each one using a unique leveldb instance. Having multiple db instances
increases memory consumption, as each database caches frequently used
contents.

There has been an effort to move leveldb_proto databases from multiple
instances to a shared instance, to decrease memory consumption and
simplify configuration. As part of this effort the leveldb_proto
database retrieval API was moved from a static method into
db provider given by StoragePartition

This CL migrates VideoDecodeStatsDB to the new API.


Bug: 943170
Change-Id: I1d78286589612a2cf733e3c057af35d9c1396246
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1592193
Reviewed-by: John Abd-El-Malek <jam@chromium.org>
Reviewed-by: Chrome Cunningham <chcunningham@chromium.org>
Reviewed-by: Xi Han <hanxi@chromium.org>
Reviewed-by: ssid <ssid@chromium.org>
Commit-Queue: ssid <ssid@chromium.org>
Cr-Commit-Position: refs/heads/master@{#687037}
2019-08-14 22:15:01 +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
Kinuko Yasuda
48c47586a0 Remove some non-NetworkService code in NavigationURLLoaderTest
Also remove some dead code in BrowserContext.

Bug: 934009
Change-Id: I015a1b65086f28304a6f0b0ff36f4341b709b9db
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1723930
Auto-Submit: Kinuko Yasuda <kinuko@chromium.org>
Commit-Queue: John Abd-El-Malek <jam@chromium.org>
Reviewed-by: John Abd-El-Malek <jam@chromium.org>
Cr-Commit-Position: refs/heads/master@{#681810}
2019-07-29 15:08:26 +00:00
John Abd-El-Malek
0e82fe7f42 Stop using ResourceDispatcherHost outside of content/ and remove a bunch of usage inside content/.
It's about to be deleted.

Bug: 934009
Change-Id: I20fc1e1b716ac9fafcc7574db5464e8000d27655
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1719835
Commit-Queue: John Abd-El-Malek <jam@chromium.org>
Reviewed-by: Clark DuVall <cduvall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#681545}
2019-07-27 00:06:29 +00:00
Ken Rockot
d1011893e4 Prevent service startup race at shutdown
We tear down BrowserContext-bound Service Manager services when the
BrowserContext is being torn down, but the relevant state which receives
service requests from the Service Manager is on the IO thread. This
means we can end up hitting races where some client of a service
reconnects to the service and triggers the service-startup path
immediately after BrowserContext destruction, which in turn can violate
service's expectations about shutdown behavior.

This CL fixes that by explicitly posting to disable all service request
handling prior to initiating any service instance destruction.

Bug: 987473
Change-Id: I488d8fbed19bc50efc1b8ea4eee80b0cb36d9bdc
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1717914
Reviewed-by: Fabrice de Gans-Riberi <fdegans@chromium.org>
Reviewed-by: Alex Moshchuk <alexmos@chromium.org>
Commit-Queue: Ken Rockot <rockot@google.com>
Cr-Commit-Position: refs/heads/master@{#681034}
2019-07-25 22:17:07 +00:00
Sam Goto
c1294cab0c [sms] Move SmsService out of content/public and into content/browser
There isn't any browser-specific implementation of SmsService and
it isn't part of the contract of what embeders need to provide, so
there is no reason for it to be in content/public.

Originally, an interface SmsService was created because something
needed to manage an incoming queue of SMS messages which are global
per device. To accomplish that, a SmsKeyedService was created to
hang instances on Profiles, which are in chrome/.

We were anticipating the needed for a chrome/ specific element to
exist in preparation for an integration with Sync to support
Desktop, so SmsKeyedService made sense.

Upon further investigation, we find that this architecture abuses the
contract of content/public artificially and leads to a complicated
relationship between the content-browser separation.

To avoid premature generalization and clarify the architecture,
this CL removes SmsService from the content/public interface, removes
SmsKeyedService and hangs instances of SmsService directly into
BrowserMainLoop.

We'll revisit how to factor Desktop in once we take a few more steps,
bringing a bit more clarity as we go along.

Change-Id: I4a73af1d148ce12d1050d02c91a94a499bdbbf2e
Bug: 984083
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1700645
Commit-Queue: Sam Goto <goto@chromium.org>
Reviewed-by: Reilly Grant <reillyg@chromium.org>
Reviewed-by: John Abd-El-Malek <jam@chromium.org>
Cr-Commit-Position: refs/heads/master@{#677527}
2019-07-15 22:36:01 +00:00
Lucas Furukawa Gadani
0a70be9924 Remove const interfaces from content/public API.
Bug: 908139
Tbr: sky@chromium.org, miu@chromium.org, boliu@chromium.org, seantopping@chromium.org
Change-Id: Ic005b1cc50020f130fe216efcc1c01187bcaa9fc
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1680425
Commit-Queue: Lucas Gadani <lfg@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#673393}
2019-06-28 17:31:26 +00:00
Rayan Kanso
03a847b122 [ContentIndex] Create a public provider interface.
Create a public provider interface for content implementers to receive
updates on added/deleted content index registrations.

Bug: 973844
Change-Id: I4c61801f67a596706e471ae3d57873f25bacfae6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1678563
Commit-Queue: Rayan Kanso <rayankans@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Reviewed-by: Richard Knoll <knollr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#673058}
2019-06-27 21:00:09 +00:00
Rayan Kanso
a7af44333d Remove const modifier from GetSharedCorsOriginAccessList
Reasoning is explained here:
https://www.google.com/url?q=https://www.chromium.org/developers/content-module/content-api

Bug: 908139
Change-Id: I594394f58cf415b30534178d7197fd028cea9073
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1679767
Auto-Submit: Rayan Kanso <rayankans@chromium.org>
Reviewed-by: Luke Halliwell <halliwell@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Commit-Queue: Rayan Kanso <rayankans@chromium.org>
Cr-Commit-Position: refs/heads/master@{#673056}
2019-06-27 20:56:20 +00:00
Lucas Furukawa Gadani
f45223860d Remove const interfaces from content/public/browser/browser_context.h.
Bug: 908139
Tbr: boliu@chromium.org, seantopping@chromium.org, blundell@chromium.org, johannes@chromium.org, scottmg@chromium.org, lazyboy@chromium.org
Change-Id: I539846e658857ab55fa07bbb18697aeeb9d45cda
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1567902
Reviewed-by: Scott Graham <scottmg@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Commit-Queue: Lucas Gadani <lfg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#671447}
2019-06-21 23:11:14 +00:00
Ken Rockot
fd03e68b00 Remove ServiceManagerConnection use from //content
ServiceManagerConnection is slated for imminent deletion. This
replaces most usage around //content/browser with the simpler
GetSystemConnector(). Split out from a much larger CL.

Bug: 904240
Change-Id: Ia88322f607cb6fbf3c5fdf3fd4b6762c8074c0c1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1666778
Commit-Queue: Ken Rockot <rockot@google.com>
Reviewed-by: Becca Hughes <beccahughes@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#671047}
2019-06-20 21:13:54 +00:00
Marijn Kruisselbrink
83e5cdb074 [Native File System] Add hooks to let //chrome implement permissions.
Aiming to be both general enough to support whatever lifetime and
scope for permission grants as we could want, while not being more
complicated than necessary. Follow up CLs will implement an actual
permission model on top of this in //chrome, as well as the UI that
goes with that.

Bug: 878585
Change-Id: I372b07c33f2b945c6b4f70cf85dc6ed046201f2b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1663453
Reviewed-by: Avi Drissman <avi@chromium.org>
Reviewed-by: Victor Costan <pwnall@chromium.org>
Commit-Queue: Marijn Kruisselbrink <mek@chromium.org>
Cr-Commit-Position: refs/heads/master@{#670732}
2019-06-20 00:06:28 +00:00
Chris Cunningham
4507edfaf9 Setup field trial for in-memory MediaCapabilities DB
InMemoryDB is usually reserved for Guest and Incognito accounts. But
recent experiments by liberato@ hinted (noisy stats, other factors may
be responsible) that forgetting all your data at the boundary of each
browsing session might be good for prediction quality. Lets see :)

Bug: 968331
Change-Id: I6803a206266bf7ff6c39d4f6b4c12534c391900d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1636475
Reviewed-by: Frank Liberato <liberato@chromium.org>
Reviewed-by: John Abd-El-Malek <jam@chromium.org>
Auto-Submit: Chrome Cunningham <chcunningham@chromium.org>
Commit-Queue: Chrome Cunningham <chcunningham@chromium.org>
Cr-Commit-Position: refs/heads/master@{#664868}
2019-05-30 20:15:54 +00:00
Victor Costan
4b8909d5bc IndexedDB: Remove unnecessary check in BrowserContext::SaveSessionState.
Bug: 960603
Change-Id: If242cdce46717cb3e60fdf81b317bb30432b2a50
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1629930
Auto-Submit: Victor Costan <pwnall@chromium.org>
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Commit-Queue: Kinuko Yasuda <kinuko@chromium.org>
Cr-Commit-Position: refs/heads/master@{#663862}
2019-05-28 19:25:51 +00:00
Sam Goto
0230b710ec [sms] Create a SmsKeyedService and hang it on Profiles
Explainer:
https://github.com/sso-google/sms-otp-retrieval

Intent to Implement:
https://groups.google.com/a/chromium.org/forum/#!topic/blink-dev/Drmmb_t4eE8

Design Doc:
https://docs.google.com/document/d/1TG7BzAPdt2DWNOmephxNf09kdzDKYq8l6Z126oSif8I/edit

WICG Thread:
https://discourse.wicg.io/t/sms-otp-retrieval/3499

Bug: 670299

Change-Id: I990c32cf248200277e50ffb127d9828a62ef3a22
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1590392
Reviewed-by: Scott Violet <sky@chromium.org>
Reviewed-by: Reilly Grant <reillyg@chromium.org>
Commit-Queue: Sam Goto <goto@chromium.org>
Cr-Commit-Position: refs/heads/master@{#659305}
2019-05-14 00:30:51 +00:00
Rayan Kanso
3b68620d62 Log web push events to DevTools.
Events recorded: https://docs.google.com/document/d/1OQfT3t5O7SAj0treMIONfgnbpuP8Z9O2GPr54Eqz2Cw/

Bug: 958773
Change-Id: I3b7945e63d6df4fe148ac19ace746391c399d3c5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1605981
Reviewed-by: Peter Beverloo <peter@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Commit-Queue: Rayan Kanso <rayankans@chromium.org>
Cr-Commit-Position: refs/heads/master@{#658642}
2019-05-10 17:41:55 +00:00
Daniel Murphy
d9a41e7bcc [IndexedDB] Small cleanups & refactoring of IndexedDBContext
* Promote SetForceKeepSessionState() from Impl to IndexedDBContext
* Pass IndexedDBContext instead of Impl to
  SaveSessionStateOnIndexedDBThread, avoiding unnecessary casting.
* Allow overriding the clock used by IndexedDBContextImpl

R=pwnall@chromium.org,cmp@chromium.org

Bug: 862456
Change-Id: Ib12d943c77b4944525ad5c9e60e20233a3b957f1
TBR: jam@chromium.org
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1600604
Commit-Queue: Bo <boliu@chromium.org>
Reviewed-by: Bo <boliu@chromium.org>
Reviewed-by: Chase Phillips <cmp@chromium.org>
Reviewed-by: Victor Costan <pwnall@chromium.org>
Auto-Submit: Daniel Murphy <dmurph@chromium.org>
Cr-Commit-Position: refs/heads/master@{#658176}
2019-05-09 17:56:54 +00:00
Nick Harper
099ef1d1c8 Remove the remainder of Channel ID code from Chromium
Bug: 875053
Change-Id: I30a3c0544598208063272ebf87f399553bbd4610
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1595510
Reviewed-by: Matt Menke <mmenke@chromium.org>
Reviewed-by: Sylvain Defresne <sdefresne@chromium.org>
Reviewed-by: Paul Jensen <pauljensen@chromium.org>
Reviewed-by: Sean Topping <seantopping@chromium.org>
Reviewed-by: Wez <wez@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Commit-Queue: Nick Harper <nharper@chromium.org>
Cr-Commit-Position: refs/heads/master@{#657924}
2019-05-08 23:41:32 +00:00
Ken Rockot
40a1df79a4 [service-manager] Delete ServiceFactory interface
Removes the ServiceFactory interface from Service Manager's public API.
Packaged service creation is instead integrated into the main Service
interface with a new CreatePackagedServiceInstance message.

Bug: 925860
Change-Id: I66143f4483856fadc619accf54e279289acef471
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1593977
Reviewed-by: Oksana Zhuravlova <oksamyt@chromium.org>
Reviewed-by: Scott Violet <sky@chromium.org>
Reviewed-by: Eugene But <eugenebut@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Ken Rockot <rockot@google.com>
Cr-Commit-Position: refs/heads/master@{#657888}
2019-05-08 22:15:52 +00:00
Mario Sanchez Prada
d299011118 Move push_messaging_status.mojom from //content/public/common to Blink
We need to move this out of //content and into Blink in order to have
these definitions available to be used from Blink itself, which is
where the communication with //content/browser will happen from once
the whole PushMessaging feature has been Onion Soup'ed.

Bug: 939943
Change-Id: Iae5a41122f82a77b9456ea2a23052313eb112b3d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1591930
Reviewed-by: Colin Blundell <blundell@chromium.org>
Reviewed-by: Dominick Ng <dominickn@chromium.org>
Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Commit-Queue: Mario Sanchez Prada <mario@igalia.com>
Cr-Commit-Position: refs/heads/master@{#657166}
2019-05-07 08:13:49 +00:00
Aaron Colwell
67f93006c1 Revert of http://crrev.com/c/1542475
This change restores the behavior of clearing BrowserContext information
in ChildProcessSecurityPolicyImpl::Remove() instead of in response to
BrowserContext::NotifyWillBeDestroyed(). This is to fix "crashes" in
BlobURLStore::Revoke() that appear to observe the null context in the
brief period between BrowserContext::NotifyWillBeDestroyed() &
ChildProcessSecurityPolicyImpl::Remove() being called.

Note: This is not identical to the original changes because
 |pending_remove_state_| was deleted after this change was landed.

Bug: 948069
Change-Id: I6a5a39529212626138a771fe1cfc75f73e5e240b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1548053
Reviewed-by: Alex Moshchuk <alexmos@chromium.org>
Commit-Queue: Aaron Colwell <acolwell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#646537}
2019-04-01 22:45:28 +00:00
Aaron Colwell
c7532b543b Clear BrowserContext on context destruction instead of Remove().
As part of fixing bug 943887 we need to be able to have SecurityState
live beyond the Remove() call. This change defers clearing the
BrowserContext & ResourceContext in the SecurityState to the moment
when the BrowserContext itself is shutting down. This will make
extending the lifetime of the SecurityState object much easier in
a followup CL.

Bug: 943887
Change-Id: Ia32c938a5a0290edb1d908a797d492a966344c2c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1542475
Auto-Submit: Aaron Colwell <acolwell@chromium.org>
Commit-Queue: Alex Moshchuk <alexmos@chromium.org>
Reviewed-by: Alex Moshchuk <alexmos@chromium.org>
Reviewed-by: Łukasz Anforowicz <lukasza@chromium.org>
Cr-Commit-Position: refs/heads/master@{#645542}
2019-03-28 22:24:39 +00:00
Alex Moshchuk
99b7954248 Implement per-profile isolated origins.
Previously, isolated origins would apply globally for all profiles in
the entire browser.  This CL introduces support for associating
isolated origins with specific BrowserContexts (i.e., profiles):

1. The API for adding new isolated origins,
   ChildProcessSecurityPolicyImpl::AddIsolatedOrigins(), can now take
   a BrowserContext in which the origin should apply.

2. Entries in the map of isolated origins are extended to optionally
   contain the BrowserContext to which they apply.  If this is not
   specified, the corresponding isolated origin still applies globally
   to all profiles.  To facilitate checks on the IO thread, the
   ResourceContext (BrowserContext's representation on the IO thread)
   is also stored in the entry.

3. IsolationContext now also carries profile information (as
   BrowserOrResourceContext), and GetMatchingIsolatedOrigin() consults
   it to see if the profiles match when looking for matching isolated
   origins.  Various tests are updated to pass a proper BrowserContext
   to the IsolationContexts they construct.

Bug: 905513
Change-Id: Iad1fd2ca4ea701f9e088d30fa1b8582de9fbed67
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1497794
Commit-Queue: Alex Moshchuk <alexmos@chromium.org>
Reviewed-by: Łukasz Anforowicz <lukasza@chromium.org>
Cr-Commit-Position: refs/heads/master@{#638360}
2019-03-07 00:27:32 +00:00
liberato@chromium.org
3dcea37a17 Add BrowserFeatureProvider.
This CL adds BrowserFeatureProvider, as a place where we can start
adding common features to the learning framework.  It currently
supports a single feature for the network connection type (wired,
3G, etc.), as an example.  Future CLs will add more.

This CL also updates the MediaCapabilities learning experiment to
include a task that uses the new feature.

Change-Id: I25ecb50c88d6b26b53fe01bbc089d235a8e2ccb4
Reviewed-on: https://chromium-review.googlesource.com/c/1437710
Commit-Queue: Frank Liberato <liberato@chromium.org>
Reviewed-by: Chrome Cunningham <chcunningham@chromium.org>
Reviewed-by: Robert Kaplow <rkaplow@chromium.org>
Reviewed-by: Mihai Sardarescu <msarda@chromium.org>
Reviewed-by: John Abd-El-Malek <jam@chromium.org>
Reviewed-by: Dan Sanders <sandersd@chromium.org>
Cr-Commit-Position: refs/heads/master@{#630883}
2019-02-11 19:46:51 +00:00
Takashi Toyoshima
0190a3b694 OOR-CORS: OffTheRecordProfile support
SharedCorsOriginAccessList was implemented in BrowserContext, and
OffTheRecordProfile didn't share the original profile's access lists
but had own lists. This is not correct, and having a proxy to access
the original lists with read-only permission is what the incognito
mode actually needs.

Also this patch redesigns how we implement the access lists.
Now BrowserContext provides virtual methods to implement the feature
in sub-classes in sub-class specific ways.

IncognitoProfileMainNetworkContext/NetworkContextConfigurationBrowserTest.
ThirdPartyCookiesAllowedForExtensions/{0,1,2} started failing with
--enable-features=OutOfBlinkCors after recent test side changes,
but now they also pass.

Bug: 914968
Change-Id: I39fb604e96ed14cea0b6ff33c4d0be629647e4d1
Reviewed-on: https://chromium-review.googlesource.com/c/1379793
Commit-Queue: Takashi Toyoshima <toyoshim@chromium.org>
Reviewed-by: Jochen Eisinger <jochen@chromium.org>
Reviewed-by: Devlin <rdevlin.cronin@chromium.org>
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Cr-Commit-Position: refs/heads/master@{#624527}
2019-01-21 07:39:06 +00:00
Takuto Ikuta
8332bf9da1 Replace base::hash_set with std::unordered_set
base::hash_set is alias of std::unordered_set now.

I applied following command to make this CL.

$ git grep -l 'base::hash_set' | fgrep -v base/ | xargs sed -i -e 's/base::hash_set/std::unordered_set/g' -e 's/\(#include <[a-z_]*>\)/\1\n#include <unordered_set>/' -e 's/BASE_HASH_NAMESPACE/std/'
$ git cl format

TBR: dcheng@chromium.org
Bug: 576864
Change-Id: I89535173626483c06989b4d8a99dc46c1d49ce7b
Reviewed-on: https://chromium-review.googlesource.com/c/1390887
Commit-Queue: Takuto Ikuta <tikuta@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/master@{#620168}
2019-01-05 03:58:00 +00:00