| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/browser/chrome_browser_field_trials_desktop.h" | 5 #include "chrome/browser/chrome_browser_field_trials_desktop.h" |
| 6 | 6 |
| 7 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
| 8 #include <windows.h> | 8 #include <windows.h> |
| 9 #endif | 9 #endif |
| 10 | 10 |
| 11 #include <map> | 11 #include <map> |
| 12 #include <string> | 12 #include <string> |
| 13 | 13 |
| 14 #include "base/command_line.h" | 14 #include "base/command_line.h" |
| 15 #include "base/debug/activity_tracker.h" | 15 #include "base/debug/activity_tracker.h" |
| 16 #include "base/feature_list.h" | 16 #include "base/feature_list.h" |
| 17 #include "base/files/file_util.h" | 17 #include "base/files/file_util.h" |
| 18 #include "base/metrics/field_trial.h" | 18 #include "base/metrics/field_trial.h" |
| 19 #include "base/metrics/histogram_macros.h" | 19 #include "base/metrics/histogram_macros.h" |
| 20 #include "base/path_service.h" | 20 #include "base/path_service.h" |
| 21 #include "base/time/time.h" |
| 21 #include "chrome/browser/features.h" | 22 #include "chrome/browser/features.h" |
| 22 #include "chrome/browser/prerender/prerender_field_trial.h" | 23 #include "chrome/browser/prerender/prerender_field_trial.h" |
| 23 #include "chrome/common/chrome_features.h" | 24 #include "chrome/common/chrome_features.h" |
| 24 #include "chrome/common/chrome_paths.h" | 25 #include "chrome/common/chrome_paths.h" |
| 25 #include "chrome/common/chrome_switches.h" | 26 #include "chrome/common/chrome_switches.h" |
| 26 #include "components/browser_watcher/features.h" | 27 #include "components/browser_watcher/features.h" |
| 27 #include "components/browser_watcher/stability_debugging.h" | 28 #include "components/browser_watcher/stability_debugging.h" |
| 28 #include "components/variations/variations_associated_data.h" | 29 #include "components/variations/variations_associated_data.h" |
| 29 #include "content/public/common/content_switches.h" | 30 #include "content/public/common/content_switches.h" |
| 30 #include "media/media_features.h" | 31 #include "media/media_features.h" |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 global_data.SetString(browser_watcher::kStabilityProduct, product_name); | 168 global_data.SetString(browser_watcher::kStabilityProduct, product_name); |
| 168 global_data.SetString(browser_watcher::kStabilityVersion, version_number); | 169 global_data.SetString(browser_watcher::kStabilityVersion, version_number); |
| 169 global_data.SetString(browser_watcher::kStabilityChannel, channel_name); | 170 global_data.SetString(browser_watcher::kStabilityChannel, channel_name); |
| 170 global_data.SetString(browser_watcher::kStabilitySpecialBuild, | 171 global_data.SetString(browser_watcher::kStabilitySpecialBuild, |
| 171 special_build); | 172 special_build); |
| 172 #if defined(ARCH_CPU_X86) | 173 #if defined(ARCH_CPU_X86) |
| 173 global_data.SetString(browser_watcher::kStabilityPlatform, "Win32"); | 174 global_data.SetString(browser_watcher::kStabilityPlatform, "Win32"); |
| 174 #elif defined(ARCH_CPU_X86_64) | 175 #elif defined(ARCH_CPU_X86_64) |
| 175 global_data.SetString(browser_watcher::kStabilityPlatform, "Win64"); | 176 global_data.SetString(browser_watcher::kStabilityPlatform, "Win64"); |
| 176 #endif | 177 #endif |
| 178 global_data.SetInt(browser_watcher::kStabilityStartTimestamp, |
| 179 base::Time::Now().ToInternalValue()); |
| 177 | 180 |
| 178 // Record information about chrome's module. We want this to be done early. | 181 // Record information about chrome's module. We want this to be done early. |
| 179 RecordChromeModuleInfo(global_tracker); | 182 RecordChromeModuleInfo(global_tracker); |
| 180 | 183 |
| 181 // Trigger a flush of the memory mapped file to maximize the chances of | 184 // Trigger a flush of the memory mapped file to maximize the chances of |
| 182 // having a minimal amount of content in the stability file, even if | 185 // having a minimal amount of content in the stability file, even if |
| 183 // the system crashes or loses power. Note: this does not flush the file | 186 // the system crashes or loses power. Note: this does not flush the file |
| 184 // metadata nor does it wait for the changes to be flushed to disk before | 187 // metadata nor does it wait for the changes to be flushed to disk before |
| 185 // returning. This is an expensive operation. Run as an experiment to | 188 // returning. This is an expensive operation. Run as an experiment to |
| 186 // measure the effect on performance and collection. | 189 // measure the effect on performance and collection. |
| (...skipping 16 matching lines...) Expand all Loading... |
| 203 #endif // defined(OS_WIN) | 206 #endif // defined(OS_WIN) |
| 204 // Activate the experiment as early as possible to increase its visibility | 207 // Activate the experiment as early as possible to increase its visibility |
| 205 // (e.g. the likelihood of its presence in the serialized system profile). | 208 // (e.g. the likelihood of its presence in the serialized system profile). |
| 206 // This also needs to happen before the browser rendez-vous attempt | 209 // This also needs to happen before the browser rendez-vous attempt |
| 207 // (NotifyOtherProcessOrCreate) in PreMainMessageLoopRun so the corresponding | 210 // (NotifyOtherProcessOrCreate) in PreMainMessageLoopRun so the corresponding |
| 208 // metrics are tagged. | 211 // metrics are tagged. |
| 209 base::FeatureList::IsEnabled(features::kDesktopFastShutdown); | 212 base::FeatureList::IsEnabled(features::kDesktopFastShutdown); |
| 210 } | 213 } |
| 211 | 214 |
| 212 } // namespace chrome | 215 } // namespace chrome |
| OLD | NEW |