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 #include "chrome/common/pepper_flash.h" | 5 #include "chrome/common/pepper_flash.h" |
6 | 6 |
| 7 #include "base/memory/ref_counted.h" |
| 8 #include "base/metrics/field_trial.h" |
| 9 |
7 #include "ppapi/shared_impl/ppapi_permissions.h" | 10 #include "ppapi/shared_impl/ppapi_permissions.h" |
8 | 11 |
| 12 namespace { |
| 13 |
| 14 const char* const kIOFieldTrialName = "FlapperIOThread"; |
| 15 const char* const kPoolGroupName = "PoolThread"; |
| 16 const char* const kFileGroupName = "FileThread"; |
| 17 |
| 18 } // namespace |
| 19 |
| 20 void ActivatePepperFlashThreadFieldTrial() { |
| 21 static bool activated = false; |
| 22 if (activated) |
| 23 return; |
| 24 |
| 25 activated = true; |
| 26 |
| 27 // The field trial will expire on Jan 1st, 2014. |
| 28 scoped_refptr<base::FieldTrial> trial( |
| 29 base::FieldTrialList::FactoryGetFieldTrial( |
| 30 kIOFieldTrialName, 1000, kPoolGroupName, 2014, 1, 1, |
| 31 NULL)); |
| 32 |
| 33 // 50% goes into the FILE thread group. |
| 34 trial->AppendGroup(kFileGroupName, 500); |
| 35 } |
| 36 |
9 bool ConductingPepperFlashFieldTrial() { | 37 bool ConductingPepperFlashFieldTrial() { |
10 #if defined(OS_WIN) | 38 #if defined(OS_WIN) |
11 return true; | 39 return true; |
12 #elif defined(OS_MACOSX) | 40 #elif defined(OS_MACOSX) |
13 return true; | 41 return true; |
14 #else | 42 #else |
15 return false; | 43 return false; |
16 #endif | 44 #endif |
17 } | 45 } |
18 | 46 |
(...skipping 11 matching lines...) Expand all Loading... |
30 #else | 58 #else |
31 return false; | 59 return false; |
32 #endif | 60 #endif |
33 } | 61 } |
34 | 62 |
35 int32 kPepperFlashPermissions = ppapi::PERMISSION_DEV | | 63 int32 kPepperFlashPermissions = ppapi::PERMISSION_DEV | |
36 ppapi::PERMISSION_PRIVATE | | 64 ppapi::PERMISSION_PRIVATE | |
37 ppapi::PERMISSION_BYPASS_USER_GESTURE; | 65 ppapi::PERMISSION_BYPASS_USER_GESTURE; |
38 | 66 |
39 | 67 |
OLD | NEW |