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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/plugin_process_host.h" 5 #include "content/browser/plugin_process_host.h"
6 6
7 #if defined(OS_WIN) 7 #if defined(OS_WIN)
8 #include <windows.h> 8 #include <windows.h>
9 #elif defined(OS_POSIX) 9 #elif defined(OS_POSIX)
10 #include <utility> // for pair<> 10 #include <utility> // for pair<>
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 } 65 }
66 66
67 void PluginProcessHost::OnReparentPluginWindow(HWND window, HWND parent) { 67 void PluginProcessHost::OnReparentPluginWindow(HWND window, HWND parent) {
68 // Reparent only to our process. 68 // Reparent only to our process.
69 DWORD process_id = 0; 69 DWORD process_id = 0;
70 ::GetWindowThreadProcessId(parent, &process_id); 70 ::GetWindowThreadProcessId(parent, &process_id);
71 if (process_id != ::GetCurrentProcessId()) 71 if (process_id != ::GetCurrentProcessId())
72 return; 72 return;
73 73
74 if (webkit::npapi::WebPluginDelegateImpl::IsDummyActivationWindow(window)) { 74 if (webkit::npapi::WebPluginDelegateImpl::IsDummyActivationWindow(window)) {
75 ::SetWindowLongPtr(window, GWL_STYLE, WS_CHILD); 75 BrowserThread::PostTask(
76 BrowserThread::UI, FROM_HERE,
77 NewRunnableFunction(::SetWindowLongPtr, window, GWL_STYLE, WS_CHILD));
76 } else { 78 } else {
77 ::SetWindowLongPtr(window, GWL_STYLE, WS_CHILD | WS_CLIPCHILDREN | 79 BrowserThread::PostTask(
78 WS_CLIPSIBLINGS); 80 BrowserThread::UI, FROM_HERE,
81 NewRunnableFunction(::SetWindowLongPtr, window, GWL_STYLE,
82 WS_CHILD | WS_CLIPCHILDREN | WS_CLIPSIBLINGS));
79 } 83 }
80 ::SetParent(window, parent); 84 BrowserThread::PostTask(
85 BrowserThread::UI, FROM_HERE,
86 NewRunnableFunction(::SetParent, window, parent));
cpu_(ooo_6.6-7.5) 2011/06/08 18:04:31 Is not easier to just make a single function that
ananta 2011/06/08 18:10:47 Done.
81 } 87 }
82 #endif // defined(OS_WIN) 88 #endif // defined(OS_WIN)
83 89
84 #if defined(TOOLKIT_USES_GTK) 90 #if defined(TOOLKIT_USES_GTK)
85 void PluginProcessHost::OnMapNativeViewId(gfx::NativeViewId id, 91 void PluginProcessHost::OnMapNativeViewId(gfx::NativeViewId id,
86 gfx::PluginWindowHandle* output) { 92 gfx::PluginWindowHandle* output) {
87 *output = 0; 93 *output = 0;
88 GtkNativeViewManager::GetInstance()->GetXIDForId(output, id); 94 GtkNativeViewManager::GetInstance()->GetXIDForId(output, id);
89 } 95 }
90 #endif // defined(TOOLKIT_USES_GTK) 96 #endif // defined(TOOLKIT_USES_GTK)
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after
345 } 351 }
346 } 352 }
347 353
348 void PluginProcessHost::OnChannelCreated( 354 void PluginProcessHost::OnChannelCreated(
349 const IPC::ChannelHandle& channel_handle) { 355 const IPC::ChannelHandle& channel_handle) {
350 Client* client = sent_requests_.front(); 356 Client* client = sent_requests_.front();
351 357
352 client->OnChannelOpened(channel_handle); 358 client->OnChannelOpened(channel_handle);
353 sent_requests_.pop(); 359 sent_requests_.pop();
354 } 360 }
OLDNEW
« 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