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

Unified Diff: Source/core/loader/appcache/ApplicationCacheHost.cpp

Issue 571003002: Dispose ApplicationCacheHost on DocumentLoader finalization. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 3 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 | « Source/core/loader/appcache/ApplicationCacheHost.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/loader/appcache/ApplicationCacheHost.cpp
diff --git a/Source/core/loader/appcache/ApplicationCacheHost.cpp b/Source/core/loader/appcache/ApplicationCacheHost.cpp
index 3c57691e164a2fd0646e0279294a2f4864d8ec42..e20e935e906a17fde2de4056d8f210231810f4cb 100644
--- a/Source/core/loader/appcache/ApplicationCacheHost.cpp
+++ b/Source/core/loader/appcache/ApplicationCacheHost.cpp
@@ -164,6 +164,19 @@ void ApplicationCacheHost::setApplicationCache(ApplicationCache* domApplicationC
m_domApplicationCache = domApplicationCache;
}
+void ApplicationCacheHost::dispose()
+{
+ // FIXME: Oilpan: remove the dispose step when the owning DocumentLoader
+ // becomes a garbage collected object. Until that time, have the
+ // DocumentLoader dispose and disable this ApplicationCacheHost when
+ // it is finalized. Releasing the WebApplicationCacheHost is needed
+ // to prevent further embedder notifications, which risk accessing an
+ // invalid DocumentLoader.
+ setApplicationCache(0);
+ m_host.clear();
+ m_documentLoader = nullptr;
+}
+
void ApplicationCacheHost::notifyApplicationCache(EventID id, int progressTotal, int progressDone, WebApplicationCacheHost::ErrorReason errorReason, const String& errorURL, int errorStatus, const String& errorMessage)
{
if (id != PROGRESS_EVENT)
« no previous file with comments | « Source/core/loader/appcache/ApplicationCacheHost.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698