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

Side by Side Diff: content/browser/device_orientation/message_filter.cc

Issue 20707002: Implement Device Orientation using shared memory in content/renderer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: excluded orientation pump tests on win bots Created 7 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
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 DeviceOrientationMessageFilterOld::DeviceOrientationMessageFilterOld(
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 DeviceOrientationMessageFilterOld::~DeviceOrientationMessageFilterOld() {
20 } 20 }
21 21
22 void DeviceOrientationMessageFilter::OnStartUpdating(int render_view_id) { 22 void DeviceOrientationMessageFilterOld::OnStartUpdating(int render_view_id) {
23 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); 23 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
24 24
25 if (!provider_.get()) 25 if (!provider_.get())
26 provider_ = Provider::GetInstance(); 26 provider_ = Provider::GetInstance();
27 27
28 observers_map_[render_view_id] = new ObserverDelegate( 28 observers_map_[render_view_id] = new ObserverDelegate(
29 device_data_type_, provider_.get(), 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 DeviceOrientationMessageFilterOld::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
« no previous file with comments | « content/browser/device_orientation/message_filter.h ('k') | content/browser/device_orientation/orientation.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698