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

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

Issue 2484773002: Store ref in field trial in child processes (Closed)
Patch Set: add comments Created 4 years, 1 month 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 | « no previous file | base/metrics/field_trial.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 // 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 589
590 std::map<std::string, std::string> seen_states_; 590 std::map<std::string, std::string> seen_states_;
591 591
592 // Entropy provider to be used for one-time randomized field trials. If NULL, 592 // Entropy provider to be used for one-time randomized field trials. If NULL,
593 // one-time randomization is not supported. 593 // one-time randomization is not supported.
594 std::unique_ptr<const FieldTrial::EntropyProvider> entropy_provider_; 594 std::unique_ptr<const FieldTrial::EntropyProvider> entropy_provider_;
595 595
596 // List of observers to be notified when a group is selected for a FieldTrial. 596 // List of observers to be notified when a group is selected for a FieldTrial.
597 scoped_refptr<ObserverListThreadSafe<Observer> > observer_list_; 597 scoped_refptr<ObserverListThreadSafe<Observer> > observer_list_;
598 598
599 // Allocator used to instantiate field trial in child processes. In the 599 // Allocator in shared memory containing field trial data. Used in both
600 // future, we may want to move this to a more generic place if we want to 600 // browser and child processes, but readonly in the child.
601 // start passing more data other than field trials. 601 // In the future, we may want to move this to a more generic place if we want
602 // to start passing more data other than field trials.
602 std::unique_ptr<SharedPersistentMemoryAllocator> field_trial_allocator_ = 603 std::unique_ptr<SharedPersistentMemoryAllocator> field_trial_allocator_ =
603 nullptr; 604 nullptr;
604 605
605 #if defined(OS_WIN) 606 #if defined(OS_WIN)
606 // Readonly copy of the handle to the allocator. Needs to be a member variable 607 // Readonly copy of the handle to the allocator. Needs to be a member variable
607 // because it's needed from both CopyFieldTrialStateToFlags() and 608 // because it's needed from both CopyFieldTrialStateToFlags() and
608 // AppendFieldTrialHandleIfNeeded(). 609 // AppendFieldTrialHandleIfNeeded().
609 HANDLE readonly_allocator_handle_ = nullptr; 610 HANDLE readonly_allocator_handle_ = nullptr;
610 #endif 611 #endif
611 612
612 DISALLOW_COPY_AND_ASSIGN(FieldTrialList); 613 DISALLOW_COPY_AND_ASSIGN(FieldTrialList);
613 }; 614 };
614 615
615 } // namespace base 616 } // namespace base
616 617
617 #endif // BASE_METRICS_FIELD_TRIAL_H_ 618 #endif // BASE_METRICS_FIELD_TRIAL_H_
OLDNEW
« no previous file with comments | « no previous file | base/metrics/field_trial.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698