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

Side by Side Diff: content/browser/geolocation/device_data_provider.h

Issue 11881011: Move wifi_data_provider_chromeos -> content (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 7 years, 11 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
« no previous file with comments | « content/browser/DEPS ('k') | content/browser/geolocation/wifi_data_provider_chromeos.h » ('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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 // A device data provider provides data from the device that is used by a 5 // A device data provider provides data from the device that is used by a
6 // NetworkLocationProvider to obtain a position fix. This data may be either 6 // NetworkLocationProvider to obtain a position fix. This data may be either
7 // cell radio data or wifi data. For a given type of data, we use a singleton 7 // cell radio data or wifi data. For a given type of data, we use a singleton
8 // instance of the device data provider, which is used by multiple 8 // instance of the device data provider, which is used by multiple
9 // NetworkLocationProvider objects. 9 // NetworkLocationProvider objects.
10 // 10 //
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 DCHECK(CalledOnClientThread()); 118 DCHECK(CalledOnClientThread());
119 return listeners_.erase(listener) == 1; 119 return listeners_.erase(listener) == 1;
120 } 120 }
121 121
122 bool has_listeners() const { 122 bool has_listeners() const {
123 DCHECK(CalledOnClientThread()); 123 DCHECK(CalledOnClientThread());
124 return !listeners_.empty(); 124 return !listeners_.empty();
125 } 125 }
126 126
127 protected: 127 protected:
128 virtual ~DeviceDataProviderImplBase() { 128 virtual ~DeviceDataProviderImplBase() {}
129 DCHECK(CalledOnClientThread());
John Knottenbelt 2013/01/14 14:12:31 According to jam@, there are some tests that hold
stevenjb 2013/01/14 18:02:38 jam@, any thoughts? I just copied this, but I'm re
jam 2013/01/14 18:57:21 this check is just invalid because as you say the
130 }
131 129
132 // Calls DeviceDataUpdateAvailable() on all registered listeners. 130 // Calls DeviceDataUpdateAvailable() on all registered listeners.
133 typedef std::set<ListenerInterface*> ListenersSet; 131 typedef std::set<ListenerInterface*> ListenersSet;
134 void NotifyListeners() { 132 void NotifyListeners() {
135 // Always make the notify callback via a posted task, so we can unwind 133 // Always make the notify callback via a posted task, so we can unwind
136 // callstack here and make callback without causing client re-entrancy. 134 // callstack here and make callback without causing client re-entrancy.
137 client_loop_->PostTask(FROM_HERE, base::Bind( 135 client_loop_->PostTask(FROM_HERE, base::Bind(
138 &DeviceDataProviderImplBase<DataType>::NotifyListenersInClientLoop, 136 &DeviceDataProviderImplBase<DataType>::NotifyListenersInClientLoop,
139 this)); 137 this));
140 } 138 }
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
300 scoped_refptr<DeviceDataProviderImplBase<DataType> > impl_; 298 scoped_refptr<DeviceDataProviderImplBase<DataType> > impl_;
301 299
302 DISALLOW_COPY_AND_ASSIGN(DeviceDataProvider); 300 DISALLOW_COPY_AND_ASSIGN(DeviceDataProvider);
303 }; 301 };
304 302
305 typedef DeviceDataProvider<WifiData> WifiDataProvider; 303 typedef DeviceDataProvider<WifiData> WifiDataProvider;
306 304
307 } // namespace content 305 } // namespace content
308 306
309 #endif // CONTENT_BROWSER_GEOLOCATION_DEVICE_DATA_PROVIDER_H_ 307 #endif // CONTENT_BROWSER_GEOLOCATION_DEVICE_DATA_PROVIDER_H_
OLDNEW
« no previous file with comments | « content/browser/DEPS ('k') | content/browser/geolocation/wifi_data_provider_chromeos.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698