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

Unified Diff: chrome/browser/visitedlink_master.cc

Issue 4146004: ThreadRestrictions: disallow blocking IO on the UI thread (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: more Created 10 years, 2 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
« base/nss_util.cc ('K') | « chrome/browser/spellcheck_host.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/visitedlink_master.cc
diff --git a/chrome/browser/visitedlink_master.cc b/chrome/browser/visitedlink_master.cc
index cf1445c5e2fb1db67058316ca89100646dd8b619..02b45d971afacb0b56309ab4872e825765c44c8d 100644
--- a/chrome/browser/visitedlink_master.cc
+++ b/chrome/browser/visitedlink_master.cc
@@ -21,6 +21,7 @@
#include "base/rand_util.h"
#include "base/stack_container.h"
#include "base/string_util.h"
+#include "base/thread_restrictions.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/browser_thread.h"
#include "chrome/browser/history/history.h"
@@ -251,6 +252,10 @@ void VisitedLinkMaster::InitMembers(Listener* listener, Profile* profile) {
}
bool VisitedLinkMaster::Init() {
+ // We probably shouldn't be loading this from the UI thread,
+ // but it does need to happen early on in startup.
+ // http://code.google.com/p/chromium/issues/detail?id=24163
+ base::ThreadRestrictions::ScopedAllowIO allow_io;
if (!InitFromFile())
return InitFromScratch(suppress_rebuild_);
return true;
@@ -889,6 +894,9 @@ void VisitedLinkMaster::OnTableRebuildComplete(
// Send an update notification to all child processes.
listener_->NewTable(shared_memory_);
+ // We shouldn't be writing the table from the main thread!
+ // http://code.google.com/p/chromium/issues/detail?id=24163
+ base::ThreadRestrictions::ScopedAllowIO allow_io;
WriteFullTable();
}
}
« base/nss_util.cc ('K') | « chrome/browser/spellcheck_host.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698