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

Unified Diff: sync/js/sync_js_controller.cc

Issue 23190045: Switch ObserverList::size() to ObserverList::might_have_observers() Pt.1 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Pure merge Created 7 years, 4 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 | « net/dns/mdns_client_impl.cc ('k') | ui/compositor/layer_animator_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sync/js/sync_js_controller.cc
diff --git a/sync/js/sync_js_controller.cc b/sync/js/sync_js_controller.cc
index 49f3cc79e6d9a20da350719ceac6fe719f58ddd4..4d3148fdd03581226b0b73ab302e0f6fc3d737e5 100644
--- a/sync/js/sync_js_controller.cc
+++ b/sync/js/sync_js_controller.cc
@@ -73,7 +73,7 @@ void SyncJsController::UpdateBackendEventHandler() {
// event handler we pass to it if we don't have any event
// handlers.
WeakHandle<JsEventHandler> backend_event_handler =
- (js_event_handlers_.size() > 0) ?
+ js_event_handlers_.might_have_observers() ?
MakeWeakHandle(AsWeakPtr()) : WeakHandle<SyncJsController>();
js_backend_.Call(FROM_HERE, &JsBackend::SetJsEventHandler,
backend_event_handler);
« no previous file with comments | « net/dns/mdns_client_impl.cc ('k') | ui/compositor/layer_animator_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698