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

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: Fixed a build breakage 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
Index: Source/core/loader/DocumentLoader.h
diff --git a/Source/core/loader/DocumentLoader.h b/Source/core/loader/DocumentLoader.h
index cd6f05c0626e8bc48485bc5f26cff7b0a465617f..bb7d7ca87d45ef1e5a4715e7a44cdc29e77c514c 100644
--- a/Source/core/loader/DocumentLoader.h
+++ b/Source/core/loader/DocumentLoader.h
@@ -86,6 +86,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;
@@ -167,6 +169,10 @@ namespace WebCore {
bool m_deferMainResourceDataLoad;
private:
+ static PassOwnPtr<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);
// The URL of the document resulting from this DocumentLoader.
KURL documentURL() const;
@@ -182,7 +188,7 @@ namespace WebCore {
void clearMainResourceHandle();
PassRefPtr<SharedBuffer> mainResourceData() const;
- bool maybeCreateArchive();
+ void createArchive();
void clearArchiveResources();
void prepareSubframeArchiveLoadIfNeeded();
@@ -217,7 +223,7 @@ namespace WebCore {
ResourceLoaderSet m_resourceLoaders;
ResourceLoaderSet m_multipartResourceLoaders;
- mutable DocumentWriter m_writer;
+ OwnPtr<DocumentWriter> m_writer;
// A reference to actual request used to create the data source.
// This should only be used by the resourceLoadDelegate's
@@ -242,7 +248,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

Powered by Google App Engine
This is Rietveld 408576698