Upstream version 7.36.149.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / Source / core / loader / DocumentLoader.h
index a54d183..713d3d1 100644 (file)
 #include "wtf/HashSet.h"
 #include "wtf/RefPtr.h"
 
+namespace blink {
+class WebThreadedDataReceiver;
+}
+
 namespace WTF {
 class SchedulePair;
 }
@@ -54,7 +58,7 @@ namespace WebCore {
     class ResourceFetcher;
     class ContentFilter;
     class FormState;
-    class Frame;
+    class LocalFrame;
     class FrameLoader;
     class MHTMLArchive;
     class Page;
@@ -64,13 +68,13 @@ namespace WebCore {
     class DocumentLoader : public RefCounted<DocumentLoader>, private RawResourceClient {
         WTF_MAKE_FAST_ALLOCATED;
     public:
-        static PassRefPtr<DocumentLoader> create(Frame* frame, const ResourceRequest& request, const SubstituteData& data)
+        static PassRefPtr<DocumentLoader> create(LocalFrame* frame, const ResourceRequest& request, const SubstituteData& data)
         {
             return adoptRef(new DocumentLoader(frame, request, data));
         }
         virtual ~DocumentLoader();
 
-        Frame* frame() const { return m_frame; }
+        LocalFrame* frame() const { return m_frame; }
 
         void detachFromFrame();
 
@@ -92,22 +96,21 @@ namespace WebCore {
 
         const KURL& url() const;
         const KURL& unreachableURL() const;
-        bool isURLValidForNewHistoryEntry() const;
+        const KURL& urlForHistory() const;
 
-        const KURL& originalURL() const;
         const AtomicString& responseMIMEType() const;
 
         void updateForSameDocumentNavigation(const KURL&);
         void stopLoading();
         bool isCommitted() const { return m_committed; }
         bool isLoading() const;
+        bool isLoadingMainResource() const { return m_loadingMainResource; }
         const ResourceResponse& response() const { return m_response; }
         const ResourceError& mainDocumentError() const { return m_mainDocumentError; }
         bool isClientRedirect() const { return m_isClientRedirect; }
         void setIsClientRedirect(bool isClientRedirect) { m_isClientRedirect = isClientRedirect; }
         bool replacesCurrentHistoryItem() const { return m_replacesCurrentHistoryItem; }
         void setReplacesCurrentHistoryItem(bool replacesCurrentHistoryItem) { m_replacesCurrentHistoryItem = replacesCurrentHistoryItem; }
-        bool isLoadingInAPISense() const;
         const AtomicString& overrideEncoding() const { return m_overrideEncoding; }
 
         bool scheduleArchiveLoad(Resource*, const ResourceRequest&);
@@ -123,23 +126,22 @@ namespace WebCore {
         void startLoadingMainResource();
         void cancelMainResourceLoad(const ResourceError&);
 
+        void attachThreadedDataReceiver(PassOwnPtr<blink::WebThreadedDataReceiver>);
         DocumentLoadTiming* timing() { return &m_documentLoadTiming; }
 
         ApplicationCacheHost* applicationCacheHost() const { return m_applicationCacheHost.get(); }
 
-        void checkLoadComplete();
-
         bool isRedirect() const { return m_redirectChain.size() > 1; }
         void clearRedirectChain();
         void appendRedirect(const KURL&);
 
     protected:
-        DocumentLoader(Frame*, const ResourceRequest&, const SubstituteData&);
+        DocumentLoader(LocalFrame*, const ResourceRequest&, const SubstituteData&);
 
         Vector<KURL> m_redirectChain;
 
     private:
-        static PassRefPtr<DocumentWriter> createWriterFor(Frame*, const Document* ownerDocument, const KURL&, const AtomicString& mimeType, const AtomicString& encoding, bool userChosen, bool dispatch);
+        static PassRefPtr<DocumentWriter> createWriterFor(LocalFrame*, const Document* ownerDocument, const KURL&, const AtomicString& mimeType, const AtomicString& encoding, bool userChosen, bool dispatch);
 
         void ensureWriter(const AtomicString& mimeType, const KURL& overridingURL = KURL());
         void endWriting(DocumentWriter*);
@@ -155,7 +157,6 @@ namespace WebCore {
         void clearMainResourceHandle();
 
         bool maybeCreateArchive();
-        void clearArchiveResources();
 
         void prepareSubframeArchiveLoadIfNeeded();
         void addAllArchiveResources(MHTMLArchive*);
@@ -175,8 +176,8 @@ namespace WebCore {
 
         bool shouldContinueForResponse() const;
 
-        Frame* m_frame;
-        RefPtr<ResourceFetcher> m_fetcher;
+        LocalFrame* m_frame;
+        RefPtrWillBePersistent<ResourceFetcher> m_fetcher;
 
         ResourcePtr<RawResource> m_mainResource;