From f466a07e32ce1c8083dc726c7391e68b2ff2e7b0 Mon Sep 17 00:00:00 2001 From: achuith Date: Fri, 10 Jun 2016 13:56:17 -0700 Subject: [PATCH] Fix for sync filesystem app crash. Previously removing the SafePointScope had a risk of producing a dead lock if the following scenario happens: 1) The main thread starts a GC and tries to stop all other threads. 2) The worker thread is waiting on a signal without entering the SafePointScope. The main thread cannot stop the worker thread forever and thus cannot make progress. Dead lock. However, (to avoid this kind of dead lock) code has been added to timeout the GC if the GCing thread fails at stopping other threads within 100 ms. So not entering SafePointScope will just cause the timeout -- it won't cause a dead lock. This fixes a hard-to-reproduce timing bug that's been a big concern of one of our partners. BUG=592124,608603 TEST=manual Review-Url: https://codereview.chromium.org/2009093002 Cr-Commit-Position: refs/heads/master@{#399265} --- content/child/fileapi/webfilesystem_impl.cc | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/content/child/fileapi/webfilesystem_impl.cc b/content/child/fileapi/webfilesystem_impl.cc index 7b7a9f96276d4..3187e16ac834f 100644 --- a/content/child/fileapi/webfilesystem_impl.cc +++ b/content/child/fileapi/webfilesystem_impl.cc @@ -26,7 +26,6 @@ #include "third_party/WebKit/public/platform/WebFileSystemCallbacks.h" #include "third_party/WebKit/public/platform/WebString.h" #include "third_party/WebKit/public/platform/WebURL.h" -#include "third_party/WebKit/public/web/WebHeap.h" #include "url/gurl.h" using blink::WebFileInfo; @@ -53,10 +52,7 @@ class WebFileSystemImpl::WaitableCallbackResults } void WaitAndRun() { - { - blink::WebHeap::SafePointScope safe_point; - results_available_event_.Wait(); - } + results_available_event_.Wait(); Run(); }