Index: chrome/browser/history/in_memory_url_index.cc |
diff --git a/chrome/browser/history/in_memory_url_index.cc b/chrome/browser/history/in_memory_url_index.cc |
index 32fb87c7f92785830f34bd19b6b750c3c2844f26..172b9e0ddd0b346fe42baf0d8a8808e3f8159570 100644 |
--- a/chrome/browser/history/in_memory_url_index.cc |
+++ b/chrome/browser/history/in_memory_url_index.cc |
@@ -122,7 +122,13 @@ void InMemoryURLIndex::ShutDown() { |
if (!GetCacheFilePath(&path)) |
return; |
private_data_tracker_.TryCancelAll(); |
- URLIndexPrivateData::WritePrivateDataToCacheFileTask(private_data_, path); |
+ |
+ // During browser TearDown this method was called from a thread that can |
+ // perform FILE ops. Guest Profiles are closed on UI thread, so post a task. |
+ if (content::BrowserThread::CurrentlyOn(content::BrowserThread::FILE)) |
+ URLIndexPrivateData::WritePrivateDataToCacheFileTask(private_data_, path); |
+ else |
+ PostSaveToCacheFileTask(); |
needs_to_be_cached_ = false; |
} |