diff options
author | jdonnelly <jdonnelly@chromium.org> | 2015-04-23 10:36:42 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-04-23 17:36:46 +0000 |
commit | 1376e275fae88cf2447bfedf1d66f5c8abb93ac6 (patch) | |
tree | f499acf95bab4e7cc139297389f9938d01d3bd81 /chrome/chrome_watcher | |
parent | 4f8553c40c59d75d8dafba60201aeb74d6c66a65 (diff) | |
download | chromium_src-1376e275fae88cf2447bfedf1d66f5c8abb93ac6.zip chromium_src-1376e275fae88cf2447bfedf1d66f5c8abb93ac6.tar.gz chromium_src-1376e275fae88cf2447bfedf1d66f5c8abb93ac6.tar.bz2 |
Revert of Send a crash report when a hung process is detected. (patchset #6 id:100001 of https://codereview.chromium.org/1060203004/)
Reason for revert:
Bot failure:
FAILED: E:/b/build/slave/Win_x64_GN/build/src/buildtools/win/gn.exe --root=E:/b/build/slave/Win_x64_GN/build/src -q gen //out/Release_x64/
ERROR Unresolved dependencies.
//chrome/chrome_watcher:chrome_watcher(//build/toolchain/win:64)
needs //chrome/chrome_watcher:installer_util(//build/toolchain/win:64)
Original issue's description:
> Send a crash report when a hung process is detected.
>
> BUG=478209
>
> Committed: https://crrev.com/8431e8f39edd5d7bff793f446035207fee6dacd1
> Cr-Commit-Position: refs/heads/master@{#326559}
TBR=siggi@chromium.org,grt@chromium.org,erikwright@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=478209
Review URL: https://codereview.chromium.org/1057363006
Cr-Commit-Position: refs/heads/master@{#326564}
Diffstat (limited to 'chrome/chrome_watcher')
-rw-r--r-- | chrome/chrome_watcher/BUILD.gn | 1 | ||||
-rw-r--r-- | chrome/chrome_watcher/DEPS | 1 | ||||
-rw-r--r-- | chrome/chrome_watcher/chrome_watcher.gypi | 1 | ||||
-rw-r--r-- | chrome/chrome_watcher/chrome_watcher_main.cc | 80 | ||||
-rw-r--r-- | chrome/chrome_watcher/chrome_watcher_main_api.h | 5 |
5 files changed, 8 insertions, 80 deletions
diff --git a/chrome/chrome_watcher/BUILD.gn b/chrome/chrome_watcher/BUILD.gn index 5a77ffd..db5f5e8 100644 --- a/chrome/chrome_watcher/BUILD.gn +++ b/chrome/chrome_watcher/BUILD.gn @@ -32,7 +32,6 @@ shared_library("chrome_watcher") { deps = [ ":chrome_watcher_resources", ":client", - ":installer_util", "//base", "//components/browser_watcher", ] diff --git a/chrome/chrome_watcher/DEPS b/chrome/chrome_watcher/DEPS index d7f5402..9b1e8bd 100644 --- a/chrome/chrome_watcher/DEPS +++ b/chrome/chrome_watcher/DEPS @@ -1,6 +1,5 @@ include_rules = [ "+base", - "+chrome/installer/util", "+components/browser_watcher", "+syzygy/kasko/api", ] diff --git a/chrome/chrome_watcher/chrome_watcher.gypi b/chrome/chrome_watcher/chrome_watcher.gypi index 9836501..8a4eaf3 100644 --- a/chrome/chrome_watcher/chrome_watcher.gypi +++ b/chrome/chrome_watcher/chrome_watcher.gypi @@ -61,7 +61,6 @@ 'dependencies': [ 'chrome_watcher_client', 'chrome_watcher_resources', - 'installer_util', '../base/base.gyp:base', '../components/components.gyp:browser_watcher', ], diff --git a/chrome/chrome_watcher/chrome_watcher_main.cc b/chrome/chrome_watcher/chrome_watcher_main.cc index c6db791..54da49c 100644 --- a/chrome/chrome_watcher/chrome_watcher_main.cc +++ b/chrome/chrome_watcher/chrome_watcher_main.cc @@ -8,7 +8,6 @@ #include "base/bind.h" #include "base/bind_helpers.h" #include "base/command_line.h" -#include "base/file_version_info.h" #include "base/files/file_path.h" #include "base/logging_win.h" #include "base/macros.h" @@ -18,17 +17,12 @@ #include "base/process/process.h" #include "base/run_loop.h" #include "base/sequenced_task_runner.h" -#include "base/strings/string16.h" -#include "base/strings/string_number_conversions.h" -#include "base/strings/string_piece.h" -#include "base/strings/utf_string_conversions.h" #include "base/synchronization/waitable_event.h" #include "base/template_util.h" #include "base/threading/thread.h" #include "base/time/time.h" #include "base/win/scoped_handle.h" #include "chrome/chrome_watcher/chrome_watcher_main_api.h" -#include "chrome/installer/util/util_constants.h" #include "components/browser_watcher/endsession_watcher_window_win.h" #include "components/browser_watcher/exit_code_watcher_win.h" #include "components/browser_watcher/exit_funnel_win.h" @@ -207,7 +201,6 @@ void BrowserMonitor::BrowserExited() { void OnWindowEvent( const base::string16& registry_path, base::Process process, - const base::Callback<void(const base::Process&)>& on_hung_callback, browser_watcher::WindowHangMonitor::WindowEvent window_event) { browser_watcher::ExitFunnel exit_funnel; if (exit_funnel.Init(registry_path.c_str(), process.Handle())) { @@ -217,8 +210,6 @@ void OnWindowEvent( break; case browser_watcher::WindowHangMonitor::WINDOW_HUNG: exit_funnel.RecordEvent(L"MessageWindowHung"); - if (!on_hung_callback.is_null()) - on_hung_callback.Run(process); break; case browser_watcher::WindowHangMonitor::WINDOW_VANISHED: exit_funnel.RecordEvent(L"MessageWindowVanished"); @@ -230,53 +221,6 @@ void OnWindowEvent( } } -#ifdef KASKO -void DumpHungBrowserProcess(const base::string16& channel, - const base::Process& process) { - // TODO(erikwright): Rather than recreating these crash keys here, it would be - // ideal to read them directly from the browser process. - - // This is looking up the version of chrome_watcher.dll, which is equivalent - // for our purposes to chrome.dll. - scoped_ptr<FileVersionInfo> version_info( - FileVersionInfo::CreateFileVersionInfoForModule( - reinterpret_cast<HMODULE>(&__ImageBase))); - using CrashKeyStrings = std::pair<base::string16, base::string16>; - std::vector<CrashKeyStrings> crash_key_strings; - if (version_info.get()) { - crash_key_strings.push_back( - CrashKeyStrings(L"prod", version_info->product_short_name())); - base::string16 version = version_info->product_version(); - if (!version_info->is_official_build()) - version.append(base::ASCIIToUTF16("-devel")); - crash_key_strings.push_back(CrashKeyStrings(L"ver", version)); - } else { - // No version info found. Make up the values. - crash_key_strings.push_back(CrashKeyStrings(L"prod", L"Chrome")); - crash_key_strings.push_back(CrashKeyStrings(L"ver", L"0.0.0.0-devel")); - } - crash_key_strings.push_back(CrashKeyStrings(L"channel", channel)); - crash_key_strings.push_back(CrashKeyStrings(L"plat", L"Win32")); - crash_key_strings.push_back(CrashKeyStrings(L"ptype", L"browser")); - crash_key_strings.push_back( - CrashKeyStrings(L"pid", base::IntToString16(process.Pid()))); - crash_key_strings.push_back(CrashKeyStrings(L"hung-process", L"1")); - - std::vector<const base::char16*> key_buffers; - std::vector<const base::char16*> value_buffers; - for (auto& strings : crash_key_strings) { - key_buffers.push_back(strings.first.c_str()); - value_buffers.push_back(strings.second.c_str()); - } - key_buffers.push_back(nullptr); - value_buffers.push_back(nullptr); - // TODO(erikwright): Make the dump-type channel-dependent. - kasko::api::SendReportForProcess(process.Handle(), - kasko::api::LARGER_DUMP_TYPE, - key_buffers.data(), value_buffers.data()); -} -#endif // KASKO - } // namespace // The main entry point to the watcher, declared as extern "C" to avoid name @@ -285,8 +229,7 @@ extern "C" int WatcherMain(const base::char16* registry_path, HANDLE process_handle, HANDLE on_initialized_event_handle, const base::char16* browser_data_directory, - const base::char16* message_window_name, - const base::char16* channel_name) { + const base::char16* message_window_name) { base::Process process(process_handle); base::win::ScopedHandle on_initialized_event(on_initialized_event_handle); @@ -301,8 +244,6 @@ extern "C" int WatcherMain(const base::char16* registry_path, // chrome.exe in order to report its exit status. ::SetProcessShutdownParameters(0x100, SHUTDOWN_NORETRY); - base::Callback<void(const base::Process&)> on_hung_callback; - #ifdef KASKO bool launched_kasko = kasko::api::InitializeReporter( GetKaskoEndpoint(process.Pid()).c_str(), @@ -315,10 +256,6 @@ extern "C" int WatcherMain(const base::char16* registry_path, .Append(kPermanentlyFailedReportsSubdir) .value() .c_str()); - if (launched_kasko && - base::StringPiece16(channel_name) == installer::kChromeChannelCanary) { - on_hung_callback = base::Bind(&DumpHungBrowserProcess, channel_name); - } #endif // KASKO // Run a UI message loop on the main thread. @@ -332,16 +269,13 @@ extern "C" int WatcherMain(const base::char16* registry_path, return 1; } - { - // Scoped to force |hang_monitor| destruction before Kasko is shut down. - browser_watcher::WindowHangMonitor hang_monitor( - base::TimeDelta::FromSeconds(60), base::TimeDelta::FromSeconds(20), - base::Bind(&OnWindowEvent, registry_path, - base::Passed(process.Duplicate()), on_hung_callback)); - hang_monitor.Initialize(process.Duplicate(), message_window_name); + browser_watcher::WindowHangMonitor hang_monitor( + base::TimeDelta::FromSeconds(60), base::TimeDelta::FromSeconds(20), + base::Bind(&OnWindowEvent, registry_path, + base::Passed(process.Duplicate()))); + hang_monitor.Initialize(process.Duplicate(), message_window_name); - run_loop.Run(); - } + run_loop.Run(); #ifdef KASKO if (launched_kasko) diff --git a/chrome/chrome_watcher/chrome_watcher_main_api.h b/chrome/chrome_watcher/chrome_watcher_main_api.h index d070a57..82cebdb 100644 --- a/chrome/chrome_watcher/chrome_watcher_main_api.h +++ b/chrome/chrome_watcher/chrome_watcher_main_api.h @@ -26,15 +26,12 @@ extern const base::FilePath::CharType kPermanentlyFailedReportsSubdir[]; // reports. |on_initialized_event| will be signaled once the watcher process is // fully initialized. Takes ownership of |parent_process| and // |on_initialized_event|. -// |channel_name| is the current Chrome distribution channel (one of -// installer::kChromeChannelXXX). typedef int (*ChromeWatcherMainFunction)( const base::char16* registry_path, HANDLE parent_process, HANDLE on_initialized_event, const base::char16* browser_data_directory, - const base::char16* message_window_name, - const base::char16* channel_name); + const base::char16* message_window_name); // Returns an RPC endpoint name for the identified client process. This method // may be invoked in both the client and the watcher process with the PID of the |