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

Unified Diff: base/memory/shared_memory.h

Issue 2775423003: Add ownership edges between HostSharedBitmap and shared memory
Patch Set: Fix comments Created 3 years, 9 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
« no previous file with comments | « base/BUILD.gn ('k') | base/memory/shared_memory_posix.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/memory/shared_memory.h
diff --git a/base/memory/shared_memory.h b/base/memory/shared_memory.h
index 4b66cc6edd2c61ab12d28a00e3b0d8a53daad877..952deec5f60f7aa0fdac26a99e2f2467efd831b6 100644
--- a/base/memory/shared_memory.h
+++ b/base/memory/shared_memory.h
@@ -265,9 +265,22 @@ class BASE_EXPORT SharedMemory {
}
};
- // Returns a unique ID for this shared memory's handle. Note this function may
+ // Returns a unique ID for the shared memory |handle|. Note this function may
// access file system and be slow.
- bool GetUniqueId(UniqueId* id) const;
+ static bool GetUniqueId(const SharedMemoryHandle& handle, UniqueId* id);
+#else
+ // TODO(hajimehoshi): On platforms other than POSIX, UniqueId and its getter
+ // are work in progress.
+ using UniqueId = int;
+
+ struct UniqueIdHash {
+ size_t operator()(const UniqueId& id) const { return id; }
+ };
+
+ static bool GetUniqueId(const SharedMemoryHandle& handle, UniqueId* id) {
+ *id = 0;
+ return true;
+ }
#endif
private:
« no previous file with comments | « base/BUILD.gn ('k') | base/memory/shared_memory_posix.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698