Index: chrome/browser/visitedlink/visitedlink_master.cc |
=================================================================== |
--- chrome/browser/visitedlink/visitedlink_master.cc (revision 116282) |
+++ chrome/browser/visitedlink/visitedlink_master.cc (working copy) |
@@ -191,6 +191,7 @@ |
history_service_override_ = NULL; |
suppress_rebuild_ = false; |
profile_ = profile; |
+ sequence_token_ = BrowserThread::GetBlockingPool()->GetSequenceToken(); |
#ifndef NDEBUG |
posted_asynchronous_operation_ = false; |
@@ -242,6 +243,12 @@ |
return AddFingerprint(fingerprint, true); |
} |
+void VisitedLinkMaster::PostIOTask(const tracked_objects::Location& from_here, |
+ const base::Closure& task) { |
+ BrowserThread::GetBlockingPool()->PostSequencedWorkerTask(sequence_token_, |
+ from_here, task); |
+} |
+ |
void VisitedLinkMaster::AddURL(const GURL& url) { |
Hash index = TryToAddURL(url); |
if (!table_builder_ && index != null_hash_) { |
@@ -480,10 +487,7 @@ |
hash_table_, table_length_ * sizeof(Fingerprint)); |
// The hash table may have shrunk, so make sure this is the end. |
- BrowserThread::PostTask( |
- BrowserThread::FILE, |
- FROM_HERE, |
- base::Bind(base::IgnoreResult(&TruncateFile), file_)); |
+ PostIOTask(FROM_HERE, base::Bind(base::IgnoreResult(&TruncateFile), file_)); |
return true; |
} |
@@ -673,11 +677,7 @@ |
} |
if (!file_) |
return; |
- |
- BrowserThread::PostTask( |
- BrowserThread::FILE, |
- FROM_HERE, |
- base::Bind(base::IgnoreResult(&fclose), file_)); |
+ PostIOTask(FROM_HERE, base::Bind(base::IgnoreResult(&fclose), file_)); |
} |
bool VisitedLinkMaster::ResizeTableIfNecessary() { |
@@ -860,9 +860,7 @@ |
#ifndef NDEBUG |
posted_asynchronous_operation_ = true; |
#endif |
- |
- BrowserThread::PostTask( |
- BrowserThread::FILE, FROM_HERE, |
+ PostIOTask(FROM_HERE, |
base::Bind(&AsyncWrite, file, offset, |
std::string(static_cast<const char*>(data), data_size))); |
} |