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

Unified Diff: base/observer_list_threadsafe.h

Issue 1480153002: Investigate Android build problems in review 1414463004. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@lkgr
Patch Set: Add //url dep on GN test_support target. Created 5 years 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: base/observer_list_threadsafe.h
diff --git a/base/observer_list_threadsafe.h b/base/observer_list_threadsafe.h
index e4204941949ff5996383b9906d916eca1322e85d..db4e6d2151ff2fa315604725e9a7657cb6caade7 100644
--- a/base/observer_list_threadsafe.h
+++ b/base/observer_list_threadsafe.h
@@ -111,11 +111,11 @@ class ObserverListThreadSafe
// Add an observer to the list. An observer should not be added to
// the same list more than once.
- void AddObserver(ObserverType* obs) {
+ bool AddObserver(ObserverType* obs) {
// If there is not a current MessageLoop, it is impossible to notify on it,
// so do not add the observer.
if (!MessageLoop::current())
- return;
+ return false;
ObserverList<ObserverType>* list = nullptr;
PlatformThreadId thread_id = PlatformThread::CurrentId();
@@ -126,6 +126,7 @@ class ObserverListThreadSafe
list = &(observer_lists_[thread_id]->list);
}
list->AddObserver(obs);
+ return true;
}
// Remove an observer from the list if it is in the list.

Powered by Google App Engine
This is Rietveld 408576698