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

Unified Diff: content/browser/service_worker/service_worker_context_wrapper.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: remove include 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/service_worker/service_worker_context_wrapper.h
diff --git a/content/browser/service_worker/service_worker_context_wrapper.h b/content/browser/service_worker/service_worker_context_wrapper.h
index 56367eee1cebbe645a0e4dc537f57aa68eec1d45..8494035e9fa9a47bc642b7f882fe26e3f48cc1a5 100644
--- a/content/browser/service_worker/service_worker_context_wrapper.h
+++ b/content/browser/service_worker/service_worker_context_wrapper.h
@@ -35,6 +35,7 @@ class BrowserContext;
class ChromeBlobStorageContext;
class ServiceWorkerContextCore;
class ServiceWorkerContextObserver;
+class StoragePartitionImpl;
// A refcounted wrapper class for our core object. Higher level content lib
// classes keep references to this class on mutliple threads. The inner core
@@ -61,6 +62,12 @@ class CONTENT_EXPORT ServiceWorkerContextWrapper
// The core context is only for use on the IO thread.
ServiceWorkerContextCore* context();
+ // The StoragePartition should only be used on the UI thread.
+ // Can be null before/during init and during/after shutdown.
+ StoragePartitionImpl* storage_partition() const;
+
+ void set_storage_partition(StoragePartitionImpl* storage_partition);
+
// The process manager can be used on either UI or IO.
ServiceWorkerProcessManager* process_manager() {
return process_manager_.get();
@@ -130,6 +137,9 @@ class CONTENT_EXPORT ServiceWorkerContextWrapper
// Initialized in Init(); true if the user data directory is empty.
bool is_incognito_;
+
+ // Raw pointer to the StoragePartitionImpl owning |this|.
+ StoragePartitionImpl* storage_partition_;
};
} // namespace content

Powered by Google App Engine
This is Rietveld 408576698