Chromium Code Reviews| 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..af125ffaf4d91d1dca331d85157b743d16740fb6 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. |
| @@ -91,9 +91,12 @@ class CONTENT_EXPORT DataFetcherSharedMemoryBase { |
| std::unique_ptr<PollingThread> polling_thread_; |
| - // Owning pointers. Objects in the map are deleted in dtor. |
| - typedef std::map<ConsumerType, base::SharedMemory*> SharedMemoryMap; |
| + typedef std::map<ConsumerType, mojo::ScopedSharedBufferHandle> |
| + SharedMemoryMap; |
| SharedMemoryMap shared_memory_map_; |
| + typedef std::map<ConsumerType, mojo::ScopedSharedBufferMapping> |
|
timvolodine
2016/06/09 17:43:47
why do we need two maps now? is there a way to jus
Sam McNally
2016/06/10 01:07:51
Mojo shared memory doesn't have anything that hold
timvolodine
2016/06/15 15:54:47
I see, was hoping mojo would provide something equ
|
| + SharedMemoryMappingMap; |
| + SharedMemoryMappingMap shared_memory_mapping_map_; |
| DISALLOW_COPY_AND_ASSIGN(DataFetcherSharedMemoryBase); |
| }; |