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

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

Issue 2874163004: Add support in the network service for different contexts. (Closed)
Patch Set: review comment and clang fixes Created 3 years, 7 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
« no previous file with comments | « content/browser/storage_partition_impl.h ('k') | content/browser/url_loader_factory_getter.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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>
11 11
12 #include "base/bind.h" 12 #include "base/bind.h"
13 #include "base/command_line.h"
13 #include "base/location.h" 14 #include "base/location.h"
14 #include "base/sequenced_task_runner.h" 15 #include "base/sequenced_task_runner.h"
15 #include "base/single_thread_task_runner.h" 16 #include "base/single_thread_task_runner.h"
16 #include "base/strings/utf_string_conversions.h" 17 #include "base/strings/utf_string_conversions.h"
17 #include "content/browser/browser_main_loop.h" 18 #include "content/browser/browser_main_loop.h"
18 #include "content/browser/browsing_data/storage_partition_http_cache_data_remove r.h" 19 #include "content/browser/browsing_data/storage_partition_http_cache_data_remove r.h"
19 #include "content/browser/fileapi/browser_file_system_helper.h" 20 #include "content/browser/fileapi/browser_file_system_helper.h"
20 #include "content/browser/gpu/shader_cache_factory.h" 21 #include "content/browser/gpu/shader_cache_factory.h"
21 #include "content/browser/host_zoom_map_impl.h" 22 #include "content/browser/host_zoom_map_impl.h"
22 #include "content/browser/notifications/platform_notification_context_impl.h" 23 #include "content/browser/notifications/platform_notification_context_impl.h"
23 #include "content/common/dom_storage/dom_storage_types.h" 24 #include "content/common/dom_storage/dom_storage_types.h"
24 #include "content/public/browser/browser_context.h" 25 #include "content/public/browser/browser_context.h"
25 #include "content/public/browser/browser_thread.h" 26 #include "content/public/browser/browser_thread.h"
26 #include "content/public/browser/content_browser_client.h" 27 #include "content/public/browser/content_browser_client.h"
27 #include "content/public/browser/dom_storage_context.h" 28 #include "content/public/browser/dom_storage_context.h"
28 #include "content/public/browser/indexed_db_context.h" 29 #include "content/public/browser/indexed_db_context.h"
29 #include "content/public/browser/local_storage_usage_info.h" 30 #include "content/public/browser/local_storage_usage_info.h"
30 #include "content/public/browser/session_storage_usage_info.h" 31 #include "content/public/browser/session_storage_usage_info.h"
31 #include "content/public/common/content_client.h" 32 #include "content/public/common/content_client.h"
33 #include "content/public/common/content_switches.h"
34 #include "content/public/common/service_manager_connection.h"
35 #include "content/public/common/service_names.mojom.h"
32 #include "net/base/completion_callback.h" 36 #include "net/base/completion_callback.h"
33 #include "net/base/net_errors.h" 37 #include "net/base/net_errors.h"
34 #include "net/cookies/canonical_cookie.h" 38 #include "net/cookies/canonical_cookie.h"
35 #include "net/cookies/cookie_monster.h" 39 #include "net/cookies/cookie_monster.h"
36 #include "net/url_request/url_request_context.h" 40 #include "net/url_request/url_request_context.h"
37 #include "net/url_request/url_request_context_getter.h" 41 #include "net/url_request/url_request_context_getter.h"
38 #include "ppapi/features/features.h" 42 #include "ppapi/features/features.h"
43 #include "services/service_manager/public/cpp/connector.h"
39 #include "storage/browser/database/database_tracker.h" 44 #include "storage/browser/database/database_tracker.h"
40 #include "storage/browser/quota/quota_manager.h" 45 #include "storage/browser/quota/quota_manager.h"
41 46
42 #if BUILDFLAG(ENABLE_PLUGINS) 47 #if BUILDFLAG(ENABLE_PLUGINS)
43 #include "content/browser/plugin_private_storage_helper.h" 48 #include "content/browser/plugin_private_storage_helper.h"
44 #endif // BUILDFLAG(ENABLE_PLUGINS) 49 #endif // BUILDFLAG(ENABLE_PLUGINS)
45 50
46 namespace content { 51 namespace content {
47 52
48 namespace { 53 namespace {
(...skipping 450 matching lines...) Expand 10 before | Expand all | Expand 10 after
499 partition->background_sync_context_ = new BackgroundSyncContext(); 504 partition->background_sync_context_ = new BackgroundSyncContext();
500 partition->background_sync_context_->Init(partition->service_worker_context_); 505 partition->background_sync_context_->Init(partition->service_worker_context_);
501 506
502 partition->payment_app_context_ = new PaymentAppContextImpl(); 507 partition->payment_app_context_ = new PaymentAppContextImpl();
503 partition->payment_app_context_->Init(partition->service_worker_context_); 508 partition->payment_app_context_->Init(partition->service_worker_context_);
504 509
505 partition->broadcast_channel_provider_ = new BroadcastChannelProvider(); 510 partition->broadcast_channel_provider_ = new BroadcastChannelProvider();
506 511
507 partition->bluetooth_allowed_devices_map_ = new BluetoothAllowedDevicesMap(); 512 partition->bluetooth_allowed_devices_map_ = new BluetoothAllowedDevicesMap();
508 513
514 if (base::CommandLine::ForCurrentProcess()->HasSwitch(
515 switches::kEnableNetworkService)) {
516 mojom::NetworkServicePtr network_service;
517 ServiceManagerConnection::GetForProcess()->GetConnector()->BindInterface(
518 mojom::kNetworkServiceName, &network_service);
519 mojom::NetworkContextParamsPtr context_params =
520 mojom::NetworkContextParams::New();
521 // TODO: fill this
522 // context_params->cache_dir =
523 // context_params->cookie_path =
524 network_service->CreateNetworkContext(
525 MakeRequest(&partition->network_context_), std::move(context_params));
526
527 partition->url_loader_factory_getter_ = new URLLoaderFactoryGetter();
528 mojom::URLLoaderFactoryPtr network_factory;
529 partition->network_context_->CreateURLLoaderFactory(
530 MakeRequest(&network_factory), 0);
531 partition->url_loader_factory_getter_->Initialize(
532 std::move(network_factory));
533 }
534
509 return partition; 535 return partition;
510 } 536 }
511 537
512 base::FilePath StoragePartitionImpl::GetPath() { 538 base::FilePath StoragePartitionImpl::GetPath() {
513 return partition_path_; 539 return partition_path_;
514 } 540 }
515 541
516 net::URLRequestContextGetter* StoragePartitionImpl::GetURLRequestContext() { 542 net::URLRequestContextGetter* StoragePartitionImpl::GetURLRequestContext() {
517 return url_request_context_.get(); 543 return url_request_context_.get();
518 } 544 }
(...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after
933 media_url_request_context_ = media_url_request_context; 959 media_url_request_context_ = media_url_request_context;
934 } 960 }
935 961
936 void StoragePartitionImpl::GetQuotaSettings( 962 void StoragePartitionImpl::GetQuotaSettings(
937 const storage::OptionalQuotaSettingsCallback& callback) { 963 const storage::OptionalQuotaSettingsCallback& callback) {
938 GetContentClient()->browser()->GetQuotaSettings(browser_context_, this, 964 GetContentClient()->browser()->GetQuotaSettings(browser_context_, this,
939 callback); 965 callback);
940 } 966 }
941 967
942 } // namespace content 968 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/storage_partition_impl.h ('k') | content/browser/url_loader_factory_getter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698