summaryrefslogtreecommitdiffstats
path: root/webkit/glue/plugins
diff options
context:
space:
mode:
authordeanm@chromium.org <deanm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-02-26 15:21:50 +0000
committerdeanm@chromium.org <deanm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-02-26 15:21:50 +0000
commit5418f47e35f5a6c1b6a3248a4927cb2fa4b5aee1 (patch)
treef51236e605d3c64067a8ee8aa4a4fc5d84d69d71 /webkit/glue/plugins
parent33b6322f129fc660dbb1aa2e4ef20fe533aad439 (diff)
downloadchromium_src-5418f47e35f5a6c1b6a3248a4927cb2fa4b5aee1.zip
chromium_src-5418f47e35f5a6c1b6a3248a4927cb2fa4b5aee1.tar.gz
chromium_src-5418f47e35f5a6c1b6a3248a4927cb2fa4b5aee1.tar.bz2
Try a new approach to fixing IAT unpatch crashes when the DLL is gone.
Have the IAT patcher take some "ownership" of the DLL, by taking a library name and then calling LoadLibrary() / FreeLibrary() to manage the reference count. This means as long is there isn't some other reference count balancing bug happening in the process, the DLL will never be unloaded while we are patched. This effectively reverts r9929, the VirtualQuery additional checks are removed. BUG=7701 Review URL: http://codereview.chromium.org/21453 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@10467 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue/plugins')
-rw-r--r--webkit/glue/plugins/webplugin_delegate_impl.cc9
-rw-r--r--webkit/glue/plugins/webplugin_delegate_impl.h3
2 files changed, 3 insertions, 9 deletions
diff --git a/webkit/glue/plugins/webplugin_delegate_impl.cc b/webkit/glue/plugins/webplugin_delegate_impl.cc
index 4163b50..564659d 100644
--- a/webkit/glue/plugins/webplugin_delegate_impl.cc
+++ b/webkit/glue/plugins/webplugin_delegate_impl.cc
@@ -155,8 +155,7 @@ WebPluginDelegateImpl::WebPluginDelegateImpl(
handle_event_depth_(0),
user_gesture_message_posted_(false),
#pragma warning(suppress: 4355) // can use this
- user_gesture_msg_factory_(this),
- plugin_module_handle_(NULL) {
+ user_gesture_msg_factory_(this) {
memset(&window_, 0, sizeof(window_));
const WebPluginInfo& plugin_info = instance_->plugin_lib()->plugin_info();
@@ -201,8 +200,6 @@ WebPluginDelegateImpl::WebPluginDelegateImpl(
quirks_ |= PLUGIN_QUIRK_PATCH_TRACKPOPUP_MENU;
quirks_ |= PLUGIN_QUIRK_PATCH_SETCURSOR;
}
-
- plugin_module_handle_ = ::GetModuleHandle(plugin_info.path.value().c_str());
}
WebPluginDelegateImpl::~WebPluginDelegateImpl() {
@@ -283,7 +280,7 @@ bool WebPluginDelegateImpl::Initialize(const GURL& url,
if (windowless_ && !g_iat_patch_track_popup_menu.Pointer()->is_patched() &&
(quirks_ & PLUGIN_QUIRK_PATCH_TRACKPOPUP_MENU)) {
g_iat_patch_track_popup_menu.Pointer()->Patch(
- plugin_module_handle_, "user32.dll", "TrackPopupMenu",
+ GetPluginPath().value().c_str(), "user32.dll", "TrackPopupMenu",
WebPluginDelegateImpl::TrackPopupMenuPatch);
}
@@ -296,7 +293,7 @@ bool WebPluginDelegateImpl::Initialize(const GURL& url,
if (windowless_ && !g_iat_patch_set_cursor.Pointer()->is_patched() &&
(quirks_ & PLUGIN_QUIRK_PATCH_SETCURSOR)) {
g_iat_patch_set_cursor.Pointer()->Patch(
- plugin_module_handle_, "user32.dll", "SetCursor",
+ GetPluginPath().value().c_str(), "user32.dll", "SetCursor",
WebPluginDelegateImpl::SetCursorPatch);
}
return true;
diff --git a/webkit/glue/plugins/webplugin_delegate_impl.h b/webkit/glue/plugins/webplugin_delegate_impl.h
index 0474d26..27e17cf 100644
--- a/webkit/glue/plugins/webplugin_delegate_impl.h
+++ b/webkit/glue/plugins/webplugin_delegate_impl.h
@@ -247,9 +247,6 @@ class WebPluginDelegateImpl : public WebPluginDelegate {
#endif
#if defined(OS_WIN)
- // The plugin module handle.
- HMODULE plugin_module_handle_;
-
// TrackPopupMenu interceptor. Parameters are the same as the Win32 function
// TrackPopupMenu.
static BOOL WINAPI TrackPopupMenuPatch(HMENU menu, unsigned int flags, int x,