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

Unified Diff: ios/chrome/browser/reading_list/favicon_web_state_dispatcher_impl.mm

Issue 2745313004: Remove all ReadingList entries on managed account signout. (Closed)
Patch Set: feedback Created 3 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
Index: ios/chrome/browser/reading_list/favicon_web_state_dispatcher_impl.mm
diff --git a/ios/chrome/browser/reading_list/favicon_web_state_dispatcher_impl.mm b/ios/chrome/browser/reading_list/favicon_web_state_dispatcher_impl.mm
index 10f1d083b290f691bcc139d42c85f2d917e1e88a..528c9471d38bb7dc3a7a09bf4f5e6a7697a3bc2c 100644
--- a/ios/chrome/browser/reading_list/favicon_web_state_dispatcher_impl.mm
+++ b/ios/chrome/browser/reading_list/favicon_web_state_dispatcher_impl.mm
@@ -52,12 +52,17 @@ FaviconWebStateDispatcherImpl::RequestWebState() {
return web_state;
}
+void FaviconWebStateDispatcherImpl::ReleaseAll() {
+ web_states_.clear();
+}
+
void FaviconWebStateDispatcherImpl::ReturnWebState(
std::unique_ptr<web::WebState> web_state_unique) {
web::WebState* web_state = web_state_unique.get();
- web_states_.push_back(std::move(std::move(web_state_unique)));
+ web_states_.push_back(std::move(web_state_unique));
base::WeakPtr<FaviconWebStateDispatcherImpl> weak_this =
weak_ptr_factory_.GetWeakPtr();
+ // This block will delete the web_state in keep_alive_second_ seconds.
dispatch_after(
dispatch_time(DISPATCH_TIME_NOW, keep_alive_second_ * NSEC_PER_SEC),
dispatch_get_main_queue(), ^{

Powered by Google App Engine
This is Rietveld 408576698