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

Unified Diff: components/history/core/browser/history_service.cc

Issue 1015153002: Commit History transaction when app is backgrounded on iOS (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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 | « components/history/core/browser/history_service.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/history/core/browser/history_service.cc
diff --git a/components/history/core/browser/history_service.cc b/components/history/core/browser/history_service.cc
index 05dff7d65e311d990d9da895c68266d4016fd35b..296f833aded3c5ddf8d4b8396e3a84e7f87824ae 100644
--- a/components/history/core/browser/history_service.cc
+++ b/components/history/core/browser/history_service.cc
@@ -46,6 +46,10 @@
#include "sync/api/sync_error_factory.h"
#include "third_party/skia/include/core/SkBitmap.h"
+#if defined(OS_IOS)
+#include "base/critical_closure.h"
+#endif
+
using base::Time;
namespace history {
@@ -205,6 +209,17 @@ bool HistoryService::BackendLoaded() {
return backend_loaded_;
}
+#if defined(OS_IOS)
+void HistoryService::HandleBackgrounding() {
+ if (!thread_ || !history_backend_.get())
+ return;
+
+ ScheduleTask(PRIORITY_NORMAL,
+ base::MakeCriticalClosure(base::Bind(
+ &HistoryBackend::PersistState, history_backend_.get())));
+}
+#endif
+
void HistoryService::ClearCachedDataForContextID(ContextID context_id) {
DCHECK(thread_) << "History service being called after cleanup";
DCHECK(thread_checker_.CalledOnValidThread());
« no previous file with comments | « components/history/core/browser/history_service.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698