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

Unified Diff: cc/base/delayed_unique_notifier.cc

Issue 683113005: Update from chromium https://crrev.com/302282 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 2 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 | « cc/base/delayed_unique_notifier.h ('k') | cc/base/delayed_unique_notifier_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/base/delayed_unique_notifier.cc
diff --git a/cc/base/delayed_unique_notifier.cc b/cc/base/delayed_unique_notifier.cc
index c2972677da6fafcb2a4e4b935c4c8b5a0d7b179c..1824226c2a6d19838d817c06a0824714784ff00e 100644
--- a/cc/base/delayed_unique_notifier.cc
+++ b/cc/base/delayed_unique_notifier.cc
@@ -43,6 +43,15 @@ void DelayedUniqueNotifier::Cancel() {
next_notification_time_ = base::TimeTicks();
}
+void DelayedUniqueNotifier::Shutdown() {
+ // This function must destroy any weak ptrs since after being cancelled, this
+ // class may be destroyed on another thread during compositor shutdown.
+ weak_ptr_factory_.InvalidateWeakPtrs();
+ // Deliberately leaves notification_pending_ = true forever so new tasks with
+ // weak ptrs can not be created.
+ notification_pending_ = true;
+}
+
bool DelayedUniqueNotifier::HasPendingNotification() const {
return notification_pending_ && !next_notification_time_.is_null();
}
« no previous file with comments | « cc/base/delayed_unique_notifier.h ('k') | cc/base/delayed_unique_notifier_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698