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

Unified Diff: chrome/browser/history/history.h

Issue 10217010: Completed the code path from AndroidProviderService to HistoryBackend. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Sync Created 8 years, 8 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
Index: chrome/browser/history/history.h
diff --git a/chrome/browser/history/history.h b/chrome/browser/history/history.h
index b9c68794449984817de57688482608711f57f010..1d7678947613aaad711765dc7d0774b6e54d58e3 100644
--- a/chrome/browser/history/history.h
+++ b/chrome/browser/history/history.h
@@ -26,6 +26,10 @@
#include "content/public/common/page_transition_types.h"
#include "sql/init_status.h"
+#if defined(OS_ANDROID)
+#include "chrome/browser/history/android/android_history_provider_service.h"
+#endif
+
class BookmarkService;
class FilePath;
class GURL;
@@ -620,6 +624,9 @@ class HistoryService : public CancelableRequestProvider,
private:
class BackendDelegate;
+#if defined(OS_ANDROID)
+ friend class AndroidHistoryProviderService;
+#endif
friend class base::RefCountedThreadSafe<HistoryService>;
friend class BackendDelegate;
friend class FaviconService;
@@ -806,6 +813,31 @@ class HistoryService : public CancelableRequestProvider,
return request->handle();
}
+ template<typename BackendFunc,
+ class RequestType, // Descendant of CancelableRequstBase.
+ typename ArgA,
+ typename ArgB,
+ typename ArgC,
+ typename ArgD>
+ Handle Schedule(SchedulePriority priority,
+ BackendFunc func, // Function to call on the HistoryBackend.
+ CancelableRequestConsumerBase* consumer,
+ RequestType* request,
+ const ArgA& a,
+ const ArgB& b,
+ const ArgC& c,
+ const ArgD& d) {
+ DCHECK(thread_) << "History service being called after cleanup";
+ LoadBackendIfNecessary();
+ if (consumer)
+ AddRequest(request, consumer);
+ ScheduleTask(priority,
+ base::Bind(func, history_backend_.get(),
+ scoped_refptr<RequestType>(request),
+ a, b, c, d));
+ return request->handle();
+ }
+
// ScheduleAndForget ---------------------------------------------------------
//
// Functions for scheduling operations on the history thread that do not need
« no previous file with comments | « chrome/browser/history/android/android_history_provider_service_unittest.cc ('k') | chrome/browser/history/history_backend.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698