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

Unified Diff: content/browser/service_worker/service_worker_context_wrapper.cc

Issue 2159133002: Shutdown StoragePartition before ProfileIOData is being shut down (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: addressed 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/service_worker/service_worker_context_wrapper.cc
diff --git a/content/browser/service_worker/service_worker_context_wrapper.cc b/content/browser/service_worker/service_worker_context_wrapper.cc
index 0c32d7168594bb9f4070c13c35cdde1da532f790..0cef01f2ab2005c81707ac26b85abb2b66d382cb 100644
--- a/content/browser/service_worker/service_worker_context_wrapper.cc
+++ b/content/browser/service_worker/service_worker_context_wrapper.cc
@@ -114,7 +114,6 @@ ServiceWorkerContextWrapper::ServiceWorkerContextWrapper(
ServiceWorkerContextWrapper::~ServiceWorkerContextWrapper() {
DCHECK(!resource_context_);
- DCHECK(!request_context_getter_);
}
void ServiceWorkerContextWrapper::Init(
@@ -145,25 +144,9 @@ void ServiceWorkerContextWrapper::Shutdown() {
}
void ServiceWorkerContextWrapper::InitializeResourceContext(
- ResourceContext* resource_context,
- scoped_refptr<net::URLRequestContextGetter> request_context_getter) {
+ ResourceContext* resource_context) {
DCHECK_CURRENTLY_ON(BrowserThread::IO);
resource_context_ = resource_context;
- request_context_getter_ = request_context_getter;
- // Can be null in tests.
- if (request_context_getter_)
- request_context_getter_->AddObserver(this);
-}
-
-void ServiceWorkerContextWrapper::OnContextShuttingDown() {
- DCHECK_CURRENTLY_ON(BrowserThread::IO);
-
- // OnContextShuttingDown is called when the ProfileIOData (ResourceContext) is
- // shutting down, so call ShutdownOnIO() to clear resource_context_.
- // This doesn't seem to be called when using content_shell, so we still must
- // also call ShutdownOnIO() in Shutdown(), which is called when the storage
- // partition is destroyed.
- ShutdownOnIO();
}
void ServiceWorkerContextWrapper::DeleteAndStartOver() {
@@ -719,10 +702,6 @@ void ServiceWorkerContextWrapper::InitInternal(
void ServiceWorkerContextWrapper::ShutdownOnIO() {
DCHECK_CURRENTLY_ON(BrowserThread::IO);
- // Can be null in tests.
- if (request_context_getter_)
- request_context_getter_->RemoveObserver(this);
- request_context_getter_ = nullptr;
resource_context_ = nullptr;
context_core_.reset();
}
« no previous file with comments | « content/browser/service_worker/service_worker_context_wrapper.h ('k') | content/browser/storage_partition_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698