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

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

Issue 17640007: Refactoring: Simplify DocumentWriter by reorganizing its lifetime. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Re-landing after fixing ASAN failure on set-parent-src-synchronously.xhtml. Created 7 years, 6 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/DocumentLoader.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/loader/DocumentLoader.h
diff --git a/Source/core/loader/DocumentLoader.h b/Source/core/loader/DocumentLoader.h
index c9a8a9ae36a8bf8429e56289d5471a8610ce40e8..18f3151c1cc208596eb645d25496ecb12afd416c 100644
--- a/Source/core/loader/DocumentLoader.h
+++ b/Source/core/loader/DocumentLoader.h
@@ -85,6 +85,8 @@ namespace WebCore {
void replaceDocument(const String& source, Document*);
DocumentWriter* beginWriting(const String& mimeType, const String& encoding, const KURL& = KURL());
+ void endWriting(DocumentWriter*);
+
String mimeType() const;
const ResourceRequest& originalRequest() const;
@@ -162,6 +164,10 @@ namespace WebCore {
bool m_deferMainResourceDataLoad;
private:
+ static PassRefPtr<DocumentWriter> createWriterFor(Frame*, const Document* ownerDocument, const KURL&, const String& mimeType, const String& encoding, bool userChosen, bool dispatch);
+
+ void ensureWriter();
+ void ensureWriter(const String& mimeType, const KURL& overridingURL = KURL());
// The URL of the document resulting from this DocumentLoader.
KURL documentURL() const;
@@ -177,7 +183,7 @@ namespace WebCore {
void clearMainResourceHandle();
PassRefPtr<SharedBuffer> mainResourceData() const;
- bool maybeCreateArchive();
+ void createArchive();
void clearArchiveResources();
void prepareSubframeArchiveLoadIfNeeded();
@@ -212,7 +218,7 @@ namespace WebCore {
ResourceLoaderSet m_resourceLoaders;
ResourceLoaderSet m_multipartResourceLoaders;
- mutable DocumentWriter m_writer;
+ RefPtr<DocumentWriter> m_writer;
// A reference to actual request used to create the data source.
// This should only be used by the resourceLoadDelegate's
@@ -237,7 +243,6 @@ namespace WebCore {
bool m_committed;
bool m_isStopping;
- bool m_gotFirstByte;
bool m_isClientRedirect;
// FIXME: Document::m_processingLoadEvent and DocumentLoader::m_wasOnloadHandled are roughly the same
« no previous file with comments | « Source/core/inspector/InspectorOverlay.cpp ('k') | Source/core/loader/DocumentLoader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698