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

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: address dcheng's comments 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
« no previous file with comments | « content/browser/storage_partition_impl.h ('k') | content/content_browser.gypi » ('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>
(...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 scoped_refptr<webmessaging::BroadcastChannelProvider>
380 broadcast_channel_provider)
379 : partition_path_(partition_path), 381 : partition_path_(partition_path),
380 quota_manager_(quota_manager), 382 quota_manager_(quota_manager),
381 appcache_service_(appcache_service), 383 appcache_service_(appcache_service),
382 filesystem_context_(filesystem_context), 384 filesystem_context_(filesystem_context),
383 database_tracker_(database_tracker), 385 database_tracker_(database_tracker),
384 dom_storage_context_(dom_storage_context), 386 dom_storage_context_(dom_storage_context),
385 indexed_db_context_(indexed_db_context), 387 indexed_db_context_(indexed_db_context),
386 cache_storage_context_(cache_storage_context), 388 cache_storage_context_(cache_storage_context),
387 service_worker_context_(service_worker_context), 389 service_worker_context_(service_worker_context),
388 webrtc_identity_store_(webrtc_identity_store), 390 webrtc_identity_store_(webrtc_identity_store),
389 special_storage_policy_(special_storage_policy), 391 special_storage_policy_(special_storage_policy),
390 host_zoom_level_context_(host_zoom_level_context), 392 host_zoom_level_context_(host_zoom_level_context),
391 platform_notification_context_(platform_notification_context), 393 platform_notification_context_(platform_notification_context),
392 background_sync_context_(background_sync_context), 394 background_sync_context_(background_sync_context),
393 browser_context_(browser_context) { 395 broadcast_channel_provider_(std::move(broadcast_channel_provider)),
394 } 396 browser_context_(browser_context) {}
395 397
396 StoragePartitionImpl::~StoragePartitionImpl() { 398 StoragePartitionImpl::~StoragePartitionImpl() {
397 browser_context_ = nullptr; 399 browser_context_ = nullptr;
398 400
399 // These message loop checks are just to avoid leaks in unittests. 401 // These message loop checks are just to avoid leaks in unittests.
400 if (GetDatabaseTracker() && 402 if (GetDatabaseTracker() &&
401 BrowserThread::IsMessageLoopValid(BrowserThread::FILE)) { 403 BrowserThread::IsMessageLoopValid(BrowserThread::FILE)) {
402 BrowserThread::PostTask( 404 BrowserThread::PostTask(
403 BrowserThread::FILE, 405 BrowserThread::FILE,
404 FROM_HERE, 406 FROM_HERE,
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
510 512
511 scoped_refptr<PlatformNotificationContextImpl> platform_notification_context = 513 scoped_refptr<PlatformNotificationContextImpl> platform_notification_context =
512 new PlatformNotificationContextImpl(path, context, 514 new PlatformNotificationContextImpl(path, context,
513 service_worker_context); 515 service_worker_context);
514 platform_notification_context->Initialize(); 516 platform_notification_context->Initialize();
515 517
516 scoped_refptr<BackgroundSyncContext> background_sync_context = 518 scoped_refptr<BackgroundSyncContext> background_sync_context =
517 new BackgroundSyncContext(); 519 new BackgroundSyncContext();
518 background_sync_context->Init(service_worker_context); 520 background_sync_context->Init(service_worker_context);
519 521
522 scoped_refptr<webmessaging::BroadcastChannelProvider>
523 broadcast_channel_provider = new webmessaging::BroadcastChannelProvider();
524
520 StoragePartitionImpl* storage_partition = new StoragePartitionImpl( 525 StoragePartitionImpl* storage_partition = new StoragePartitionImpl(
521 context, partition_path, quota_manager.get(), appcache_service.get(), 526 context, partition_path, quota_manager.get(), appcache_service.get(),
522 filesystem_context.get(), database_tracker.get(), 527 filesystem_context.get(), database_tracker.get(),
523 dom_storage_context.get(), indexed_db_context.get(), 528 dom_storage_context.get(), indexed_db_context.get(),
524 cache_storage_context.get(), service_worker_context.get(), 529 cache_storage_context.get(), service_worker_context.get(),
525 webrtc_identity_store.get(), special_storage_policy.get(), 530 webrtc_identity_store.get(), special_storage_policy.get(),
526 host_zoom_level_context.get(), platform_notification_context.get(), 531 host_zoom_level_context.get(), platform_notification_context.get(),
527 background_sync_context.get()); 532 background_sync_context.get(), std::move(broadcast_channel_provider));
528 533
529 service_worker_context->set_storage_partition(storage_partition); 534 service_worker_context->set_storage_partition(storage_partition);
530 535
531 return storage_partition; 536 return storage_partition;
532 } 537 }
533 538
534 base::FilePath StoragePartitionImpl::GetPath() { 539 base::FilePath StoragePartitionImpl::GetPath() {
535 return partition_path_; 540 return partition_path_;
536 } 541 }
537 542
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
592 597
593 PlatformNotificationContextImpl* 598 PlatformNotificationContextImpl*
594 StoragePartitionImpl::GetPlatformNotificationContext() { 599 StoragePartitionImpl::GetPlatformNotificationContext() {
595 return platform_notification_context_.get(); 600 return platform_notification_context_.get();
596 } 601 }
597 602
598 BackgroundSyncContext* StoragePartitionImpl::GetBackgroundSyncContext() { 603 BackgroundSyncContext* StoragePartitionImpl::GetBackgroundSyncContext() {
599 return background_sync_context_.get(); 604 return background_sync_context_.get();
600 } 605 }
601 606
607 webmessaging::BroadcastChannelProvider*
608 StoragePartitionImpl::GetBroadcastChannelProvider() {
609 return broadcast_channel_provider_.get();
610 }
611
602 void StoragePartitionImpl::OpenLocalStorage( 612 void StoragePartitionImpl::OpenLocalStorage(
603 const url::Origin& origin, 613 const url::Origin& origin,
604 mojom::LevelDBObserverPtr observer, 614 mojom::LevelDBObserverPtr observer,
605 mojo::InterfaceRequest<mojom::LevelDBWrapper> request) { 615 mojo::InterfaceRequest<mojom::LevelDBWrapper> request) {
606 dom_storage_context_->OpenLocalStorage( 616 dom_storage_context_->OpenLocalStorage(
607 origin, std::move(observer), std::move(request)); 617 origin, std::move(observer), std::move(request));
608 } 618 }
609 619
610 void StoragePartitionImpl::ClearDataImpl( 620 void StoragePartitionImpl::ClearDataImpl(
611 uint32_t remove_mask, 621 uint32_t remove_mask,
(...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after
932 net::URLRequestContextGetter* url_request_context) { 942 net::URLRequestContextGetter* url_request_context) {
933 url_request_context_ = url_request_context; 943 url_request_context_ = url_request_context;
934 } 944 }
935 945
936 void StoragePartitionImpl::SetMediaURLRequestContext( 946 void StoragePartitionImpl::SetMediaURLRequestContext(
937 net::URLRequestContextGetter* media_url_request_context) { 947 net::URLRequestContextGetter* media_url_request_context) {
938 media_url_request_context_ = media_url_request_context; 948 media_url_request_context_ = media_url_request_context;
939 } 949 }
940 950
941 } // namespace content 951 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/storage_partition_impl.h ('k') | content/content_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698