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

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

Issue 2004643002: Implement BroadcastChannel (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: try to fix ios gyp build Created 4 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 357 matching lines...) Expand 10 before | Expand all | Expand 10 after
368 storage::FileSystemContext* filesystem_context, 368 storage::FileSystemContext* filesystem_context,
369 storage::DatabaseTracker* database_tracker, 369 storage::DatabaseTracker* database_tracker,
370 DOMStorageContextWrapper* dom_storage_context, 370 DOMStorageContextWrapper* dom_storage_context,
371 IndexedDBContextImpl* indexed_db_context, 371 IndexedDBContextImpl* indexed_db_context,
372 CacheStorageContextImpl* cache_storage_context, 372 CacheStorageContextImpl* cache_storage_context,
373 ServiceWorkerContextWrapper* service_worker_context, 373 ServiceWorkerContextWrapper* service_worker_context,
374 WebRTCIdentityStore* webrtc_identity_store, 374 WebRTCIdentityStore* webrtc_identity_store,
375 storage::SpecialStoragePolicy* special_storage_policy, 375 storage::SpecialStoragePolicy* special_storage_policy,
376 HostZoomLevelContext* host_zoom_level_context, 376 HostZoomLevelContext* host_zoom_level_context,
377 PlatformNotificationContextImpl* platform_notification_context, 377 PlatformNotificationContextImpl* platform_notification_context,
378 BackgroundSyncContext* background_sync_context) 378 BackgroundSyncContext* background_sync_context,
379 webmessaging::BroadcastChannelProvider* broadcast_channel_provider)
379 : partition_path_(partition_path), 380 : partition_path_(partition_path),
380 quota_manager_(quota_manager), 381 quota_manager_(quota_manager),
381 appcache_service_(appcache_service), 382 appcache_service_(appcache_service),
382 filesystem_context_(filesystem_context), 383 filesystem_context_(filesystem_context),
383 database_tracker_(database_tracker), 384 database_tracker_(database_tracker),
384 dom_storage_context_(dom_storage_context), 385 dom_storage_context_(dom_storage_context),
385 indexed_db_context_(indexed_db_context), 386 indexed_db_context_(indexed_db_context),
386 cache_storage_context_(cache_storage_context), 387 cache_storage_context_(cache_storage_context),
387 service_worker_context_(service_worker_context), 388 service_worker_context_(service_worker_context),
388 webrtc_identity_store_(webrtc_identity_store), 389 webrtc_identity_store_(webrtc_identity_store),
389 special_storage_policy_(special_storage_policy), 390 special_storage_policy_(special_storage_policy),
390 host_zoom_level_context_(host_zoom_level_context), 391 host_zoom_level_context_(host_zoom_level_context),
391 platform_notification_context_(platform_notification_context), 392 platform_notification_context_(platform_notification_context),
392 background_sync_context_(background_sync_context), 393 background_sync_context_(background_sync_context),
393 browser_context_(browser_context) { 394 broadcast_channel_provider_(broadcast_channel_provider),
394 } 395 browser_context_(browser_context) {}
395 396
396 StoragePartitionImpl::~StoragePartitionImpl() { 397 StoragePartitionImpl::~StoragePartitionImpl() {
397 browser_context_ = nullptr; 398 browser_context_ = nullptr;
398 399
399 // These message loop checks are just to avoid leaks in unittests. 400 // These message loop checks are just to avoid leaks in unittests.
400 if (GetDatabaseTracker() && 401 if (GetDatabaseTracker() &&
401 BrowserThread::IsMessageLoopValid(BrowserThread::FILE)) { 402 BrowserThread::IsMessageLoopValid(BrowserThread::FILE)) {
402 BrowserThread::PostTask( 403 BrowserThread::PostTask(
403 BrowserThread::FILE, 404 BrowserThread::FILE,
404 FROM_HERE, 405 FROM_HERE,
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
510 511
511 scoped_refptr<PlatformNotificationContextImpl> platform_notification_context = 512 scoped_refptr<PlatformNotificationContextImpl> platform_notification_context =
512 new PlatformNotificationContextImpl(path, context, 513 new PlatformNotificationContextImpl(path, context,
513 service_worker_context); 514 service_worker_context);
514 platform_notification_context->Initialize(); 515 platform_notification_context->Initialize();
515 516
516 scoped_refptr<BackgroundSyncContext> background_sync_context = 517 scoped_refptr<BackgroundSyncContext> background_sync_context =
517 new BackgroundSyncContext(); 518 new BackgroundSyncContext();
518 background_sync_context->Init(service_worker_context); 519 background_sync_context->Init(service_worker_context);
519 520
521 scoped_refptr<webmessaging::BroadcastChannelProvider>
522 broadcast_channel_provider = new webmessaging::BroadcastChannelProvider();
523
520 StoragePartitionImpl* storage_partition = new StoragePartitionImpl( 524 StoragePartitionImpl* storage_partition = new StoragePartitionImpl(
521 context, partition_path, quota_manager.get(), appcache_service.get(), 525 context, partition_path, quota_manager.get(), appcache_service.get(),
522 filesystem_context.get(), database_tracker.get(), 526 filesystem_context.get(), database_tracker.get(),
523 dom_storage_context.get(), indexed_db_context.get(), 527 dom_storage_context.get(), indexed_db_context.get(),
524 cache_storage_context.get(), service_worker_context.get(), 528 cache_storage_context.get(), service_worker_context.get(),
525 webrtc_identity_store.get(), special_storage_policy.get(), 529 webrtc_identity_store.get(), special_storage_policy.get(),
526 host_zoom_level_context.get(), platform_notification_context.get(), 530 host_zoom_level_context.get(), platform_notification_context.get(),
527 background_sync_context.get()); 531 background_sync_context.get(), broadcast_channel_provider.get());
528 532
529 service_worker_context->set_storage_partition(storage_partition); 533 service_worker_context->set_storage_partition(storage_partition);
530 534
531 return storage_partition; 535 return storage_partition;
532 } 536 }
533 537
534 base::FilePath StoragePartitionImpl::GetPath() { 538 base::FilePath StoragePartitionImpl::GetPath() {
535 return partition_path_; 539 return partition_path_;
536 } 540 }
537 541
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
592 596
593 PlatformNotificationContextImpl* 597 PlatformNotificationContextImpl*
594 StoragePartitionImpl::GetPlatformNotificationContext() { 598 StoragePartitionImpl::GetPlatformNotificationContext() {
595 return platform_notification_context_.get(); 599 return platform_notification_context_.get();
596 } 600 }
597 601
598 BackgroundSyncContext* StoragePartitionImpl::GetBackgroundSyncContext() { 602 BackgroundSyncContext* StoragePartitionImpl::GetBackgroundSyncContext() {
599 return background_sync_context_.get(); 603 return background_sync_context_.get();
600 } 604 }
601 605
606 webmessaging::BroadcastChannelProvider*
607 StoragePartitionImpl::GetBroadcastChannelProvider() {
608 return broadcast_channel_provider_.get();
609 }
610
602 void StoragePartitionImpl::OpenLocalStorage( 611 void StoragePartitionImpl::OpenLocalStorage(
603 const url::Origin& origin, 612 const url::Origin& origin,
604 mojom::LevelDBObserverPtr observer, 613 mojom::LevelDBObserverPtr observer,
605 mojo::InterfaceRequest<mojom::LevelDBWrapper> request) { 614 mojo::InterfaceRequest<mojom::LevelDBWrapper> request) {
606 dom_storage_context_->OpenLocalStorage( 615 dom_storage_context_->OpenLocalStorage(
607 origin, std::move(observer), std::move(request)); 616 origin, std::move(observer), std::move(request));
608 } 617 }
609 618
610 void StoragePartitionImpl::ClearDataImpl( 619 void StoragePartitionImpl::ClearDataImpl(
611 uint32_t remove_mask, 620 uint32_t remove_mask,
(...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after
932 net::URLRequestContextGetter* url_request_context) { 941 net::URLRequestContextGetter* url_request_context) {
933 url_request_context_ = url_request_context; 942 url_request_context_ = url_request_context;
934 } 943 }
935 944
936 void StoragePartitionImpl::SetMediaURLRequestContext( 945 void StoragePartitionImpl::SetMediaURLRequestContext(
937 net::URLRequestContextGetter* media_url_request_context) { 946 net::URLRequestContextGetter* media_url_request_context) {
938 media_url_request_context_ = media_url_request_context; 947 media_url_request_context_ = media_url_request_context;
939 } 948 }
940 949
941 } // namespace content 950 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698