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 525 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
536 // Notify all observers that a group has been finalized for |field_trial|. | 536 // Notify all observers that a group has been finalized for |field_trial|. |
537 static void NotifyFieldTrialGroupSelection(FieldTrial* field_trial); | 537 static void NotifyFieldTrialGroupSelection(FieldTrial* field_trial); |
538 | 538 |
539 // Return the number of active field trials. | 539 // Return the number of active field trials. |
540 static size_t GetFieldTrialCount(); | 540 static size_t GetFieldTrialCount(); |
541 | 541 |
542 private: | 542 private: |
543 // Allow tests to access our innards for testing purposes. | 543 // Allow tests to access our innards for testing purposes. |
544 FRIEND_TEST_ALL_PREFIXES(FieldTrialListTest, InstantiateAllocator); | 544 FRIEND_TEST_ALL_PREFIXES(FieldTrialListTest, InstantiateAllocator); |
545 FRIEND_TEST_ALL_PREFIXES(FieldTrialListTest, AddTrialsToAllocator); | 545 FRIEND_TEST_ALL_PREFIXES(FieldTrialListTest, AddTrialsToAllocator); |
| 546 FRIEND_TEST_ALL_PREFIXES(FieldTrialListTest, |
| 547 DoNotAddSimulatedFieldTrialsToAllocator); |
546 | 548 |
547 #if defined(OS_WIN) | 549 #if defined(OS_WIN) |
548 // Takes in |handle| that should have been retrieved from the command line and | 550 // Takes in |handle| that should have been retrieved from the command line and |
549 // creates a SharedMemoryHandle from it, and then calls | 551 // creates a SharedMemoryHandle from it, and then calls |
550 // CreateTrialsFromSharedMemory(). Returns true on success, false on failure. | 552 // CreateTrialsFromSharedMemory(). Returns true on success, false on failure. |
551 static bool CreateTrialsFromWindowsHandle(HANDLE handle); | 553 static bool CreateTrialsFromWindowsHandle(HANDLE handle); |
552 #endif | 554 #endif |
553 | 555 |
554 // Expects a mapped piece of shared memory |shm| that was created from the | 556 // Expects a mapped piece of shared memory |shm| that was created from the |
555 // browser process's field_trial_allocator and shared via the command line. | 557 // browser process's field_trial_allocator and shared via the command line. |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
620 // AppendFieldTrialHandleIfNeeded(). | 622 // AppendFieldTrialHandleIfNeeded(). |
621 HANDLE readonly_allocator_handle_ = nullptr; | 623 HANDLE readonly_allocator_handle_ = nullptr; |
622 #endif | 624 #endif |
623 | 625 |
624 DISALLOW_COPY_AND_ASSIGN(FieldTrialList); | 626 DISALLOW_COPY_AND_ASSIGN(FieldTrialList); |
625 }; | 627 }; |
626 | 628 |
627 } // namespace base | 629 } // namespace base |
628 | 630 |
629 #endif // BASE_METRICS_FIELD_TRIAL_H_ | 631 #endif // BASE_METRICS_FIELD_TRIAL_H_ |
OLD | NEW |