summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-02-28 05:45:47 +0000
committerananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-02-28 05:45:47 +0000
commit0cfd0586c393e94dea9d31fa9a6ddcf04754bb38 (patch)
tree0417800b2a373426f87ce066a95327578ede2a66 /chrome
parentbbeae1b4351499ca2ab3082040a289f1dd493584 (diff)
downloadchromium_src-0cfd0586c393e94dea9d31fa9a6ddcf04754bb38.zip
chromium_src-0cfd0586c393e94dea9d31fa9a6ddcf04754bb38.tar.gz
chromium_src-0cfd0586c393e94dea9d31fa9a6ddcf04754bb38.tar.bz2
Attempt 2 at landing this.
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/27298 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@10676 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/renderer_host/browser_render_process_host.cc20
1 files changed, 17 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..1c00fb7 100644
--- a/chrome/browser/renderer_host/browser_render_process_host.cc
+++ b/chrome/browser/renderer_host/browser_render_process_host.cc
@@ -833,9 +833,23 @@ 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;
+ bool should_set_backgrounded = true;
+
+#if defined(OS_WIN)
+ // 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.
+ should_set_backgrounded = (GetModuleHandle(L"cbstext.dll") == NULL);
+#endif // OS_WIN
+
+ if (should_set_backgrounded) {
+ bool rv = process_.SetProcessBackgrounded(backgrounded);
+ if (!rv) {
+ return;
+ }
}
// Now tune the memory footprint of the renderer.