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

Unified Diff: chrome/browser/android/offline_pages/background_loader_offliner.cc

Issue 2850943002: If MHTML saving is cancelled, delete the page afterwards. (Closed)
Patch Set: Created 3 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
« no previous file with comments | « no previous file | chrome/browser/android/offline_pages/background_loader_offliner_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/android/offline_pages/background_loader_offliner.cc
diff --git a/chrome/browser/android/offline_pages/background_loader_offliner.cc b/chrome/browser/android/offline_pages/background_loader_offliner.cc
index 6c4a9b3062be368710d69e0f30013a9f1ee276ff..c1317c06790ce1ec53a35c3593588a0cefabb8c9 100644
--- a/chrome/browser/android/offline_pages/background_loader_offliner.cc
+++ b/chrome/browser/android/offline_pages/background_loader_offliner.cc
@@ -81,6 +81,8 @@ void HandleApplicationStateChangeCancel(
completion_callback.Run(canceled_request,
Offliner::RequestStatus::FOREGROUND_CANCELED);
}
+
+void LocalDeletePageCallback(DeletePageResult result) {}
} // namespace
BackgroundLoaderOffliner::BackgroundLoaderOffliner(
@@ -414,6 +416,11 @@ void BackgroundLoaderOffliner::OnPageSaved(SavePageResult save_result,
ResetState();
if (save_state_ == DELETE_AFTER_SAVE) {
+ // Delete the saved page off disk and from the OPM.
+ std::vector<int64_t> offline_ids;
+ offline_ids.push_back(offline_id);
+ offline_page_model_->DeletePagesByOfflineId(
+ offline_ids, base::Bind(&LocalDeletePageCallback));
chili 2017/04/29 00:11:33 should we only run the cancel_callback_.Run once t
Pete Williamson 2017/04/29 00:14:44 My thinking here is that it is fine to return cont
save_state_ = NONE;
cancel_callback_.Run(request);
return;
« no previous file with comments | « no previous file | chrome/browser/android/offline_pages/background_loader_offliner_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698