Commit 011b6142 authored by manzagop's avatar manzagop Committed by Commit bot

Desktop fast shutdown experiment

Set up an experiment to see the impact of always using the fast exit
path. For context, see https://groups.google.com/a/chromium.org/d/topic/chromium-dev/AMB2Y7Sqj48/discussion

Testing: launch with --enable-features=DesktopFastShutdown

BUG=653647

Review-Url: https://codereview.chromium.org/2528173003
Cr-Commit-Position: refs/heads/master@{#436328}
parent 6c65a58b
...@@ -384,6 +384,8 @@ split_static_library("browser") { ...@@ -384,6 +384,8 @@ split_static_library("browser") {
"favicon/favicon_utils.h", "favicon/favicon_utils.h",
"favicon/large_icon_service_factory.cc", "favicon/large_icon_service_factory.cc",
"favicon/large_icon_service_factory.h", "favicon/large_icon_service_factory.h",
"features.cc",
"features.h",
"file_select_helper.cc", "file_select_helper.cc",
"file_select_helper.h", "file_select_helper.h",
"file_select_helper_mac.mm", "file_select_helper_mac.mm",
......
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
#include "base/metrics/field_trial.h" #include "base/metrics/field_trial.h"
#include "base/metrics/histogram_macros.h" #include "base/metrics/histogram_macros.h"
#include "base/path_service.h" #include "base/path_service.h"
#include "chrome/browser/features.h"
#include "chrome/browser/prerender/prerender_field_trial.h" #include "chrome/browser/prerender/prerender_field_trial.h"
#include "chrome/common/chrome_paths.h" #include "chrome/common/chrome_paths.h"
#include "chrome/common/chrome_switches.h" #include "chrome/common/chrome_switches.h"
...@@ -112,6 +113,12 @@ void SetupDesktopFieldTrials(const base::CommandLine& parsed_command_line) { ...@@ -112,6 +113,12 @@ void SetupDesktopFieldTrials(const base::CommandLine& parsed_command_line) {
#if defined(OS_WIN) #if defined(OS_WIN)
SetupStabilityDebugging(); SetupStabilityDebugging();
#endif // defined(OS_WIN) #endif // defined(OS_WIN)
// Activate the experiment as early as possible to increase its visibility
// (e.g. the likelihood of its presence in the serialized system profile).
// This also needs to happen before the browser rendez-vous attempt
// (NotifyOtherProcessOrCreate) in PreMainMessageLoopRun so the corresponding
// metrics are tagged.
base::FeatureList::IsEnabled(features::kDesktopFastShutdown);
} }
} // namespace chrome } // namespace chrome
...@@ -176,7 +176,9 @@ ...@@ -176,7 +176,9 @@
#include "chrome/browser/metrics/thread_watcher_android.h" #include "chrome/browser/metrics/thread_watcher_android.h"
#include "ui/base/resource/resource_bundle_android.h" #include "ui/base/resource/resource_bundle_android.h"
#else #else
#include "chrome/browser/features.h"
#include "chrome/browser/feedback/feedback_profile_observer.h" #include "chrome/browser/feedback/feedback_profile_observer.h"
#include "chrome/browser/lifetime/application_lifetime.h"
#endif // defined(OS_ANDROID) #endif // defined(OS_ANDROID)
#if defined(OS_LINUX) && !defined(OS_CHROMEOS) #if defined(OS_LINUX) && !defined(OS_CHROMEOS)
...@@ -1982,6 +1984,12 @@ bool ChromeBrowserMainParts::MainMessageLoopRun(int* result_code) { ...@@ -1982,6 +1984,12 @@ bool ChromeBrowserMainParts::MainMessageLoopRun(int* result_code) {
g_browser_process->local_state()); g_browser_process->local_state());
run_loop.Run(); run_loop.Run();
if (base::FeatureList::IsEnabled(features::kDesktopFastShutdown)) {
// Experiment to determine the impact of always taking the quick exit path.
// There is no returning from this call as it terminates the process.
chrome::SessionEnding();
}
return true; return true;
#endif // defined(OS_ANDROID) #endif // defined(OS_ANDROID)
} }
......
// Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/browser/features.h"
namespace features {
const base::Feature kDesktopFastShutdown{"DesktopFastShutdown",
base::FEATURE_DISABLED_BY_DEFAULT};
} // namespace features
// Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Contains features that need inclusion from multiple files. Features used from
// a single .cc file should be declared in the file's anonymous namespace.
#ifndef CHROME_BROWSER_FEATURES_H_
#define CHROME_BROWSER_FEATURES_H_
#include "base/feature_list.h"
namespace features {
extern const base::Feature kDesktopFastShutdown;
} // namespace features
#endif // CHROME_BROWSER_FEATURES_H_
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment