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

Side by Side Diff: content/browser/device_sensors/data_fetcher_shared_memory_base.h

Issue 1874893002: Convert //content/browser from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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_SENSORS_DATA_FETCHER_SHARED_MEMORY_BASE_H_ 5 #ifndef CONTENT_BROWSER_DEVICE_SENSORS_DATA_FETCHER_SHARED_MEMORY_BASE_H_
6 #define CONTENT_BROWSER_DEVICE_SENSORS_DATA_FETCHER_SHARED_MEMORY_BASE_H_ 6 #define CONTENT_BROWSER_DEVICE_SENSORS_DATA_FETCHER_SHARED_MEMORY_BASE_H_
7 7
8 #include <map> 8 #include <map>
9 #include <memory>
9 10
10 #include "base/macros.h" 11 #include "base/macros.h"
11 #include "base/memory/scoped_ptr.h"
12 #include "base/memory/shared_memory.h" 12 #include "base/memory/shared_memory.h"
13 #include "base/message_loop/message_loop.h" 13 #include "base/message_loop/message_loop.h"
14 #include "content/browser/device_sensors/device_sensors_consts.h" 14 #include "content/browser/device_sensors/device_sensors_consts.h"
15 #include "content/common/content_export.h" 15 #include "content/common/content_export.h"
16 16
17 namespace content { 17 namespace content {
18 18
19 // Sensor data fetchers should derive from this base class and implement 19 // Sensor data fetchers should derive from this base class and implement
20 // the abstract Start() and Stop() methods. 20 // the abstract Start() and Stop() methods.
21 // If the fetcher requires polling it should also implement IsPolling() 21 // If the fetcher requires polling it should also implement IsPolling()
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 82
83 bool IsPollingTimerRunningForTesting() const; 83 bool IsPollingTimerRunningForTesting() const;
84 84
85 private: 85 private:
86 bool InitAndStartPollingThreadIfNecessary(); 86 bool InitAndStartPollingThreadIfNecessary();
87 base::SharedMemory* GetSharedMemory(ConsumerType consumer_type); 87 base::SharedMemory* GetSharedMemory(ConsumerType consumer_type);
88 void* GetSharedMemoryBuffer(ConsumerType consumer_type); 88 void* GetSharedMemoryBuffer(ConsumerType consumer_type);
89 89
90 unsigned started_consumers_; 90 unsigned started_consumers_;
91 91
92 scoped_ptr<PollingThread> polling_thread_; 92 std::unique_ptr<PollingThread> polling_thread_;
93 93
94 // Owning pointers. Objects in the map are deleted in dtor. 94 // Owning pointers. Objects in the map are deleted in dtor.
95 typedef std::map<ConsumerType, base::SharedMemory*> SharedMemoryMap; 95 typedef std::map<ConsumerType, base::SharedMemory*> SharedMemoryMap;
96 SharedMemoryMap shared_memory_map_; 96 SharedMemoryMap shared_memory_map_;
97 97
98 DISALLOW_COPY_AND_ASSIGN(DataFetcherSharedMemoryBase); 98 DISALLOW_COPY_AND_ASSIGN(DataFetcherSharedMemoryBase);
99 }; 99 };
100 100
101 } // namespace content 101 } // namespace content
102 102
103 #endif // CONTENT_BROWSER_DEVICE_SENSORS_DATA_FETCHER_SHARED_MEMORY_BASE_H_ 103 #endif // CONTENT_BROWSER_DEVICE_SENSORS_DATA_FETCHER_SHARED_MEMORY_BASE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698