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

Side by Side Diff: content/browser/device_orientation/data_fetcher_shared_memory.h

Issue 23441047: Fix race condition in DataFetcherSharedMemoryBase (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 3 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
« no previous file with comments | « no previous file | content/browser/device_orientation/data_fetcher_shared_memory_android.cc » ('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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 #ifndef CONTENT_BROWSER_DEVICE_ORIENTATION_DATA_FETCHER_SHARED_MEMORY_H_ 5 #ifndef CONTENT_BROWSER_DEVICE_ORIENTATION_DATA_FETCHER_SHARED_MEMORY_H_
6 #define CONTENT_BROWSER_DEVICE_ORIENTATION_DATA_FETCHER_SHARED_MEMORY_H_ 6 #define CONTENT_BROWSER_DEVICE_ORIENTATION_DATA_FETCHER_SHARED_MEMORY_H_
7 7
8 #include "content/browser/device_orientation/data_fetcher_shared_memory_base.h" 8 #include "content/browser/device_orientation/data_fetcher_shared_memory_base.h"
9 9
10 #if defined(OS_MACOSX) 10 #if !defined(OS_ANDROID)
11 #include "content/common/device_motion_hardware_buffer.h" 11 #include "content/common/device_motion_hardware_buffer.h"
12 #include "content/common/device_orientation/device_orientation_hardware_buffer.h " 12 #include "content/common/device_orientation/device_orientation_hardware_buffer.h "
13 #endif
13 14
15 #if defined(OS_MACOSX)
14 class SuddenMotionSensor; 16 class SuddenMotionSensor;
15 #endif 17 #endif
16 18
17 namespace content { 19 namespace content {
18 20
19 class CONTENT_EXPORT DataFetcherSharedMemory 21 class CONTENT_EXPORT DataFetcherSharedMemory
20 : public DataFetcherSharedMemoryBase { 22 : public DataFetcherSharedMemoryBase {
21 23
22 public: 24 public:
23 DataFetcherSharedMemory(); 25 DataFetcherSharedMemory();
24 virtual ~DataFetcherSharedMemory(); 26 virtual ~DataFetcherSharedMemory();
25 27
26 private: 28 private:
27 29 virtual bool Start(ConsumerType consumer_type, void* buffer) OVERRIDE;
28 virtual bool Start(ConsumerType consumer_type) OVERRIDE;
29 virtual bool Stop(ConsumerType consumer_type) OVERRIDE; 30 virtual bool Stop(ConsumerType consumer_type) OVERRIDE;
30 31
32 #if !defined(OS_ANDROID)
33 DeviceMotionHardwareBuffer* motion_buffer_;
34 DeviceOrientationHardwareBuffer* orientation_buffer_;
35 #endif
31 #if defined(OS_MACOSX) 36 #if defined(OS_MACOSX)
32 virtual void Fetch(unsigned consumer_bitmask) OVERRIDE; 37 virtual void Fetch(unsigned consumer_bitmask) OVERRIDE;
33 virtual bool IsPolling() const OVERRIDE; 38 virtual bool IsPolling() const OVERRIDE;
34 39
35 DeviceMotionHardwareBuffer* motion_buffer_;
36 DeviceOrientationHardwareBuffer* orientation_buffer_;
37 scoped_ptr<SuddenMotionSensor> sudden_motion_sensor_; 40 scoped_ptr<SuddenMotionSensor> sudden_motion_sensor_;
38 #endif 41 #endif
39 42
40 DISALLOW_COPY_AND_ASSIGN(DataFetcherSharedMemory); 43 DISALLOW_COPY_AND_ASSIGN(DataFetcherSharedMemory);
41 }; 44 };
42 45
43 } // namespace content 46 } // namespace content
44 47
45 #endif // CONTENT_BROWSER_DEVICE_ORIENTATION_DATA_FETCHER_SHARED_MEMORY_H_ 48 #endif // CONTENT_BROWSER_DEVICE_ORIENTATION_DATA_FETCHER_SHARED_MEMORY_H_
OLDNEW
« no previous file with comments | « no previous file | content/browser/device_orientation/data_fetcher_shared_memory_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698