From d8f8a5949f1e5cd15058ade51296ca620d456736 Mon Sep 17 00:00:00 2001 From: "darin@chromium.org" Date: Thu, 9 Jul 2009 18:55:20 +0000 Subject: Remove reference counting from WebWidgetDelegate. This was added as a speculative crash fix by eseidel back in June of 2008. See http://b/1211911 for details. It didn't appear to resolve the crash then (as another patch was required to fix the bug), and it doesn't seem to be necessary since the RenderView, which is the delegate and owns the WebView, is the one in charge of allocating the WebView and destroying the WebView. So, it is not possible for the WebView to outlive the RenderView. BUG=16234 TEST=none R=brettw Review URL: http://codereview.chromium.org/155292 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20294 0039d316-1c4b-4281-b951-d872f2087c98 --- webkit/glue/webview_impl.h | 4 ++-- webkit/glue/webwidget_delegate.h | 4 ---- webkit/glue/webworker_impl.cc | 2 -- webkit/tools/test_shell/test_webview_delegate.h | 6 ------ 4 files changed, 2 insertions(+), 14 deletions(-) (limited to 'webkit') diff --git a/webkit/glue/webview_impl.h b/webkit/glue/webview_impl.h index ac85c06..d55df1a 100644 --- a/webkit/glue/webview_impl.h +++ b/webkit/glue/webview_impl.h @@ -144,7 +144,7 @@ class WebViewImpl : public WebView, public base::RefCounted { static WebViewImpl* FromPage(WebCore::Page* page); WebViewDelegate* delegate() { - return delegate_.get(); + return delegate_; } // Returns the page object associated with this view. This may be NULL when @@ -228,7 +228,7 @@ class WebViewImpl : public WebView, public base::RefCounted { WebCore::Frame* frame, const WebCore::PlatformKeyboardEvent& e); - scoped_refptr delegate_; + WebViewDelegate* delegate_; WebKit::WebSize size_; WebKit::WebPoint last_mouse_position_; diff --git a/webkit/glue/webwidget_delegate.h b/webkit/glue/webwidget_delegate.h index 824b665..17704b0d 100644 --- a/webkit/glue/webwidget_delegate.h +++ b/webkit/glue/webwidget_delegate.h @@ -117,10 +117,6 @@ class WebWidgetDelegate { // is closed. This is used to support |window.showModalDialog|. virtual void RunModal(WebWidget* webwidget) = 0; - // Owners depend on the delegates living as long as they do, so we ref them. - virtual void AddRef() = 0; - virtual void Release() = 0; - // Returns true if the widget is in a background tab. virtual bool IsHidden(WebWidget* webwidget) = 0; diff --git a/webkit/glue/webworker_impl.cc b/webkit/glue/webworker_impl.cc index d1ba068..e42dbfe 100644 --- a/webkit/glue/webworker_impl.cc +++ b/webkit/glue/webworker_impl.cc @@ -46,8 +46,6 @@ using WebKit::WebWorkerClient; class WorkerWebViewDelegate : public WebViewDelegate { public: WorkerWebViewDelegate() {} - virtual void AddRef() { } - virtual void Release() { } virtual void Blur(WebWidget *webwidget) { } virtual void CloseWidgetSoon(WebWidget *webwidget) { } virtual void DidInvalidateRect(WebWidget *webwidget, diff --git a/webkit/tools/test_shell/test_webview_delegate.h b/webkit/tools/test_shell/test_webview_delegate.h index f463c22..1ce235e 100644 --- a/webkit/tools/test_shell/test_webview_delegate.h +++ b/webkit/tools/test_shell/test_webview_delegate.h @@ -247,12 +247,6 @@ class TestWebViewDelegate : public base::RefCounted, virtual void RunModal(WebWidget* webwidget); virtual bool IsHidden(WebWidget* webwidget); virtual WebKit::WebScreenInfo GetScreenInfo(WebWidget* webwidget); - virtual void AddRef() { - base::RefCounted::AddRef(); - } - virtual void Release() { - base::RefCounted::Release(); - } void SetSmartInsertDeleteEnabled(bool enabled); void SetSelectTrailingWhitespaceEnabled(bool enabled); -- cgit v1.1