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

Side by Side Diff: chromeos/dbus/shill_manager_client_stub.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, 3 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chromeos/dbus/shill_manager_client_stub.h" 5 #include "chromeos/dbus/shill_manager_client_stub.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "base/values.h" 10 #include "base/values.h"
(...skipping 505 matching lines...) Expand 10 before | Expand all | Expand 10 after
516 void ShillManagerClientStub::PassStubGeoNetworks( 516 void ShillManagerClientStub::PassStubGeoNetworks(
517 const DictionaryValueCallback& callback) const { 517 const DictionaryValueCallback& callback) const {
518 callback.Run(DBUS_METHOD_CALL_SUCCESS, stub_geo_networks_); 518 callback.Run(DBUS_METHOD_CALL_SUCCESS, stub_geo_networks_);
519 } 519 }
520 520
521 void ShillManagerClientStub::CallNotifyObserversPropertyChanged( 521 void ShillManagerClientStub::CallNotifyObserversPropertyChanged(
522 const std::string& property, 522 const std::string& property,
523 int delay_ms) { 523 int delay_ms) {
524 // Avoid unnecessary delayed task if we have no observers (e.g. during 524 // Avoid unnecessary delayed task if we have no observers (e.g. during
525 // initial setup). 525 // initial setup).
526 if (observer_list_.size() == 0) 526 if (!observer_list_.might_have_observers())
527 return; 527 return;
528 if (!CommandLine::ForCurrentProcess()->HasSwitch( 528 if (!CommandLine::ForCurrentProcess()->HasSwitch(
529 chromeos::switches::kEnableStubInteractive)) { 529 chromeos::switches::kEnableStubInteractive)) {
530 delay_ms = 0; 530 delay_ms = 0;
531 } 531 }
532 base::MessageLoop::current()->PostDelayedTask( 532 base::MessageLoop::current()->PostDelayedTask(
533 FROM_HERE, 533 FROM_HERE,
534 base::Bind(&ShillManagerClientStub::NotifyObserversPropertyChanged, 534 base::Bind(&ShillManagerClientStub::NotifyObserversPropertyChanged,
535 weak_ptr_factory_.GetWeakPtr(), 535 weak_ptr_factory_.GetWeakPtr(),
536 property), 536 property),
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
639 flimflam::kScanningProperty, 639 flimflam::kScanningProperty,
640 base::FundamentalValue(false)); 640 base::FundamentalValue(false));
641 } 641 }
642 CallNotifyObserversPropertyChanged(flimflam::kServicesProperty, 0); 642 CallNotifyObserversPropertyChanged(flimflam::kServicesProperty, 0);
643 CallNotifyObserversPropertyChanged(flimflam::kServiceWatchListProperty, 643 CallNotifyObserversPropertyChanged(flimflam::kServiceWatchListProperty,
644 0); 644 0);
645 base::MessageLoop::current()->PostTask(FROM_HERE, callback); 645 base::MessageLoop::current()->PostTask(FROM_HERE, callback);
646 } 646 }
647 647
648 } // namespace chromeos 648 } // namespace chromeos
OLDNEW
« no previous file with comments | « chromeos/dbus/shill_client_helper.cc ('k') | content/browser/loader/resource_dispatcher_host_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698