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

Side by Side Diff: device/geolocation/wifi_data_provider.cc

Issue 2200483002: Geolocation cleanup: run clang-format (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 unified diff | Download patch
« no previous file with comments | « device/geolocation/wifi_data.cc ('k') | device/geolocation/wifi_data_provider_chromeos.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 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 "device/geolocation/wifi_data_provider.h" 5 #include "device/geolocation/wifi_data_provider.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/location.h" 9 #include "base/location.h"
10 #include "base/threading/thread_task_runner_handle.h" 10 #include "base/threading/thread_task_runner_handle.h"
11 11
12 namespace device { 12 namespace device {
13 13
14 WifiDataProvider::WifiDataProvider() 14 WifiDataProvider::WifiDataProvider()
15 : client_task_runner_(base::ThreadTaskRunnerHandle::Get()) { 15 : client_task_runner_(base::ThreadTaskRunnerHandle::Get()) {
16 DCHECK(client_task_runner_); 16 DCHECK(client_task_runner_);
17 } 17 }
18 18
19 WifiDataProvider::~WifiDataProvider() { 19 WifiDataProvider::~WifiDataProvider() {}
20 }
21 20
22 void WifiDataProvider::AddCallback(WifiDataUpdateCallback* callback) { 21 void WifiDataProvider::AddCallback(WifiDataUpdateCallback* callback) {
23 callbacks_.insert(callback); 22 callbacks_.insert(callback);
24 } 23 }
25 24
26 bool WifiDataProvider::RemoveCallback(WifiDataUpdateCallback* callback) { 25 bool WifiDataProvider::RemoveCallback(WifiDataUpdateCallback* callback) {
27 return callbacks_.erase(callback) == 1; 26 return callbacks_.erase(callback) == 1;
28 } 27 }
29 28
30 bool WifiDataProvider::has_callbacks() const { 29 bool WifiDataProvider::has_callbacks() const {
(...skipping 14 matching lines...) Expand all
45 // pending. This is fine; the loop will be a no-op. 44 // pending. This is fine; the loop will be a no-op.
46 CallbackSet::const_iterator iter = callbacks_.begin(); 45 CallbackSet::const_iterator iter = callbacks_.begin();
47 while (iter != callbacks_.end()) { 46 while (iter != callbacks_.end()) {
48 WifiDataUpdateCallback* callback = *iter; 47 WifiDataUpdateCallback* callback = *iter;
49 ++iter; // Advance iter before running, in case callback unregisters. 48 ++iter; // Advance iter before running, in case callback unregisters.
50 callback->Run(); 49 callback->Run();
51 } 50 }
52 } 51 }
53 52
54 } // namespace device 53 } // namespace device
OLDNEW
« no previous file with comments | « device/geolocation/wifi_data.cc ('k') | device/geolocation/wifi_data_provider_chromeos.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698