summaryrefslogtreecommitdiffstats
path: root/chrome/browser/browser_main.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/browser_main.cc')
-rw-r--r--chrome/browser/browser_main.cc23
1 files changed, 22 insertions, 1 deletions
diff --git a/chrome/browser/browser_main.cc b/chrome/browser/browser_main.cc
index 790502f..179201d 100644
--- a/chrome/browser/browser_main.cc
+++ b/chrome/browser/browser_main.cc
@@ -618,6 +618,19 @@ OSStatus KeychainCallback(SecKeychainEvent keychain_event,
} // namespace
+#if defined(OS_WIN)
+#define DLLEXPORT __declspec(dllexport)
+
+// We use extern C for the prototype DLLEXPORT to avoid C++ name mangling.
+extern "C" {
+DLLEXPORT void __cdecl RelaunchChromeBrowserWithNewCommandLineIfNeeded();
+}
+
+DLLEXPORT void __cdecl RelaunchChromeBrowserWithNewCommandLineIfNeeded() {
+ Upgrade::RelaunchChromeBrowserWithNewCommandLineIfNeeded();
+}
+#endif
+
// Main routine for running as the Browser process.
int BrowserMain(const MainFunctionParams& parameters) {
const CommandLine& parsed_command_line = parameters.command_line_;
@@ -1177,7 +1190,7 @@ int BrowserMain(const MainFunctionParams& parameters) {
// the main message loop.
if (browser_init.Start(parsed_command_line, std::wstring(), profile,
&result_code)) {
-#if defined(OS_WIN)
+#if (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS)
// Initialize autoupdate timer. Timer callback costs basically nothing
// when browser is not in persistent mode, so it's OK to let it ride on
// the main thread. This needs to be done here because we don't want
@@ -1185,6 +1198,14 @@ int BrowserMain(const MainFunctionParams& parameters) {
g_browser_process->StartAutoupdateTimer();
#endif
+#if defined(OS_LINUX) && !defined(OS_CHROMEOS)
+ // On Linux, the running exe will be updated if an upgrade becomes
+ // available while the browser is running. We need to save the last
+ // modified time of the exe, so we can compare to determine if there is
+ // an upgrade while the browser is kept alive by a persistent extension.
+ Upgrade::SaveLastModifiedTimeOfExe();
+#endif
+
// Record now as the last succesful chrome start.
GoogleUpdateSettings::SetLastRunTime();
// Call Recycle() here as late as possible, before going into the loop