2651385: Moving Profile::shared_cors_origin_access_list_ into //content layer.

https://chromium-review.googlesource.com/c/chromium/src/+/2651385
This commit is contained in:
John Kleinschmidt 2021-03-15 21:45:19 -04:00
parent 08036802cb
commit 676f74f3dc
2 changed files with 0 additions and 40 deletions

View file

@ -433,34 +433,6 @@ ElectronBrowserContext::GetStorageNotificationService() {
return nullptr;
}
void ElectronBrowserContext::SetCorsOriginAccessListForOrigin(
TargetBrowserContexts target_mode,
const url::Origin& source_origin,
std::vector<network::mojom::CorsOriginPatternPtr> allow_patterns,
std::vector<network::mojom::CorsOriginPatternPtr> block_patterns,
base::OnceClosure closure) {
using content::CorsOriginPatternSetter;
// We ignore target_mode because we don't support extensions in in-memory
// sessions.
auto barrier_closure = BarrierClosure(2, std::move(closure));
base::MakeRefCounted<CorsOriginPatternSetter>(
source_origin, CorsOriginPatternSetter::ClonePatterns(allow_patterns),
CorsOriginPatternSetter::ClonePatterns(block_patterns), barrier_closure)
->ApplyToEachStoragePartition(this);
// Keep the per-profile access list up to date so that we can use this to
// restore NetworkContext settings at anytime, e.g. on restarting the
// network service.
shared_cors_origin_access_list_->SetForOrigin(
source_origin, std::move(allow_patterns), std::move(block_patterns),
barrier_closure);
}
content::SharedCorsOriginAccessList*
ElectronBrowserContext::GetSharedCorsOriginAccessList() {
return shared_cors_origin_access_list_.get();
}
ResolveProxyHelper* ElectronBrowserContext::GetResolveProxyHelper() {
if (!resolve_proxy_helper_) {
resolve_proxy_helper_ = base::MakeRefCounted<ResolveProxyHelper>(this);

View file

@ -113,15 +113,6 @@ class ElectronBrowserContext
override;
content::StorageNotificationService* GetStorageNotificationService() override;
// extensions deps
void SetCorsOriginAccessListForOrigin(
TargetBrowserContexts target_mode,
const url::Origin& source_origin,
std::vector<network::mojom::CorsOriginPatternPtr> allow_patterns,
std::vector<network::mojom::CorsOriginPatternPtr> block_patterns,
base::OnceClosure closure) override;
content::SharedCorsOriginAccessList* GetSharedCorsOriginAccessList() override;
CookieChangeNotifier* cookie_change_notifier() const {
return cookie_change_notifier_.get();
}
@ -199,9 +190,6 @@ class ElectronBrowserContext
network::mojom::SSLConfigPtr ssl_config_;
mojo::Remote<network::mojom::SSLConfigClient> ssl_config_client_;
scoped_refptr<content::SharedCorsOriginAccessList>
shared_cors_origin_access_list_;
base::WeakPtrFactory<ElectronBrowserContext> weak_factory_{this};
DISALLOW_COPY_AND_ASSIGN(ElectronBrowserContext);