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

Unified Diff: base/metrics/field_trial.cc

Issue 2845113005: Replace base::SharedMemory read-only methods with GetReadOnlyHandle. (Closed)
Patch Set: Comments from thakis. Created 3 years, 8 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: base/metrics/field_trial.cc
diff --git a/base/metrics/field_trial.cc b/base/metrics/field_trial.cc
index dba659e5dd5a3277fd4617242cfd6a0d3b6edf0a..af83f63cc3abb6540817e281f9996234a737b418 100644
--- a/base/metrics/field_trial.cc
+++ b/base/metrics/field_trial.cc
@@ -221,10 +221,8 @@ HANDLE CreateReadOnlyHandle(FieldTrialList::FieldTrialAllocator* allocator) {
#if defined(OS_POSIX) && !defined(OS_NACL)
int CreateReadOnlyHandle(FieldTrialList::FieldTrialAllocator* allocator) {
- SharedMemoryHandle new_handle;
- allocator->shared_memory()->ShareReadOnlyToProcess(GetCurrentProcessHandle(),
- &new_handle);
- return SharedMemory::GetFdFromSharedMemoryHandle(new_handle);
+ SharedMemoryHandle handle = allocator->shared_memory()->GetReadOnlyHandle();
+ return SharedMemory::GetFdFromSharedMemoryHandle(handle);
}
#endif
« no previous file with comments | « base/memory/shared_memory_win.cc ('k') | content/browser/renderer_host/clipboard_message_filter_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698