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

Side by Side Diff: base/metrics/field_trial.cc

Issue 2849243002: Get rid of all pid references from base::SharedMemoryHandle. (Closed)
Patch Set: fix invalid handle Chrome IPC. 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 unified diff | Download patch
« no previous file with comments | « base/memory/shared_memory_win.cc ('k') | ipc/ipc_message_utils.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/metrics/field_trial.h" 5 #include "base/metrics/field_trial.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/base_switches.h" 10 #include "base/base_switches.h"
(...skipping 1119 matching lines...) Expand 10 before | Expand all | Expand 10 after
1130 } 1130 }
1131 return entries; 1131 return entries;
1132 } 1132 }
1133 1133
1134 #if defined(OS_WIN) 1134 #if defined(OS_WIN)
1135 // static 1135 // static
1136 bool FieldTrialList::CreateTrialsFromHandleSwitch( 1136 bool FieldTrialList::CreateTrialsFromHandleSwitch(
1137 const std::string& handle_switch) { 1137 const std::string& handle_switch) {
1138 int field_trial_handle = std::stoi(handle_switch); 1138 int field_trial_handle = std::stoi(handle_switch);
1139 HANDLE handle = reinterpret_cast<HANDLE>(field_trial_handle); 1139 HANDLE handle = reinterpret_cast<HANDLE>(field_trial_handle);
1140 SharedMemoryHandle shm_handle(handle, GetCurrentProcId()); 1140 SharedMemoryHandle shm_handle(handle);
1141 return FieldTrialList::CreateTrialsFromSharedMemoryHandle(shm_handle); 1141 return FieldTrialList::CreateTrialsFromSharedMemoryHandle(shm_handle);
1142 } 1142 }
1143 #endif 1143 #endif
1144 1144
1145 #if defined(OS_POSIX) && !defined(OS_NACL) 1145 #if defined(OS_POSIX) && !defined(OS_NACL)
1146 // static 1146 // static
1147 bool FieldTrialList::CreateTrialsFromDescriptor(int fd_key) { 1147 bool FieldTrialList::CreateTrialsFromDescriptor(int fd_key) {
1148 if (!kUseSharedMemoryForFieldTrials) 1148 if (!kUseSharedMemoryForFieldTrials)
1149 return false; 1149 return false;
1150 1150
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
1353 return; 1353 return;
1354 } 1354 }
1355 AutoLock auto_lock(global_->lock_); 1355 AutoLock auto_lock(global_->lock_);
1356 CHECK(!global_->PreLockedFind(trial->trial_name())) << trial->trial_name(); 1356 CHECK(!global_->PreLockedFind(trial->trial_name())) << trial->trial_name();
1357 trial->AddRef(); 1357 trial->AddRef();
1358 trial->SetTrialRegistered(); 1358 trial->SetTrialRegistered();
1359 global_->registered_[trial->trial_name()] = trial; 1359 global_->registered_[trial->trial_name()] = trial;
1360 } 1360 }
1361 1361
1362 } // namespace base 1362 } // namespace base
OLDNEW
« no previous file with comments | « base/memory/shared_memory_win.cc ('k') | ipc/ipc_message_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698