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

Unified Diff: content/browser/storage_partition_impl.h

Issue 852463002: Keep track of ServiceWorkerContext's BrowserContext and expose it. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@nullptr
Patch Set: review comments Created 5 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/storage_partition_impl.h
diff --git a/content/browser/storage_partition_impl.h b/content/browser/storage_partition_impl.h
index f53447eb1b4e1d4610e402e35c7ed5cf3a2d9787..d9e8ae5bd6720464eb3d54ac67c91f0cce5cca1c 100644
--- a/content/browser/storage_partition_impl.h
+++ b/content/browser/storage_partition_impl.h
@@ -65,6 +65,9 @@ class StoragePartitionImpl : public StoragePartition {
WebRTCIdentityStore* GetWebRTCIdentityStore();
+ // Can return nullptr while |this| is being destroyed.
+ BrowserContext* browser_context() const;
+
struct DataDeletionHelper;
struct QuotaManagedDataDeletionHelper;
@@ -113,6 +116,7 @@ class StoragePartitionImpl : public StoragePartition {
const base::FilePath& profile_path);
CONTENT_EXPORT StoragePartitionImpl(
+ BrowserContext* browser_context,
const base::FilePath& partition_path,
storage::QuotaManager* quota_manager,
ChromeAppCacheService* appcache_service,
@@ -169,6 +173,11 @@ class StoragePartitionImpl : public StoragePartition {
scoped_refptr<HostZoomLevelContext> host_zoom_level_context_;
scoped_refptr<NavigatorConnectContext> navigator_connect_context_;
+ // Raw pointer that should always be valid. The BrowserContext owns the
+ // StoragePartitionImplMap which then owns StoragePartitionImpl. When the
+ // BrowserContext is destroyed, |this| will be destroyed too.
+ BrowserContext* browser_context_;
+
DISALLOW_COPY_AND_ASSIGN(StoragePartitionImpl);
};

Powered by Google App Engine
This is Rietveld 408576698