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

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

Issue 861373002: Refactor navigator.connect code to make it more flexible. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix typo Created 5 years, 10 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/storage_partition_impl_map.cc » ('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 "base/sequenced_task_runner.h" 7 #include "base/sequenced_task_runner.h"
8 #include "base/strings/utf_string_conversions.h" 8 #include "base/strings/utf_string_conversions.h"
9 #include "content/browser/browser_main_loop.h" 9 #include "content/browser/browser_main_loop.h"
10 #include "content/browser/fileapi/browser_file_system_helper.h" 10 #include "content/browser/fileapi/browser_file_system_helper.h"
11 #include "content/browser/geofencing/geofencing_manager.h" 11 #include "content/browser/geofencing/geofencing_manager.h"
12 #include "content/browser/gpu/shader_disk_cache.h" 12 #include "content/browser/gpu/shader_disk_cache.h"
13 #include "content/browser/host_zoom_map_impl.h" 13 #include "content/browser/host_zoom_map_impl.h"
14 #include "content/browser/navigator_connect/navigator_connect_context.h" 14 #include "content/browser/navigator_connect/navigator_connect_context_impl.h"
15 #include "content/browser/navigator_connect/navigator_connect_service_worker_ser vice_factory.h"
15 #include "content/common/dom_storage/dom_storage_types.h" 16 #include "content/common/dom_storage/dom_storage_types.h"
16 #include "content/public/browser/browser_context.h" 17 #include "content/public/browser/browser_context.h"
17 #include "content/public/browser/browser_thread.h" 18 #include "content/public/browser/browser_thread.h"
18 #include "content/public/browser/dom_storage_context.h" 19 #include "content/public/browser/dom_storage_context.h"
19 #include "content/public/browser/indexed_db_context.h" 20 #include "content/public/browser/indexed_db_context.h"
20 #include "content/public/browser/local_storage_usage_info.h" 21 #include "content/public/browser/local_storage_usage_info.h"
21 #include "content/public/browser/session_storage_usage_info.h" 22 #include "content/public/browser/session_storage_usage_info.h"
22 #include "net/base/completion_callback.h" 23 #include "net/base/completion_callback.h"
23 #include "net/base/net_errors.h" 24 #include "net/base/net_errors.h"
24 #include "net/cookies/cookie_monster.h" 25 #include "net/cookies/cookie_monster.h"
(...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after
366 ChromeAppCacheService* appcache_service, 367 ChromeAppCacheService* appcache_service,
367 storage::FileSystemContext* filesystem_context, 368 storage::FileSystemContext* filesystem_context,
368 storage::DatabaseTracker* database_tracker, 369 storage::DatabaseTracker* database_tracker,
369 DOMStorageContextWrapper* dom_storage_context, 370 DOMStorageContextWrapper* dom_storage_context,
370 IndexedDBContextImpl* indexed_db_context, 371 IndexedDBContextImpl* indexed_db_context,
371 ServiceWorkerContextWrapper* service_worker_context, 372 ServiceWorkerContextWrapper* service_worker_context,
372 WebRTCIdentityStore* webrtc_identity_store, 373 WebRTCIdentityStore* webrtc_identity_store,
373 storage::SpecialStoragePolicy* special_storage_policy, 374 storage::SpecialStoragePolicy* special_storage_policy,
374 GeofencingManager* geofencing_manager, 375 GeofencingManager* geofencing_manager,
375 HostZoomLevelContext* host_zoom_level_context, 376 HostZoomLevelContext* host_zoom_level_context,
376 NavigatorConnectContext* navigator_connect_context) 377 NavigatorConnectContextImpl* navigator_connect_context)
377 : partition_path_(partition_path), 378 : partition_path_(partition_path),
378 quota_manager_(quota_manager), 379 quota_manager_(quota_manager),
379 appcache_service_(appcache_service), 380 appcache_service_(appcache_service),
380 filesystem_context_(filesystem_context), 381 filesystem_context_(filesystem_context),
381 database_tracker_(database_tracker), 382 database_tracker_(database_tracker),
382 dom_storage_context_(dom_storage_context), 383 dom_storage_context_(dom_storage_context),
383 indexed_db_context_(indexed_db_context), 384 indexed_db_context_(indexed_db_context),
384 service_worker_context_(service_worker_context), 385 service_worker_context_(service_worker_context),
385 webrtc_identity_store_(webrtc_identity_store), 386 webrtc_identity_store_(webrtc_identity_store),
386 special_storage_policy_(special_storage_policy), 387 special_storage_policy_(special_storage_policy),
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
483 context->GetSpecialStoragePolicy()); 484 context->GetSpecialStoragePolicy());
484 485
485 scoped_refptr<GeofencingManager> geofencing_manager = 486 scoped_refptr<GeofencingManager> geofencing_manager =
486 new GeofencingManager(service_worker_context); 487 new GeofencingManager(service_worker_context);
487 geofencing_manager->Init(); 488 geofencing_manager->Init();
488 489
489 scoped_refptr<HostZoomLevelContext> host_zoom_level_context( 490 scoped_refptr<HostZoomLevelContext> host_zoom_level_context(
490 new HostZoomLevelContext( 491 new HostZoomLevelContext(
491 context->CreateZoomLevelDelegate(partition_path))); 492 context->CreateZoomLevelDelegate(partition_path)));
492 493
493 scoped_refptr<NavigatorConnectContext> navigator_connect_context = 494 scoped_refptr<NavigatorConnectContextImpl> navigator_connect_context =
494 new NavigatorConnectContext(service_worker_context); 495 new NavigatorConnectContextImpl();
496 navigator_connect_context->AddFactory(make_scoped_ptr(
497 new NavigatorConnectServiceWorkerServiceFactory(service_worker_context)));
495 498
496 StoragePartitionImpl* storage_partition = new StoragePartitionImpl( 499 StoragePartitionImpl* storage_partition = new StoragePartitionImpl(
497 context, partition_path, quota_manager.get(), appcache_service.get(), 500 context, partition_path, quota_manager.get(), appcache_service.get(),
498 filesystem_context.get(), database_tracker.get(), 501 filesystem_context.get(), database_tracker.get(),
499 dom_storage_context.get(), indexed_db_context.get(), 502 dom_storage_context.get(), indexed_db_context.get(),
500 service_worker_context.get(), webrtc_identity_store.get(), 503 service_worker_context.get(), webrtc_identity_store.get(),
501 special_storage_policy.get(), geofencing_manager.get(), 504 special_storage_policy.get(), geofencing_manager.get(),
502 host_zoom_level_context.get(), navigator_connect_context.get()); 505 host_zoom_level_context.get(), navigator_connect_context.get());
503 506
504 service_worker_context->set_storage_partition(storage_partition); 507 service_worker_context->set_storage_partition(storage_partition);
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
558 561
559 HostZoomLevelContext* StoragePartitionImpl::GetHostZoomLevelContext() { 562 HostZoomLevelContext* StoragePartitionImpl::GetHostZoomLevelContext() {
560 return host_zoom_level_context_.get(); 563 return host_zoom_level_context_.get();
561 } 564 }
562 565
563 ZoomLevelDelegate* StoragePartitionImpl::GetZoomLevelDelegate() { 566 ZoomLevelDelegate* StoragePartitionImpl::GetZoomLevelDelegate() {
564 DCHECK(host_zoom_level_context_.get()); 567 DCHECK(host_zoom_level_context_.get());
565 return host_zoom_level_context_->GetZoomLevelDelegate(); 568 return host_zoom_level_context_->GetZoomLevelDelegate();
566 } 569 }
567 570
568 NavigatorConnectContext* StoragePartitionImpl::GetNavigatorConnectContext() { 571 NavigatorConnectContextImpl*
572 StoragePartitionImpl::GetNavigatorConnectContext() {
569 return navigator_connect_context_.get(); 573 return navigator_connect_context_.get();
570 } 574 }
571 575
572 void StoragePartitionImpl::ClearDataImpl( 576 void StoragePartitionImpl::ClearDataImpl(
573 uint32 remove_mask, 577 uint32 remove_mask,
574 uint32 quota_storage_remove_mask, 578 uint32 quota_storage_remove_mask,
575 const GURL& storage_origin, 579 const GURL& storage_origin,
576 const OriginMatcherFunction& origin_matcher, 580 const OriginMatcherFunction& origin_matcher,
577 net::URLRequestContextGetter* rq_context, 581 net::URLRequestContextGetter* rq_context,
578 const base::Time begin, 582 const base::Time begin,
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after
877 net::URLRequestContextGetter* url_request_context) { 881 net::URLRequestContextGetter* url_request_context) {
878 url_request_context_ = url_request_context; 882 url_request_context_ = url_request_context;
879 } 883 }
880 884
881 void StoragePartitionImpl::SetMediaURLRequestContext( 885 void StoragePartitionImpl::SetMediaURLRequestContext(
882 net::URLRequestContextGetter* media_url_request_context) { 886 net::URLRequestContextGetter* media_url_request_context) {
883 media_url_request_context_ = media_url_request_context; 887 media_url_request_context_ = media_url_request_context;
884 } 888 }
885 889
886 } // namespace content 890 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/storage_partition_impl.h ('k') | content/browser/storage_partition_impl_map.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698