Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(375)

Unified Diff: chrome/browser/chrome_browser_main_win.cc

Issue 2756603002: Print too-long command line (Closed)
Patch Set: Remove now unneeded include Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/chrome_browser_main.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chrome_browser_main_win.cc
diff --git a/chrome/browser/chrome_browser_main_win.cc b/chrome/browser/chrome_browser_main_win.cc
index cd155a0ba66e8be91d535a1789fd95b472693bb0..631afa0b1cd822f96fc793346327f107e993caf5 100644
--- a/chrome/browser/chrome_browser_main_win.cc
+++ b/chrome/browser/chrome_browser_main_win.cc
@@ -425,7 +425,6 @@ void ChromeBrowserMainPartsWin::PrepareRestartOnCrashEnviroment(
// static
void ChromeBrowserMainPartsWin::RegisterApplicationRestart(
const base::CommandLine& parsed_command_line) {
- DCHECK(base::win::GetVersion() >= base::win::VERSION_VISTA);
base::ScopedNativeLibrary library(base::FilePath(L"kernel32.dll"));
// Get the function pointer for RegisterApplicationRestart.
RegisterApplicationRestartProc register_application_restart =
@@ -444,15 +443,17 @@ void ChromeBrowserMainPartsWin::RegisterApplicationRestart(
// Restart Chrome if the computer is restarted as the result of an update.
// This could be extended to handle crashes, hangs, and patches.
+ const auto& command_line_string = command_line.GetCommandLineString();
HRESULT hr = register_application_restart(
- command_line.GetCommandLineString().c_str(),
+ command_line_string.c_str(),
RESTART_NO_CRASH | RESTART_NO_HANG | RESTART_NO_PATCH);
if (FAILED(hr)) {
if (hr == E_INVALIDARG) {
- LOG(WARNING) << "Command line too long for RegisterApplicationRestart";
+ LOG(WARNING) << "Command line too long for RegisterApplicationRestart: "
+ << command_line_string;
} else {
- NOTREACHED() << "RegisterApplicationRestart failed. hr: " << hr <<
- ", command_line: " << command_line.GetCommandLineString();
+ NOTREACHED() << "RegisterApplicationRestart failed. hr: " << hr
+ << ", command_line: " << command_line_string;
}
}
}
« no previous file with comments | « chrome/browser/chrome_browser_main.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698