Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(210)

Unified Diff: chrome/browser/renderer_host/browser_render_process_host.cc

Issue 27298: Attempt 2 at landing this.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/renderer_host/browser_render_process_host.cc
===================================================================
--- chrome/browser/renderer_host/browser_render_process_host.cc (revision 10666)
+++ chrome/browser/renderer_host/browser_render_process_host.cc (working copy)
@@ -833,9 +833,23 @@
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.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698