diff options
Diffstat (limited to 'WebKit/gtk/WebCoreSupport/DocumentLoaderGtk.cpp')
-rw-r--r-- | WebKit/gtk/WebCoreSupport/DocumentLoaderGtk.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/WebKit/gtk/WebCoreSupport/DocumentLoaderGtk.cpp b/WebKit/gtk/WebCoreSupport/DocumentLoaderGtk.cpp index 0efc9fa..2b355cb 100644 --- a/WebKit/gtk/WebCoreSupport/DocumentLoaderGtk.cpp +++ b/WebKit/gtk/WebCoreSupport/DocumentLoaderGtk.cpp @@ -30,6 +30,7 @@ #include "config.h" #include "DocumentLoaderGtk.h" +#include "webkitprivate.h" #include "webkitwebdatasource.h" using namespace WebCore; @@ -60,7 +61,16 @@ void DocumentLoader::attachToFrame() { WebCore::DocumentLoader::attachToFrame(); - refDataSource(); + if (m_dataSource) { + refDataSource(); + return; + } + + // We may get to here without having a datasource, when the data + // is coming from the page cache. + WebKitWebDataSource* dataSource = webkit_web_data_source_new_with_loader(this); + setDataSource(dataSource); + g_object_unref(dataSource); } void DocumentLoader::detachFromFrame() @@ -110,6 +120,7 @@ void DocumentLoader::unrefDataSource() ASSERT(m_dataSource); m_isDataSourceReffed = false; g_object_unref(m_dataSource); + m_dataSource = 0; } } // end namespace WebKit |