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

Unified Diff: Source/core/loader/DocumentLoader.cpp

Issue 517043003: Move Frame to the Oilpan heap. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Handle FrameHost-detached access in FrameLoader::allowPlugins() 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/inspector/InspectorOverlay.cpp ('k') | Source/core/loader/DocumentWriter.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/loader/DocumentLoader.cpp
diff --git a/Source/core/loader/DocumentLoader.cpp b/Source/core/loader/DocumentLoader.cpp
index cd27caf6fa031a79a08d7a27c8725564e91781c6..aa02cf79cd957aa10abeb473f541cd591c5da720 100644
--- a/Source/core/loader/DocumentLoader.cpp
+++ b/Source/core/loader/DocumentLoader.cpp
@@ -37,6 +37,9 @@
#include "core/fetch/MemoryCache.h"
#include "core/fetch/ResourceFetcher.h"
#include "core/fetch/ResourceLoader.h"
+#include "core/frame/LocalDOMWindow.h"
+#include "core/frame/LocalFrame.h"
+#include "core/frame/csp/ContentSecurityPolicy.h"
#include "core/html/HTMLFrameOwnerElement.h"
#include "core/html/parser/TextResourceDecoder.h"
#include "core/inspector/InspectorInstrumentation.h"
@@ -44,9 +47,6 @@
#include "core/loader/FrameLoaderClient.h"
#include "core/loader/UniqueIdentifier.h"
#include "core/loader/appcache/ApplicationCacheHost.h"
-#include "core/frame/LocalDOMWindow.h"
-#include "core/frame/LocalFrame.h"
-#include "core/frame/csp/ContentSecurityPolicy.h"
#include "core/page/FrameTree.h"
#include "core/page/Page.h"
#include "core/frame/Settings.h"
@@ -177,7 +177,7 @@ void DocumentLoader::mainReceivedError(const ResourceError& error)
// but not loads initiated by child frames' data sources -- that's the WebFrame's job.
void DocumentLoader::stopLoading()
{
- RefPtr<LocalFrame> protectFrame(m_frame);
+ RefPtrWillBeRawPtr<LocalFrame> protectFrame(m_frame);
RefPtr<DocumentLoader> protectLoader(this);
// In some rare cases, calling FrameLoader::stopLoading could cause isLoading() to return false.
@@ -508,7 +508,7 @@ void DocumentLoader::ensureWriter(const AtomicString& mimeType, const KURL& over
// inherit an aliased security context.
DocumentInit init(url(), m_frame);
init.withNewRegistrationContext();
- m_frame->loader().clear();
+ m_frame->loader().dispose(FrameLoader::DoDisposeFrameContents);
ASSERT(m_frame->page());
m_writer = createWriterFor(0, init, mimeType, encoding, false);
@@ -539,7 +539,7 @@ void DocumentLoader::dataReceived(Resource* resource, const char* data, int leng
// Both unloading the old page and parsing the new page may execute JavaScript which destroys the datasource
// by starting a new load, so retain temporarily.
- RefPtr<LocalFrame> protectFrame(m_frame);
+ RefPtrWillBeRawPtr<LocalFrame> protectFrame(m_frame);
RefPtr<DocumentLoader> protectLoader(this);
m_applicationCacheHost->mainResourceDataReceived(data, length);
@@ -571,7 +571,7 @@ void DocumentLoader::appendRedirect(const KURL& url)
void DocumentLoader::detachFromFrame()
{
ASSERT(m_frame);
- RefPtr<LocalFrame> protectFrame(m_frame);
+ RefPtrWillBeRawPtr<LocalFrame> protectFrame(m_frame);
RefPtr<DocumentLoader> protectLoader(this);
// It never makes sense to have a document loader that is detached from its
« no previous file with comments | « Source/core/inspector/InspectorOverlay.cpp ('k') | Source/core/loader/DocumentWriter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698