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

Side by Side Diff: content/browser/storage_partition_impl.cc

Issue 2968293002: Introduce SystemNetworkContextManager. (Closed)
Patch Set: Response to comments 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/storage_partition_impl.h" 5 #include "content/browser/storage_partition_impl.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <set> 9 #include <set>
10 #include <vector> 10 #include <vector>
(...skipping 11 matching lines...) Expand all
22 #include "content/browser/fileapi/browser_file_system_helper.h" 22 #include "content/browser/fileapi/browser_file_system_helper.h"
23 #include "content/browser/gpu/shader_cache_factory.h" 23 #include "content/browser/gpu/shader_cache_factory.h"
24 #include "content/browser/notifications/platform_notification_context_impl.h" 24 #include "content/browser/notifications/platform_notification_context_impl.h"
25 #include "content/common/dom_storage/dom_storage_types.h" 25 #include "content/common/dom_storage/dom_storage_types.h"
26 #include "content/public/browser/browser_context.h" 26 #include "content/public/browser/browser_context.h"
27 #include "content/public/browser/browser_thread.h" 27 #include "content/public/browser/browser_thread.h"
28 #include "content/public/browser/content_browser_client.h" 28 #include "content/public/browser/content_browser_client.h"
29 #include "content/public/browser/dom_storage_context.h" 29 #include "content/public/browser/dom_storage_context.h"
30 #include "content/public/browser/indexed_db_context.h" 30 #include "content/public/browser/indexed_db_context.h"
31 #include "content/public/browser/local_storage_usage_info.h" 31 #include "content/public/browser/local_storage_usage_info.h"
32 #include "content/public/browser/network_service_instance.h"
32 #include "content/public/browser/session_storage_usage_info.h" 33 #include "content/public/browser/session_storage_usage_info.h"
33 #include "content/public/common/content_client.h" 34 #include "content/public/common/content_client.h"
34 #include "content/public/common/content_features.h" 35 #include "content/public/common/content_features.h"
35 #include "content/public/common/content_switches.h" 36 #include "content/public/common/content_switches.h"
36 #include "content/public/common/service_manager_connection.h"
37 #include "content/public/common/service_names.mojom.h"
38 #include "net/base/completion_callback.h" 37 #include "net/base/completion_callback.h"
39 #include "net/base/net_errors.h" 38 #include "net/base/net_errors.h"
40 #include "net/cookies/canonical_cookie.h" 39 #include "net/cookies/canonical_cookie.h"
41 #include "net/cookies/cookie_monster.h" 40 #include "net/cookies/cookie_monster.h"
42 #include "net/url_request/url_request_context.h" 41 #include "net/url_request/url_request_context.h"
43 #include "net/url_request/url_request_context_getter.h" 42 #include "net/url_request/url_request_context_getter.h"
44 #include "ppapi/features/features.h" 43 #include "ppapi/features/features.h"
45 #include "services/service_manager/public/cpp/connector.h"
46 #include "storage/browser/blob/blob_storage_context.h" 44 #include "storage/browser/blob/blob_storage_context.h"
47 #include "storage/browser/database/database_tracker.h" 45 #include "storage/browser/database/database_tracker.h"
48 #include "storage/browser/quota/quota_manager.h" 46 #include "storage/browser/quota/quota_manager.h"
49 47
50 #if !defined(OS_ANDROID) 48 #if !defined(OS_ANDROID)
51 #include "content/browser/host_zoom_map_impl.h" 49 #include "content/browser/host_zoom_map_impl.h"
52 #endif // !defined(OS_ANDROID) 50 #endif // !defined(OS_ANDROID)
53 51
54 #if BUILDFLAG(ENABLE_PLUGINS) 52 #if BUILDFLAG(ENABLE_PLUGINS)
55 #include "content/browser/plugin_private_storage_helper.h" 53 #include "content/browser/plugin_private_storage_helper.h"
(...skipping 468 matching lines...) Expand 10 before | Expand all | Expand 10 after
524 partition->background_sync_context_->Init(partition->service_worker_context_); 522 partition->background_sync_context_->Init(partition->service_worker_context_);
525 523
526 partition->payment_app_context_ = new PaymentAppContextImpl(); 524 partition->payment_app_context_ = new PaymentAppContextImpl();
527 partition->payment_app_context_->Init(partition->service_worker_context_); 525 partition->payment_app_context_->Init(partition->service_worker_context_);
528 526
529 partition->broadcast_channel_provider_ = new BroadcastChannelProvider(); 527 partition->broadcast_channel_provider_ = new BroadcastChannelProvider();
530 528
531 partition->bluetooth_allowed_devices_map_ = new BluetoothAllowedDevicesMap(); 529 partition->bluetooth_allowed_devices_map_ = new BluetoothAllowedDevicesMap();
532 530
533 if (base::FeatureList::IsEnabled(features::kNetworkService)) { 531 if (base::FeatureList::IsEnabled(features::kNetworkService)) {
534 static mojom::NetworkServicePtr* g_network_service =
535 new mojom::NetworkServicePtr;
536 if (!g_network_service->is_bound()) {
537 ServiceManagerConnection::GetForProcess()->GetConnector()->BindInterface(
538 mojom::kNetworkServiceName, g_network_service);
539 }
540 mojom::NetworkContextParamsPtr context_params = 532 mojom::NetworkContextParamsPtr context_params =
541 mojom::NetworkContextParams::New(); 533 mojom::NetworkContextParams::New();
542 // TODO: fill this 534 // TODO: fill this
543 // context_params->cache_dir = 535 // context_params->cache_dir =
544 // context_params->cookie_path = 536 // context_params->cookie_path =
545 (*g_network_service) 537 GetNetworkService()->CreateNetworkContext(
546 ->CreateNetworkContext(MakeRequest(&partition->network_context_), 538 MakeRequest(&partition->network_context_), std::move(context_params));
547 std::move(context_params));
548 539
549 scoped_refptr<ChromeBlobStorageContext> blob_context = 540 scoped_refptr<ChromeBlobStorageContext> blob_context =
550 ChromeBlobStorageContext::GetFor(context); 541 ChromeBlobStorageContext::GetFor(context);
551 BlobURLLoaderFactory::BlobContextGetter blob_getter = 542 BlobURLLoaderFactory::BlobContextGetter blob_getter =
552 base::BindOnce(&BlobStorageContextGetter, blob_context); 543 base::BindOnce(&BlobStorageContextGetter, blob_context);
553 partition->blob_url_loader_factory_ = BlobURLLoaderFactory::Create( 544 partition->blob_url_loader_factory_ = BlobURLLoaderFactory::Create(
554 std::move(blob_getter), partition->filesystem_context_); 545 std::move(blob_getter), partition->filesystem_context_);
555 546
556 partition->url_loader_factory_getter_ = new URLLoaderFactoryGetter(); 547 partition->url_loader_factory_getter_ = new URLLoaderFactoryGetter();
557 partition->url_loader_factory_getter_->Initialize(partition.get()); 548 partition->url_loader_factory_getter_->Initialize(partition.get());
(...skipping 432 matching lines...) Expand 10 before | Expand all | Expand 10 after
990 media_url_request_context_ = media_url_request_context; 981 media_url_request_context_ = media_url_request_context;
991 } 982 }
992 983
993 void StoragePartitionImpl::GetQuotaSettings( 984 void StoragePartitionImpl::GetQuotaSettings(
994 storage::OptionalQuotaSettingsCallback callback) { 985 storage::OptionalQuotaSettingsCallback callback) {
995 GetContentClient()->browser()->GetQuotaSettings(browser_context_, this, 986 GetContentClient()->browser()->GetQuotaSettings(browser_context_, this,
996 std::move(callback)); 987 std::move(callback));
997 } 988 }
998 989
999 } // namespace content 990 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698