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

Unified Diff: webkit/glue/plugins/webview_plugin.cc

Issue 3020031: Watch out for invalid delegate and container after destroying the WebViewPlugin. (Closed) Base URL: git://codf21.jail/chromium.git
Patch Set: Created 10 years, 5 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: webkit/glue/plugins/webview_plugin.cc
diff --git a/webkit/glue/plugins/webview_plugin.cc b/webkit/glue/plugins/webview_plugin.cc
index 413ae10ed16d6621e603a3788e626e23cb794e82..1d50be63dc88e16ba07ed253cf73bbc2c0d8e009 100644
--- a/webkit/glue/plugins/webview_plugin.cc
+++ b/webkit/glue/plugins/webview_plugin.cc
@@ -55,6 +55,7 @@ bool WebViewPlugin::initialize(WebPluginContainer* container) {
void WebViewPlugin::destroy() {
delegate_->WillDestroyPlugin();
delegate_ = NULL;
+ container_ = NULL;
MessageLoop::current()->DeleteSoon(FROM_HERE, this);
}
@@ -114,7 +115,7 @@ void WebViewPlugin::startDragging(const WebDragData&,
void WebViewPlugin::didInvalidateRect(const WebRect& rect) {
if (container_)
- container_->invalidateRect(WebRect(rect));
+ container_->invalidateRect(rect);
}
void WebViewPlugin::didChangeCursor(const WebCursorInfo& cursor) {
@@ -122,7 +123,8 @@ void WebViewPlugin::didChangeCursor(const WebCursorInfo& cursor) {
}
void WebViewPlugin::didClearWindowObject(WebFrame* frame) {
- delegate_->BindWebFrame(frame);
+ if (delegate_)
+ delegate_->BindWebFrame(frame);
}
bool WebViewPlugin::canHandleRequest(WebFrame* frame,
« 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