Index: content/browser/device_sensors/data_fetcher_shared_memory_base.h |
diff --git a/content/browser/device_sensors/data_fetcher_shared_memory_base.h b/content/browser/device_sensors/data_fetcher_shared_memory_base.h |
index f6431f82ffeb4691c1d050ec963e2c0bc1e9ca88..f8326aac03791e2272280f3d97db6e450aa4539f 100644 |
--- a/content/browser/device_sensors/data_fetcher_shared_memory_base.h |
+++ b/content/browser/device_sensors/data_fetcher_shared_memory_base.h |
@@ -13,6 +13,7 @@ |
#include "base/message_loop/message_loop.h" |
#include "content/browser/device_sensors/device_sensors_consts.h" |
#include "content/common/content_export.h" |
+#include "mojo/public/cpp/system/buffer.h" |
namespace content { |
@@ -36,12 +37,11 @@ class CONTENT_EXPORT DataFetcherSharedMemoryBase { |
// sensors are unregistered. |
virtual void Shutdown(); |
- // Returns the shared memory handle of the device sensor data |
- // duplicated into the given process. This method should only be |
- // called after a call to StartFetchingDeviceData method with |
+ // Returns the shared memory handle of the device sensor data. This method |
+ // should only be called after a call to StartFetchingDeviceData method with |
// corresponding |consumer_type| parameter. |
- base::SharedMemoryHandle GetSharedMemoryHandleForProcess( |
- ConsumerType consumer_type, base::ProcessHandle process); |
+ mojo::ScopedSharedBufferHandle GetSharedMemoryHandle( |
+ ConsumerType consumer_type); |
enum FetcherType { |
// Fetcher runs on the same thread as its creator. |
@@ -84,15 +84,15 @@ class CONTENT_EXPORT DataFetcherSharedMemoryBase { |
private: |
bool InitAndStartPollingThreadIfNecessary(); |
- base::SharedMemory* GetSharedMemory(ConsumerType consumer_type); |
void* GetSharedMemoryBuffer(ConsumerType consumer_type); |
unsigned started_consumers_; |
std::unique_ptr<PollingThread> polling_thread_; |
- // Owning pointers. Objects in the map are deleted in dtor. |
- typedef std::map<ConsumerType, base::SharedMemory*> SharedMemoryMap; |
+ using SharedMemoryMap = std::map<ConsumerType, |
+ std::pair<mojo::ScopedSharedBufferHandle, |
+ mojo::ScopedSharedBufferMapping>>; |
SharedMemoryMap shared_memory_map_; |
DISALLOW_COPY_AND_ASSIGN(DataFetcherSharedMemoryBase); |