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

Unified Diff: content/browser/device_orientation/data_fetcher_shared_memory_base.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 side-by-side diff with in-line comments
Download patch
Index: content/browser/device_orientation/data_fetcher_shared_memory_base.h
diff --git a/content/browser/device_orientation/data_fetcher_shared_memory_base.h b/content/browser/device_orientation/data_fetcher_shared_memory_base.h
index 0315f08b547b85b3b6af4926eaab252003a2dbdf..a3c3c58712081464dbeb7374fabe7b97cf541f7b 100644
--- a/content/browser/device_orientation/data_fetcher_shared_memory_base.h
+++ b/content/browser/device_orientation/data_fetcher_shared_memory_base.h
@@ -45,8 +45,6 @@ class CONTENT_EXPORT DataFetcherSharedMemoryBase {
DataFetcherSharedMemoryBase();
virtual ~DataFetcherSharedMemoryBase();
- void* GetSharedMemoryBuffer(ConsumerType consumer_type);
-
// Returns the message loop of the polling thread.
// Returns NULL if there is no polling thread.
base::MessageLoop* GetPollingMessageLoop() const;
@@ -62,12 +60,13 @@ class CONTENT_EXPORT DataFetcherSharedMemoryBase {
// Start() method should call InitSharedMemoryBuffer() to get the shared
// memory pointer. If IsPolling() is true both Start() and Stop() methods
// are called from the |polling_thread_|.
- virtual bool Start(ConsumerType consumer_type) = 0;
+ virtual bool Start(ConsumerType consumer_type, void* buffer) = 0;
virtual bool Stop(ConsumerType consumer_type) = 0;
private:
bool InitAndStartPollingThreadIfNecessary();
base::SharedMemory* GetSharedMemory(ConsumerType consumer_type);
+ void* GetSharedMemoryBuffer(ConsumerType consumer_type);
unsigned started_consumers_;

Powered by Google App Engine
This is Rietveld 408576698