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

Unified Diff: chrome/browser/visitedlink/visitedlink_master.cc

Issue 9065009: Hook up the SequencedWorkerPool to the browser thread. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 8 years, 12 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
« no previous file with comments | « chrome/browser/visitedlink/visitedlink_master.h ('k') | content/browser/browser_main_loop.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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)));
}
« no previous file with comments | « chrome/browser/visitedlink/visitedlink_master.h ('k') | content/browser/browser_main_loop.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698