diff options
author | prasadt@chromium.org <prasadt@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-30 18:55:53 +0000 |
---|---|---|
committer | prasadt@chromium.org <prasadt@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-30 18:55:53 +0000 |
commit | 3cdacd4e6a2ca4c305c591dac8176828ae2e2b62 (patch) | |
tree | b5c51b6e0db2c1aadb03e80b148b3b9a0c9ef4f6 /chrome/app | |
parent | 980539163f30d19e5adff1538122b1ea6a0e4803 (diff) | |
download | chromium_src-3cdacd4e6a2ca4c305c591dac8176828ae2e2b62.zip chromium_src-3cdacd4e6a2ca4c305c591dac8176828ae2e2b62.tar.gz chromium_src-3cdacd4e6a2ca4c305c591dac8176828ae2e2b62.tar.bz2 |
r46025 reverted r46023 which caused a build break on chromeos.
This change reverts r46025 and fixes the build break which is just a one line
change in chrome/browser/first_run_gtk.cc to move the definition of
Upgrade::new_command_line_ to be inside a #if. Details on the change and code
review feedback for the original CL can be found at
http://codereview.chromium.org/1633021.
BUG=40975
TEST=none
Review URL: http://codereview.chromium.org/1691022
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@46103 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/app')
-rw-r--r-- | chrome/app/chrome_exe_main.cc | 1 | ||||
-rw-r--r-- | chrome/app/chrome_exe_main_gtk.cc | 13 | ||||
-rw-r--r-- | chrome/app/client_util.cc | 15 | ||||
-rw-r--r-- | chrome/app/client_util.h | 4 |
4 files changed, 32 insertions, 1 deletions
diff --git a/chrome/app/chrome_exe_main.cc b/chrome/app/chrome_exe_main.cc index fdd2cac..ed4c263 100644 --- a/chrome/app/chrome_exe_main.cc +++ b/chrome/app/chrome_exe_main.cc @@ -44,6 +44,7 @@ int APIENTRY wWinMain(HINSTANCE instance, HINSTANCE, wchar_t*, int) { // Load and launch the chrome dll. *Everything* happens inside. MainDllLoader* loader = MakeMainDllLoader(); int rc = loader->Launch(instance, &sandbox_info); + loader->RelaunchChromeBrowserWithNewCommandLineIfNeeded(); delete loader; return rc; diff --git a/chrome/app/chrome_exe_main_gtk.cc b/chrome/app/chrome_exe_main_gtk.cc index 0ed9e15..fb3c332 100644 --- a/chrome/app/chrome_exe_main_gtk.cc +++ b/chrome/app/chrome_exe_main_gtk.cc @@ -4,6 +4,9 @@ #include "base/at_exit.h" #include "base/process_util.h" +#if defined(OS_LINUX) && !defined(OS_CHROMEOS) +#include "chrome/browser/first_run.h" +#endif // The entry point for all invocations of Chromium, browser and renderer. On // windows, this does nothing but load chrome.dll and invoke its entry point in @@ -44,5 +47,13 @@ int main(int argc, const char** argv) { // keep it. // base::AtExitManager exit_manager; - return ChromeMain(argc, argv); + int return_code = ChromeMain(argc, argv); + +#if defined(OS_LINUX) && !defined(OS_CHROMEOS) + // Launch a new instance if we're shutting down because we detected an + // upgrade in the persistent mode. + Upgrade::RelaunchChromeBrowserWithNewCommandLineIfNeeded(); +#endif + + return return_code; } diff --git a/chrome/app/client_util.cc b/chrome/app/client_util.cc index 074b6c8..c822ec8 100644 --- a/chrome/app/client_util.cc +++ b/chrome/app/client_util.cc @@ -18,6 +18,8 @@ namespace { // The entry point signature of chrome.dll. typedef int (*DLL_MAIN)(HINSTANCE, sandbox::SandboxInterfaceInfo*, wchar_t*); +typedef void (*RelaunchChromeBrowserWithNewCommandLineIfNeededFunc)(); + // Not generic, we only handle strings up to 128 chars. bool ReadRegistryStr(HKEY key, const wchar_t* name, std::wstring* value) { BYTE out[128 * sizeof(wchar_t)]; @@ -196,6 +198,19 @@ int MainDllLoader::Launch(HINSTANCE instance, return OnBeforeExit(rc); } +void MainDllLoader::RelaunchChromeBrowserWithNewCommandLineIfNeeded() { + RelaunchChromeBrowserWithNewCommandLineIfNeededFunc relaunch_function = + reinterpret_cast<RelaunchChromeBrowserWithNewCommandLineIfNeededFunc>( + ::GetProcAddress(dll_, + "RelaunchChromeBrowserWithNewCommandLineIfNeeded")); + if (!relaunch_function) { + LOG(ERROR) << "Could not find exported function " + << "RelaunchChromeBrowserWithNewCommandLineIfNeeded"; + } else { + relaunch_function(); + } +} + //============================================================================= class ChromeDllLoader : public MainDllLoader { diff --git a/chrome/app/client_util.h b/chrome/app/client_util.h index a391be0..8b6c154f 100644 --- a/chrome/app/client_util.h +++ b/chrome/app/client_util.h @@ -30,6 +30,10 @@ class MainDllLoader { // upon termination. int Launch(HINSTANCE instance, sandbox::SandboxInterfaceInfo* sbox_info); + // Launches a new instance of the browser if the current instance in + // persistent mode an upgrade is detected. + void RelaunchChromeBrowserWithNewCommandLineIfNeeded(); + // Derived classes must return the relative registry path that holds the // most current version of chrome.dll. virtual std::wstring GetRegistryPath() = 0; |