OLD | NEW |
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 564 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
575 FRIEND_TEST_ALL_PREFIXES(FieldTrialListTest, AssociateFieldTrialParams); | 575 FRIEND_TEST_ALL_PREFIXES(FieldTrialListTest, AssociateFieldTrialParams); |
576 FRIEND_TEST_ALL_PREFIXES(FieldTrialListTest, ClearParamsFromSharedMemory); | 576 FRIEND_TEST_ALL_PREFIXES(FieldTrialListTest, ClearParamsFromSharedMemory); |
577 | 577 |
578 #if defined(OS_WIN) | 578 #if defined(OS_WIN) |
579 // Takes in |handle_switch| from the command line which represents the shared | 579 // Takes in |handle_switch| from the command line which represents the shared |
580 // memory handle for field trials, parses it, and creates the field trials. | 580 // memory handle for field trials, parses it, and creates the field trials. |
581 // Returns true on success, false on failure. | 581 // Returns true on success, false on failure. |
582 static bool CreateTrialsFromHandleSwitch(const std::string& handle_switch); | 582 static bool CreateTrialsFromHandleSwitch(const std::string& handle_switch); |
583 #endif | 583 #endif |
584 | 584 |
585 #if defined(OS_POSIX) && !defined(OS_NACL) && !defined(OS_MACOSX) && \ | 585 #if defined(OS_POSIX) && !defined(OS_NACL) && !defined(OS_ANDROID) |
586 !defined(OS_ANDROID) | |
587 // On POSIX systems that use the zygote, we look up the correct fd that backs | 586 // On POSIX systems that use the zygote, we look up the correct fd that backs |
588 // the shared memory segment containing the field trials by looking it up via | 587 // the shared memory segment containing the field trials by looking it up via |
589 // an fd key in GlobalDescriptors. Returns true on success, false on failure. | 588 // an fd key in GlobalDescriptors. Returns true on success, false on failure. |
590 static bool CreateTrialsFromDescriptor(int fd_key); | 589 static bool CreateTrialsFromDescriptor(int fd_key); |
591 #endif | 590 #endif |
592 | 591 |
593 // Takes an unmapped SharedMemoryHandle, creates a SharedMemory object from it | 592 // Takes an unmapped SharedMemoryHandle, creates a SharedMemory object from it |
594 // and maps it with the correct size. | 593 // and maps it with the correct size. |
595 static bool CreateTrialsFromSharedMemoryHandle(SharedMemoryHandle shm_handle); | 594 static bool CreateTrialsFromSharedMemoryHandle(SharedMemoryHandle shm_handle); |
596 | 595 |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
664 | 663 |
665 // Tracks whether CreateTrialsFromCommandLine() has been called. | 664 // Tracks whether CreateTrialsFromCommandLine() has been called. |
666 bool create_trials_from_command_line_called_ = false; | 665 bool create_trials_from_command_line_called_ = false; |
667 | 666 |
668 DISALLOW_COPY_AND_ASSIGN(FieldTrialList); | 667 DISALLOW_COPY_AND_ASSIGN(FieldTrialList); |
669 }; | 668 }; |
670 | 669 |
671 } // namespace base | 670 } // namespace base |
672 | 671 |
673 #endif // BASE_METRICS_FIELD_TRIAL_H_ | 672 #endif // BASE_METRICS_FIELD_TRIAL_H_ |
OLD | NEW |