From 2affce26ab8f173609de60771c0fbc1ae23a6126 Mon Sep 17 00:00:00 2001 From: Kristian Monsen Date: Thu, 13 Jan 2011 14:27:10 +0000 Subject: Fix for bug 3347616, crash when closing browser with requests in flight The problem is if a request is just started as the browser (or a tab) is closed. That can give delete the scoped_refptr before the refcount is increased on the IO thread. Refcounted objects should not be passed as raw pointers between threads. Change-Id: I57a9b30f5fdfef3c6d45b81ea59a61f96b09e6ae --- WebKit/android/WebCoreSupport/WebRequest.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'WebKit/android/WebCoreSupport/WebRequest.cpp') diff --git a/WebKit/android/WebCoreSupport/WebRequest.cpp b/WebKit/android/WebCoreSupport/WebRequest.cpp index da84126..9e464c1 100644 --- a/WebKit/android/WebCoreSupport/WebRequest.cpp +++ b/WebKit/android/WebCoreSupport/WebRequest.cpp @@ -152,7 +152,13 @@ void WebRequest::appendBytesToUpload(WTF::Vector* data) delete data; } -void WebRequest::start(WebRequestContext* context) +void WebRequest::setRequestContext(WebRequestContext* context) +{ + if (m_request) + m_request->set_context(context); +} + +void WebRequest::start() { ASSERT(m_loadState == Created, "Start called on a WebRequest not in CREATED state: (%s)", m_url.c_str()); @@ -168,8 +174,6 @@ void WebRequest::start(WebRequestContext* context) if (m_request->url().SchemeIs("browser")) return handleBrowserURL(m_request->url()); - m_request->set_context(context); - m_request->Start(); } -- cgit v1.1