Commit 370028fc authored by Matt Falkenhagen's avatar Matt Falkenhagen Committed by Commit Bot

service worker: Add debugging CHECKs for a crash bug.

I suspect the linked crash bug is due to ServiceWorkerProviderHost
or ServiceWorkerHandle being deleted twice.

Bug: 838410
Change-Id: I695978c0d7fdbe96ac0eb411bc6cac80854c2079
Reviewed-on: https://chromium-review.googlesource.com/1056782Reviewed-by: default avatarHan Leon <leon.han@intel.com>
Commit-Queue: Matt Falkenhagen <falken@chromium.org>
Cr-Commit-Position: refs/heads/master@{#558240}
parent cbad4647
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
#include "content/browser/service_worker/service_worker_type_converters.h" #include "content/browser/service_worker/service_worker_type_converters.h"
#include "content/common/service_worker/service_worker_types.h" #include "content/common/service_worker/service_worker_types.h"
#include "content/common/service_worker/service_worker_utils.h" #include "content/common/service_worker/service_worker_utils.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/common/browser_side_navigation_policy.h" #include "content/public/common/browser_side_navigation_policy.h"
namespace content { namespace content {
...@@ -180,6 +181,12 @@ ServiceWorkerHandle::ServiceWorkerHandle( ...@@ -180,6 +181,12 @@ ServiceWorkerHandle::ServiceWorkerHandle(
} }
ServiceWorkerHandle::~ServiceWorkerHandle() { ServiceWorkerHandle::~ServiceWorkerHandle() {
// TODO(crbug.com/838410): These CHECKs are temporary debugging for the linked
// bug.
CHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
CHECK(!in_dtor_);
in_dtor_ = true;
version_->RemoveListener(this); version_->RemoveListener(this);
} }
......
...@@ -122,6 +122,9 @@ class CONTENT_EXPORT ServiceWorkerHandle ...@@ -122,6 +122,9 @@ class CONTENT_EXPORT ServiceWorkerHandle
mojo::AssociatedInterfacePtrSet<blink::mojom::ServiceWorkerObject> mojo::AssociatedInterfacePtrSet<blink::mojom::ServiceWorkerObject>
remote_objects_; remote_objects_;
// TODO(crbug.com/838410): Temporary debugging for the linked bug.
bool in_dtor_ = false;
base::WeakPtrFactory<ServiceWorkerHandle> weak_ptr_factory_; base::WeakPtrFactory<ServiceWorkerHandle> weak_ptr_factory_;
DISALLOW_COPY_AND_ASSIGN(ServiceWorkerHandle); DISALLOW_COPY_AND_ASSIGN(ServiceWorkerHandle);
......
...@@ -262,7 +262,12 @@ ServiceWorkerProviderHost::ServiceWorkerProviderHost( ...@@ -262,7 +262,12 @@ ServiceWorkerProviderHost::ServiceWorkerProviderHost(
} }
ServiceWorkerProviderHost::~ServiceWorkerProviderHost() { ServiceWorkerProviderHost::~ServiceWorkerProviderHost() {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); // TODO(crbug.com/838410): The CHECKs are temporary debugging for the linked
// bug.
CHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
CHECK(!in_dtor_);
in_dtor_ = true;
if (context_) if (context_)
context_->UnregisterProviderHostByClientID(client_uuid_); context_->UnregisterProviderHostByClientID(client_uuid_);
......
...@@ -677,6 +677,9 @@ class CONTENT_EXPORT ServiceWorkerProviderHost ...@@ -677,6 +677,9 @@ class CONTENT_EXPORT ServiceWorkerProviderHost
// redirects. // redirects.
bool is_execution_ready_ = false; bool is_execution_ready_ = false;
// TODO(crbug.com/838410): Temporary debugging for the linked bug.
bool in_dtor_ = false;
DISALLOW_COPY_AND_ASSIGN(ServiceWorkerProviderHost); DISALLOW_COPY_AND_ASSIGN(ServiceWorkerProviderHost);
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment