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

Unified Diff: content/browser/device_orientation/provider_impl.cc

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, 7 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
Index: content/browser/device_orientation/provider_impl.cc
diff --git a/content/browser/device_orientation/provider_impl.cc b/content/browser/device_orientation/provider_impl.cc
index 59bdebfbe43f8461198fa52005ea93893ca509c0..25e9bfd968769567b7a1d51b61e30e41634c15a9 100644
--- a/content/browser/device_orientation/provider_impl.cc
+++ b/content/browser/device_orientation/provider_impl.cc
@@ -89,7 +89,7 @@ void ProviderImpl::PollingThread::Initialize(DataFetcherFactory factory,
if (fetcher) {
scoped_refptr<const DeviceData> device_data(fetcher->GetDeviceData(type));
- if (device_data != NULL) {
+ if (device_data.get() != NULL) {
// Pass ownership of fetcher to provider_.
data_fetcher_.swap(fetcher);
last_device_data_map_[type] = device_data;
@@ -129,13 +129,13 @@ void ProviderImpl::PollingThread::DoPoll() {
scoped_refptr<const DeviceData> device_data(data_fetcher_->GetDeviceData(
device_data_type));
- if (device_data == NULL) {
+ if (device_data.get() == NULL) {
LOG(ERROR) << "Failed to poll device data fetcher.";
ScheduleDoNotify(NULL, device_data_type);
continue;
}
- const DeviceData* old_data = last_device_data_map_[device_data_type];
+ const DeviceData* old_data = last_device_data_map_[device_data_type].get();
if (old_data != NULL && !device_data->ShouldFireEvent(old_data))
continue;
@@ -197,7 +197,7 @@ void ProviderImpl::AddObserver(Observer* observer) {
Start(type);
else {
// Notify observer of most recent notification if one exists.
- const DeviceData *last_notification = last_notifications_map_[type];
+ const DeviceData* last_notification = last_notifications_map_[type].get();
if (last_notification != NULL)
observer->OnDeviceDataUpdate(last_notification, type);
}
@@ -273,7 +273,7 @@ void ProviderImpl::DoNotify(const scoped_refptr<const DeviceData>& data,
(*i)->OnDeviceDataUpdate(data.get(), device_data_type);
}
- if (data == NULL) {
+ if (data.get() == NULL) {
// Notify observers exactly once about failure to provide data.
typedef std::set<Observer*>::iterator Iterator;
Iterator i = observers_.begin();
« no previous file with comments | « content/browser/device_orientation/observer_delegate.cc ('k') | content/browser/device_orientation/provider_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698