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

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

Issue 16294003: Update content/ to use scoped_refptr<T>::get() rather than implicit "operator T*" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased Created 7 years, 6 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) 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 235 matching lines...) Expand 10 before | Expand all | Expand 10 after
246 DCHECK(this->CalledOnValidThread()); 246 DCHECK(this->CalledOnValidThread());
247 return impl_->GetData(data); 247 return impl_->GetData(data);
248 } 248 }
249 249
250 private: 250 private:
251 // Private constructor and destructor, callers access singleton through 251 // Private constructor and destructor, callers access singleton through
252 // Register and Unregister. 252 // Register and Unregister.
253 DeviceDataProvider() { 253 DeviceDataProvider() {
254 DCHECK(factory_function_); 254 DCHECK(factory_function_);
255 impl_ = (*factory_function_)(); 255 impl_ = (*factory_function_)();
256 DCHECK(impl_); 256 DCHECK(impl_.get());
257 impl_->SetContainer(this); 257 impl_->SetContainer(this);
258 } 258 }
259 virtual ~DeviceDataProvider() { 259 virtual ~DeviceDataProvider() {
260 DCHECK(impl_); 260 DCHECK(impl_.get());
261 impl_->SetContainer(NULL); 261 impl_->SetContainer(NULL);
262 } 262 }
263 263
264 void AddListener(ListenerInterface* listener) { 264 void AddListener(ListenerInterface* listener) {
265 impl_->AddListener(listener); 265 impl_->AddListener(listener);
266 } 266 }
267 267
268 bool RemoveListener(ListenerInterface* listener) { 268 bool RemoveListener(ListenerInterface* listener) {
269 return impl_->RemoveListener(listener); 269 return impl_->RemoveListener(listener);
270 } 270 }
(...skipping 25 matching lines...) Expand all
296 scoped_refptr<DeviceDataProviderImplBase<DataType> > impl_; 296 scoped_refptr<DeviceDataProviderImplBase<DataType> > impl_;
297 297
298 DISALLOW_COPY_AND_ASSIGN(DeviceDataProvider); 298 DISALLOW_COPY_AND_ASSIGN(DeviceDataProvider);
299 }; 299 };
300 300
301 typedef DeviceDataProvider<WifiData> WifiDataProvider; 301 typedef DeviceDataProvider<WifiData> WifiDataProvider;
302 302
303 } // namespace content 303 } // namespace content
304 304
305 #endif // CONTENT_BROWSER_GEOLOCATION_DEVICE_DATA_PROVIDER_H_ 305 #endif // CONTENT_BROWSER_GEOLOCATION_DEVICE_DATA_PROVIDER_H_
OLDNEW
« no previous file with comments | « content/browser/fileapi/fileapi_message_filter.cc ('k') | content/browser/geolocation/geolocation_dispatcher_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698