summaryrefslogtreecommitdiffstats
path: root/chrome/browser/history
diff options
context:
space:
mode:
authormeelapshah@chromium.org <meelapshah@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-28 01:22:25 +0000
committermeelapshah@chromium.org <meelapshah@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-28 01:22:25 +0000
commitdaa82dc7442d26d9a50e342c0d9dcee43f287df8 (patch)
treebe3c211a383852579223f57be9c1ee13b84c1f6d /chrome/browser/history
parentabaa71c990b2d9dd514e9f2eefb1d2cf7b720562 (diff)
downloadchromium_src-daa82dc7442d26d9a50e342c0d9dcee43f287df8.zip
chromium_src-daa82dc7442d26d9a50e342c0d9dcee43f287df8.tar.gz
chromium_src-daa82dc7442d26d9a50e342c0d9dcee43f287df8.tar.bz2
Make ThumbnailStore broadcast a notification when it has finished reading thumbnails from disk.
Make DOMUIThumbnailSource wait for this notification if ThumbnailStore isn't ready yet. Also clean up some of the code. Review URL: http://codereview.chromium.org/155911 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@21785 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/history')
-rw-r--r--chrome/browser/history/history.h5
-rw-r--r--chrome/browser/history/history_backend.cc10
2 files changed, 9 insertions, 6 deletions
diff --git a/chrome/browser/history/history.h b/chrome/browser/history/history.h
index 9aec250..0643139 100644
--- a/chrome/browser/history/history.h
+++ b/chrome/browser/history/history.h
@@ -306,7 +306,10 @@ class HistoryService : public CancelableRequestProvider,
// in the map containing redirects from the URL. For example, if we have the
// redirect chain A -> B -> C and A is a top visited URL, then A will be in
// the vector and "A => {B -> C}" will be in the map.
- typedef Callback2<std::vector<GURL>*, history::RedirectMap*>::Type
+ typedef Callback4<Handle,
+ bool, // Did we get the top urls and redirects?
+ std::vector<GURL>*, // List of top URLs.
+ history::RedirectMap*>::Type // Redirects for top URLs.
QueryTopURLsAndRedirectsCallback;
// Request the top |result_count| most visited URLs and the chain of redirects
diff --git a/chrome/browser/history/history_backend.cc b/chrome/browser/history/history_backend.cc
index bdf2351..1ccd7cf 100644
--- a/chrome/browser/history/history_backend.cc
+++ b/chrome/browser/history/history_backend.cc
@@ -1163,7 +1163,7 @@ void HistoryBackend::QueryTopURLsAndRedirects(
if (!db_.get()) {
request->ForwardResult(QueryTopURLsAndRedirectsRequest::TupleType(
- NULL, NULL));
+ request->handle(), false, NULL, NULL));
return;
}
@@ -1176,13 +1176,13 @@ void HistoryBackend::QueryTopURLsAndRedirects(
for (size_t i = 0; i < data.size(); ++i) {
top_urls->push_back(data[i]->GetURL());
- history::RedirectList list;
- GetMostRecentRedirectsFrom(top_urls->back(), &list);
- (*redirects)[top_urls->back()] = new RefCountedVector<GURL>(list);
+ RefCountedVector<GURL>* list = new RefCountedVector<GURL>;
+ GetMostRecentRedirectsFrom(top_urls->back(), &list->data);
+ (*redirects)[top_urls->back()] = list;
}
request->ForwardResult(QueryTopURLsAndRedirectsRequest::TupleType(
- top_urls, redirects));
+ request->handle(), true, top_urls, redirects));
}
void HistoryBackend::GetRedirectsFromSpecificVisit(