Commit 0367068f authored by Greg Thompson's avatar Greg Thompson Committed by Commit Bot

Remove dead breakpad code in browser relaunch codepath.

Once upon a time, Chrome used breakpad for handling crashes. When
restarting the browser after disabling crash reporting, it was once
important to clear the CHROME_BREAKPAD_PIPE_NAME environment variable to
be sure that the new process didn't connect to the old crash
handler. Chrome has since been migrated from breakpad to crashpad. As a
result, neither this env var nor the exported function in chrome.exe
exists.

BUG=546288,958865,1025634
R=bcwhite@chromium.org, mark@chromium.org

Change-Id: Ied7311016c208563613027603af2b03f349bd405
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1924469
Commit-Queue: Greg Thompson <grt@chromium.org>
Auto-Submit: Greg Thompson <grt@chromium.org>
Reviewed-by: default avatarMark Mentovai <mark@chromium.org>
Reviewed-by: default avatarBrian White <bcwhite@chromium.org>
Reviewed-by: default avatarDavid Roger <droger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#717590}
parent 0ee53b95
......@@ -7,10 +7,6 @@
#include <memory>
#include <string>
#if defined(OS_WIN)
#include <windows.h>
#endif
#include "base/bind.h"
#include "base/logging.h"
#include "base/process/process.h"
......@@ -61,7 +57,6 @@
#if defined(OS_WIN)
#include "base/win/win_util.h"
#include "chrome/browser/metrics/chrome_metrics_service_accessor.h"
#endif
namespace chrome {
......@@ -229,23 +224,6 @@ void AttemptUserExit() {
// The Android implementation is in application_lifetime_android.cc
#if !defined(OS_ANDROID)
void AttemptRestart() {
#if defined(OS_WIN)
// On Windows, Breakpad will upload crash reports if the breakpad pipe name
// environment variable is defined. So we undefine this environment variable
// before restarting, as the restarted processes will inherit their
// environment variables from ours, thus suppressing crash uploads.
if (!ChromeMetricsServiceAccessor::IsMetricsAndCrashReportingEnabled()) {
HMODULE exe_module = GetModuleHandle(kBrowserProcessExecutableName);
if (exe_module) {
typedef void (__cdecl *ClearBreakpadPipeEnvVar)();
ClearBreakpadPipeEnvVar clear = reinterpret_cast<ClearBreakpadPipeEnvVar>(
GetProcAddress(exe_module, "ClearBreakpadPipeEnvironmentVariable"));
if (clear)
clear();
}
}
#endif // defined(OS_WIN)
// TODO(beng): Can this use ProfileManager::GetLoadedProfiles instead?
for (auto* browser : *BrowserList::GetInstance())
content::BrowserContext::SaveSessionState(browser->profile());
......
......@@ -26,10 +26,6 @@ class CrashesDOMHandler;
class FlashDOMHandler;
}
namespace chrome {
void AttemptRestart();
}
namespace domain_reliability {
class DomainReliabilityServiceFactory;
}
......@@ -87,7 +83,6 @@ class ChromeMetricsServiceAccessor : public metrics::MetricsServiceAccessor {
private:
friend class ::CrashesDOMHandler;
friend class ::FlashDOMHandler;
friend void chrome::AttemptRestart();
friend class ChromeBrowserFieldTrials;
// For StackSamplingConfiguration.
friend class ChromeBrowserMainParts;
......
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