diff options
author | ananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-02-27 23:51:18 +0000 |
---|---|---|
committer | ananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-02-27 23:51:18 +0000 |
commit | 69aef0f1e91c942f3fc34cfb41e87a5dd247b317 (patch) | |
tree | 5e2936769d4ece40177b0f75dfcb145295295b76 /chrome/browser | |
parent | 2ee2329e9d55fdf601752a10abbe16581eefbe9d (diff) | |
download | chromium_src-69aef0f1e91c942f3fc34cfb41e87a5dd247b317.zip chromium_src-69aef0f1e91c942f3fc34cfb41e87a5dd247b317.tar.gz chromium_src-69aef0f1e91c942f3fc34cfb41e87a5dd247b317.tar.bz2 |
Don't call SetPriorityClass if CBSText.dll is loaded in the browser process. The CBSText.dll loads as a global GetMessage hook into the browser process and intercepts/unintercepts the kernel32 API SetPriorityClass in a background thread. If the browser calls this API just
when it is intercepted the dlls interceptor proc messes up the stack while returning back, which causes random crashes in the browser.
The hacky fix for now is to check for this dll and not invoke the API. We will beautify this fix if it works in the wild.
This fixes http://code.google.com/p/chromium/issues/detail?id=6418
Bug=6418
Review URL: http://codereview.chromium.org/27257
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@10648 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
-rw-r--r-- | chrome/browser/renderer_host/browser_render_process_host.cc | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/chrome/browser/renderer_host/browser_render_process_host.cc b/chrome/browser/renderer_host/browser_render_process_host.cc index 88b50c9..d22dbac 100644 --- a/chrome/browser/renderer_host/browser_render_process_host.cc +++ b/chrome/browser/renderer_host/browser_render_process_host.cc @@ -833,9 +833,17 @@ void BrowserRenderProcessHost::OnUpdatedCacheStats( void BrowserRenderProcessHost::SetBackgrounded(bool backgrounded) { // If the process_ is NULL, the process hasn't been created yet. if (process_.handle()) { - bool rv = process_.SetProcessBackgrounded(backgrounded); - if (!rv) { - return; + // The cbstext.dll loads as a global GetMessage hook in the browser process + // and intercepts/unintercepts the kernel32 API SetPriorityClass in a + // background thread. If the UI thread invokes this API just when it is + // intercepted the stack is messed up on return from the interceptor + // which causes random crashes in the browser process. Our hack for now + // is to not invoke the SetPriorityClass API if the dll is loaded. + if (!GetModuleHandle(L"cbstext.dll")) { + bool rv = process_.SetProcessBackgrounded(backgrounded); + if (!rv) { + return; + } } // Now tune the memory footprint of the renderer. |