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

Side by Side Diff: content/browser/device_orientation/message_filter.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, 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 #include "content/browser/device_orientation/message_filter.h" 5 #include "content/browser/device_orientation/message_filter.h"
6 6
7 #include "content/browser/device_orientation/observer_delegate.h" 7 #include "content/browser/device_orientation/observer_delegate.h"
8 #include "content/browser/device_orientation/provider.h" 8 #include "content/browser/device_orientation/provider.h"
9 #include "content/public/browser/browser_thread.h" 9 #include "content/public/browser/browser_thread.h"
10 10
11 namespace content { 11 namespace content {
12 12
13 DeviceOrientationMessageFilter::DeviceOrientationMessageFilter( 13 DeviceOrientationMessageFilter::DeviceOrientationMessageFilter(
14 DeviceData::Type device_data_type) 14 DeviceData::Type device_data_type)
15 : provider_(NULL), 15 : provider_(NULL),
16 device_data_type_(device_data_type) { 16 device_data_type_(device_data_type) {
17 } 17 }
18 18
19 DeviceOrientationMessageFilter::~DeviceOrientationMessageFilter() { 19 DeviceOrientationMessageFilter::~DeviceOrientationMessageFilter() {
20 } 20 }
21 21
22 void DeviceOrientationMessageFilter::OnStartUpdating(int render_view_id) { 22 void DeviceOrientationMessageFilter::OnStartUpdating(int render_view_id) {
23 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); 23 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
24 24
25 if (!provider_) 25 if (!provider_.get())
26 provider_ = Provider::GetInstance(); 26 provider_ = Provider::GetInstance();
27 27
28 observers_map_[render_view_id] = new ObserverDelegate(device_data_type_, 28 observers_map_[render_view_id] = new ObserverDelegate(
29 provider_, render_view_id, this); 29 device_data_type_, provider_.get(), render_view_id, this);
30 } 30 }
31 31
32 void DeviceOrientationMessageFilter::OnStopUpdating(int render_view_id) { 32 void DeviceOrientationMessageFilter::OnStopUpdating(int render_view_id) {
33 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); 33 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
34 34
35 observers_map_.erase(render_view_id); 35 observers_map_.erase(render_view_id);
36 } 36 }
37 37
38 } // namespace content 38 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698