Index: Source/web/WebDataSourceImpl.cpp |
diff --git a/Source/web/WebDataSourceImpl.cpp b/Source/web/WebDataSourceImpl.cpp |
index 8bdb7a1fcd6916bc86ab02f5fe1f584a5b87ba65..4b7bbd809aaca47d0c081cdfee0d344e455127a2 100644 |
--- a/Source/web/WebDataSourceImpl.cpp |
+++ b/Source/web/WebDataSourceImpl.cpp |
@@ -44,9 +44,9 @@ static OwnPtr<WebPluginLoadObserver>& nextPluginLoadObserver() |
return nextPluginLoadObserver; |
} |
-PassRefPtr<WebDataSourceImpl> WebDataSourceImpl::create(LocalFrame* frame, const ResourceRequest& request, const SubstituteData& data) |
+PassRefPtrWillBeRawPtr<WebDataSourceImpl> WebDataSourceImpl::create(LocalFrame* frame, const ResourceRequest& request, const SubstituteData& data) |
{ |
- return adoptRef(new WebDataSourceImpl(frame, request, data)); |
+ return adoptRefWillBeNoop(new WebDataSourceImpl(frame, request, data)); |
} |
const WebURLRequest& WebDataSourceImpl::originalRequest() const |
@@ -160,6 +160,22 @@ WebDataSourceImpl::WebDataSourceImpl(LocalFrame* frame, const ResourceRequest& r |
WebDataSourceImpl::~WebDataSourceImpl() |
{ |
+ // Verify that detachFromFrame() has been called. |
+ ASSERT(!m_extraData); |
+} |
+ |
+void WebDataSourceImpl::detachFromFrame() |
+{ |
+ RefPtrWillBeRawPtr<DocumentLoader> protect(this); |
+ |
+ DocumentLoader::detachFromFrame(); |
+ m_extraData.clear(); |
+ m_pluginLoadObserver.clear(); |
+} |
+ |
+DEFINE_TRACE(WebDataSourceImpl) |
+{ |
+ DocumentLoader::trace(visitor); |
} |
} // namespace blink |