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

Unified Diff: content/browser/plugin_process_host.cc

Issue 6995082: Fix a browser, renderer, plugin deadlock caused by the change to reparent plugin windows in the b... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 6 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: content/browser/plugin_process_host.cc
===================================================================
--- content/browser/plugin_process_host.cc (revision 88161)
+++ content/browser/plugin_process_host.cc (working copy)
@@ -48,6 +48,21 @@
#if defined(OS_WIN)
#include "webkit/plugins/npapi/webplugin_delegate_impl.h"
+namespace {
+
+void ReparentPluginWindowHelper(HWND window, HWND parent) {
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+
+ int window_style = WS_CHILD;
+ if (!webkit::npapi::WebPluginDelegateImpl::IsDummyActivationWindow(window))
+ window_style |= WS_CLIPCHILDREN | WS_CLIPSIBLINGS;
+
+ ::SetWindowLongPtr(window, GWL_STYLE, window_style);
+ ::SetParent(window, parent);
+}
+
+} // namespace
+
void PluginProcessHost::OnPluginWindowDestroyed(HWND window, HWND parent) {
// The window is destroyed at this point, we just care about its parent, which
// is the intermediate window we created.
@@ -71,13 +86,9 @@
if (process_id != ::GetCurrentProcessId())
return;
- if (webkit::npapi::WebPluginDelegateImpl::IsDummyActivationWindow(window)) {
- ::SetWindowLongPtr(window, GWL_STYLE, WS_CHILD);
- } else {
- ::SetWindowLongPtr(window, GWL_STYLE, WS_CHILD | WS_CLIPCHILDREN |
- WS_CLIPSIBLINGS);
- }
- ::SetParent(window, parent);
+ BrowserThread::PostTask(
+ BrowserThread::UI, FROM_HERE,
+ NewRunnableFunction(ReparentPluginWindowHelper, window, parent));
}
#endif // defined(OS_WIN)
« 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