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

Unified Diff: content/browser/device_sensors/data_fetcher_shared_memory_base.h

Issue 2037513002: Convert device_sensors to use mojo. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@conversion--mime-registry
Patch Set: rebase Created 4 years, 6 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 side-by-side diff with in-line comments
Download patch
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..ab0355f1f3572d076918af3f87a5c94b1ff2ad84 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,8 +91,10 @@ 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,
+ std::pair<mojo::ScopedSharedBufferHandle,
+ mojo::ScopedSharedBufferMapping>>
+ SharedMemoryMap;
dcheng 2016/07/04 03:39:49 Nit: since we're changing this, let's update it to
Sam McNally 2016/07/04 08:31:38 Done.
SharedMemoryMap shared_memory_map_;
DISALLOW_COPY_AND_ASSIGN(DataFetcherSharedMemoryBase);

Powered by Google App Engine
This is Rietveld 408576698