diff options
author | darin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-12-23 22:14:18 +0000 |
---|---|---|
committer | darin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-12-23 22:14:18 +0000 |
commit | be4576e292be2d77ffc45ef4df8245a0059e3d5f (patch) | |
tree | 1f32c01f2cc32c5b95634a99ef31a9b878dcfb53 /chrome/app/chrome_dll_main.cc | |
parent | e26092ee0313c209ecfc13adf4015d55a4eb38db (diff) | |
download | chromium_src-be4576e292be2d77ffc45ef4df8245a0059e3d5f.zip chromium_src-be4576e292be2d77ffc45ef4df8245a0059e3d5f.tar.gz chromium_src-be4576e292be2d77ffc45ef4df8245a0059e3d5f.tar.bz2 |
Add a dummy PostThreadMessage and PeekMessage call to help inform Windows that our subprocesses have started up. This causes Windows to promptly stop showing the IDC_APPSTARTING cursor when opening a new tab or navigating to a new domain via the location bar.
BUG=4805
R=ananta
Review URL: http://codereview.chromium.org/16464
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@7447 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/app/chrome_dll_main.cc')
-rw-r--r-- | chrome/app/chrome_dll_main.cc | 28 |
1 files changed, 19 insertions, 9 deletions
diff --git a/chrome/app/chrome_dll_main.cc b/chrome/app/chrome_dll_main.cc index deb197d..ba7884fe 100644 --- a/chrome/app/chrome_dll_main.cc +++ b/chrome/app/chrome_dll_main.cc @@ -206,6 +206,23 @@ void InitializeSandbox(const CommandLine& parsed_command_line, } } +void CommonSubprocessInit() { +#if defined(OS_WIN) + // Initialize ResourceBundle which handles files loaded from external + // sources. The language should have been passed in to us from the + // browser process as a command line flag. + // TODO(port): enable when we figure out resource bundle issues + ResourceBundle::InitSharedInstance(std::wstring()); + + // HACK: Let Windows know that we have started. This is needed to suppress + // the IDC_APPSTARTING cursor from being displayed for a prolonged period + // while a subprocess is starting. + PostThreadMessage(GetCurrentThreadId(), WM_NULL, 0, 0); + MSG msg; + PeekMessage(&msg, NULL, 0, 0, PM_REMOVE); +#endif +} + } // namespace #if defined(OS_WIN) @@ -311,15 +328,8 @@ int ChromeMain(int argc, const char** argv) { } #endif // NDEBUG - if (!process_type.empty()) { -#if defined(OS_WIN) - // Initialize ResourceBundle which handles files loaded from external - // sources. The language should have been passed in to us from the - // browser process as a command line flag. - // TODO(port): enable when we figure out resource bundle issues - ResourceBundle::InitSharedInstance(std::wstring()); -#endif - } + if (!process_type.empty()) + CommonSubprocessInit(); startup_timer.Stop(); // End of Startup Time Measurement. |