diff options
| author | Ben Murdoch <benm@google.com> | 2010-11-18 18:32:45 +0000 |
|---|---|---|
| committer | Ben Murdoch <benm@google.com> | 2010-11-18 18:38:07 +0000 |
| commit | 513209b27ff55e2841eac0e4120199c23acce758 (patch) | |
| tree | aeba30bb08c5f47c57003544e378a377c297eee6 /chrome/browser/visitedlink_master.cc | |
| parent | 164f7496de0fbee436b385a79ead9e3cb81a50c1 (diff) | |
| download | external_chromium-513209b27ff55e2841eac0e4120199c23acce758.zip external_chromium-513209b27ff55e2841eac0e4120199c23acce758.tar.gz external_chromium-513209b27ff55e2841eac0e4120199c23acce758.tar.bz2 | |
Merge Chromium at r65505: Initial merge by git.
Change-Id: I31d8f1d8cd33caaf7f47ffa7350aef42d5fbdb45
Diffstat (limited to 'chrome/browser/visitedlink_master.cc')
| -rw-r--r-- | chrome/browser/visitedlink_master.cc | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/chrome/browser/visitedlink_master.cc b/chrome/browser/visitedlink_master.cc index cf1445c..6fdb461 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; @@ -670,14 +675,7 @@ bool VisitedLinkMaster::CreateURLTable(int32 num_entries, bool init_to_empty) { if (!shared_memory_) return false; - if (!shared_memory_->Create(std::string() /* anonymous */, - false /* read-write */, false /* create */, - alloc_size)) { - return false; - } - - // Map into our process. - if (!shared_memory_->Map(alloc_size)) { + if (!shared_memory_->CreateAndMapAnonymous(alloc_size)) { delete shared_memory_; shared_memory_ = NULL; return false; @@ -889,6 +887,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(); } } |
