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

Unified Diff: base/metrics/field_trial.cc

Issue 2859843002: Add a GUID to base::SharedMemoryHandle. (Closed)
Patch Set: fix guid on android. Created 3 years, 7 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/memory/shared_memory_win.cc ('k') | chrome/gpu/arc_gpu_video_decode_accelerator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/metrics/field_trial.cc
diff --git a/base/metrics/field_trial.cc b/base/metrics/field_trial.cc
index e6274bb5c91c181784b51f5ad5f706458a420eba..78602f1e613d39f00020dea6f1f18f093bcfa72f 100644
--- a/base/metrics/field_trial.cc
+++ b/base/metrics/field_trial.cc
@@ -19,6 +19,7 @@
#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"
#include "base/strings/utf_string_conversions.h"
+#include "base/unguessable_token.h"
// On POSIX, the fd is shared using the mapping in GlobalDescriptors.
#if defined(OS_POSIX) && !defined(OS_NACL)
@@ -1137,7 +1138,9 @@ bool FieldTrialList::CreateTrialsFromHandleSwitch(
const std::string& handle_switch) {
int field_trial_handle = std::stoi(handle_switch);
HANDLE handle = reinterpret_cast<HANDLE>(field_trial_handle);
- SharedMemoryHandle shm_handle(handle);
+ // TODO(erikchen): Plumb a GUID for this SharedMemoryHandle.
+ // https://crbug.com/713763.
+ SharedMemoryHandle shm_handle(handle, base::UnguessableToken::Create());
return FieldTrialList::CreateTrialsFromSharedMemoryHandle(shm_handle);
}
#endif
@@ -1155,7 +1158,10 @@ bool FieldTrialList::CreateTrialsFromDescriptor(int fd_key) {
if (fd == -1)
return false;
- SharedMemoryHandle shm_handle(FileDescriptor(fd, true));
+ // TODO(erikchen): Plumb a GUID for this SharedMemoryHandle.
+ // https://crbug.com/713763.
+ SharedMemoryHandle shm_handle(FileDescriptor(fd, true),
+ base::UnguessableToken::Create());
bool result = FieldTrialList::CreateTrialsFromSharedMemoryHandle(shm_handle);
DCHECK(result);
« no previous file with comments | « base/memory/shared_memory_win.cc ('k') | chrome/gpu/arc_gpu_video_decode_accelerator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698