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

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

Issue 2546653002: Store and retrieve features from shared memory (Closed)
Patch Set: Created 4 years 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
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 // FieldTrial is a class for handling details of statistical experiments 5 // FieldTrial is a class for handling details of statistical experiments
6 // performed by actual users in the field (i.e., in a shipped or beta product). 6 // performed by actual users in the field (i.e., in a shipped or beta product).
7 // All code is called exclusively on the UI thread currently. 7 // All code is called exclusively on the UI thread currently.
8 // 8 //
9 // The simplest example is an experiment to see whether one of two options 9 // The simplest example is an experiment to see whether one of two options
10 // produces "better" results across our user population. In that scenario, UMA 10 // produces "better" results across our user population. In that scenario, UMA
(...skipping 578 matching lines...) Expand 10 before | Expand all | Expand 10 after
589 static bool CreateTrialsFromSharedMemory( 589 static bool CreateTrialsFromSharedMemory(
590 std::unique_ptr<base::SharedMemory> shm); 590 std::unique_ptr<base::SharedMemory> shm);
591 591
592 // Instantiate the field trial allocator, add all existing field trials to it, 592 // Instantiate the field trial allocator, add all existing field trials to it,
593 // and duplicates its handle to a read-only handle, which gets stored in 593 // and duplicates its handle to a read-only handle, which gets stored in
594 // |readonly_allocator_handle|. 594 // |readonly_allocator_handle|.
595 static void InstantiateFieldTrialAllocatorIfNeeded(); 595 static void InstantiateFieldTrialAllocatorIfNeeded();
596 596
597 // Adds the field trial to the allocator. Caller must hold a lock before 597 // Adds the field trial to the allocator. Caller must hold a lock before
598 // calling this. 598 // calling this.
599 static void AddToAllocatorWhileLocked(FieldTrial* field_trial); 599 static void AddTrialToAllocatorWhileLocked(FieldTrial* field_trial);
lawrencewu 2016/12/01 02:39:48 Let's rename this back to AddToAllocatorWhileLocke
lawrencewu 2016/12/01 18:47:11 Done.
600 600
601 // Activate the corresponding field trial entry struct in shared memory. 601 // Activate the corresponding field trial entry struct in shared memory.
602 static void ActivateFieldTrialEntryWhileLocked(FieldTrial* field_trial); 602 static void ActivateFieldTrialEntryWhileLocked(FieldTrial* field_trial);
603 603
604 // A map from FieldTrial names to the actual instances. 604 // A map from FieldTrial names to the actual instances.
605 typedef std::map<std::string, FieldTrial*> RegistrationMap; 605 typedef std::map<std::string, FieldTrial*> RegistrationMap;
606 606
607 // If one-time randomization is enabled, returns a weak pointer to the 607 // If one-time randomization is enabled, returns a weak pointer to the
608 // corresponding EntropyProvider. Otherwise, returns NULL. 608 // corresponding EntropyProvider. Otherwise, returns NULL.
609 static const FieldTrial::EntropyProvider* 609 static const FieldTrial::EntropyProvider*
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
651 651
652 // Tracks whether CreateTrialsFromCommandLine() has been called. 652 // Tracks whether CreateTrialsFromCommandLine() has been called.
653 bool create_trials_from_command_line_called_ = false; 653 bool create_trials_from_command_line_called_ = false;
654 654
655 DISALLOW_COPY_AND_ASSIGN(FieldTrialList); 655 DISALLOW_COPY_AND_ASSIGN(FieldTrialList);
656 }; 656 };
657 657
658 } // namespace base 658 } // namespace base
659 659
660 #endif // BASE_METRICS_FIELD_TRIAL_H_ 660 #endif // BASE_METRICS_FIELD_TRIAL_H_
OLDNEW
« base/feature_list.cc ('K') | « base/feature_list.cc ('k') | base/metrics/field_trial.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698