Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1358)

Unified Diff: content/browser/storage_partition_impl.cc

Issue 2976323002: Hook up ProfileIOData's URLRequestContext to a NetworkService. (Closed)
Patch Set: X11 is bonkers Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/browser/storage_partition_impl.cc
diff --git a/content/browser/storage_partition_impl.cc b/content/browser/storage_partition_impl.cc
index 32a960d4ae61f397293b9a8a35cefe43e8604910..9b25699c18e2b141f707af3c568ffc772c9c5506 100644
--- a/content/browser/storage_partition_impl.cc
+++ b/content/browser/storage_partition_impl.cc
@@ -30,7 +30,6 @@
#include "content/public/browser/dom_storage_context.h"
#include "content/public/browser/indexed_db_context.h"
#include "content/public/browser/local_storage_usage_info.h"
-#include "content/public/browser/network_service_instance.h"
#include "content/public/browser/session_storage_usage_info.h"
#include "content/public/common/content_client.h"
#include "content/public/common/content_features.h"
@@ -514,13 +513,16 @@ std::unique_ptr<StoragePartitionImpl> StoragePartitionImpl::Create(
ChromeBlobStorageContext::GetFor(context);
if (base::FeatureList::IsEnabled(features::kNetworkService)) {
- mojom::NetworkContextParamsPtr context_params =
- mojom::NetworkContextParams::New();
- // TODO: fill this
- // context_params->cache_dir =
- // context_params->cookie_path =
- GetNetworkService()->CreateNetworkContext(
- MakeRequest(&partition->network_context_), std::move(context_params));
+ if (relative_partition_path.empty()) {
+ partition->network_context_ =
+ GetContentClient()->browser()->CreateMainNetworkContext(context);
+ } else {
+ partition->network_context_ =
+ GetContentClient()
+ ->browser()
+ ->CreateNetworkContextForStoragePartition(context, in_memory,
+ partition_path);
+ }
BlobURLLoaderFactory::BlobContextGetter blob_getter =
base::BindOnce(&BlobStorageContextGetter, blob_context);
@@ -556,6 +558,11 @@ StoragePartitionImpl::GetMediaURLRequestContext() {
return media_url_request_context_.get();
}
+mojom::NetworkContext* StoragePartitionImpl::GetNetworkContext() {
+ DCHECK(base::FeatureList::IsEnabled(features::kNetworkService));
+ return network_context_.get();
+}
+
storage::QuotaManager* StoragePartitionImpl::GetQuotaManager() {
return quota_manager_.get();
}

Powered by Google App Engine
This is Rietveld 408576698