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

Side by Side Diff: Source/core/loader/DocumentLoader.h

Issue 495743003: Add an extra guard to replaceDocument() (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Landing 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 unified diff | Download patch
« no previous file with comments | « Source/core/frame/LocalFrame.cpp ('k') | Source/core/loader/DocumentLoader.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
3 * Copyright (C) 2011 Google Inc. All rights reserved. 3 * Copyright (C) 2011 Google Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 8 *
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 namespace WTF { 50 namespace WTF {
51 class SchedulePair; 51 class SchedulePair;
52 } 52 }
53 53
54 namespace blink { 54 namespace blink {
55 class ApplicationCacheHost; 55 class ApplicationCacheHost;
56 class ArchiveResource; 56 class ArchiveResource;
57 class ArchiveResourceCollection; 57 class ArchiveResourceCollection;
58 class ResourceFetcher; 58 class ResourceFetcher;
59 class ContentFilter; 59 class ContentFilter;
60 class DocumentInit;
60 class FormState; 61 class FormState;
61 class LocalFrame; 62 class LocalFrame;
62 class FrameLoader; 63 class FrameLoader;
63 class MHTMLArchive; 64 class MHTMLArchive;
64 class Page; 65 class Page;
65 class ResourceLoader; 66 class ResourceLoader;
66 class SharedBuffer; 67 class SharedBuffer;
67 68
68 class DocumentLoader : public RefCounted<DocumentLoader>, private RawResourc eClient { 69 class DocumentLoader : public RefCounted<DocumentLoader>, private RawResourc eClient {
69 WTF_MAKE_FAST_ALLOCATED; 70 WTF_MAKE_FAST_ALLOCATED;
70 public: 71 public:
71 static PassRefPtr<DocumentLoader> create(LocalFrame* frame, const Resour ceRequest& request, const SubstituteData& data) 72 static PassRefPtr<DocumentLoader> create(LocalFrame* frame, const Resour ceRequest& request, const SubstituteData& data)
72 { 73 {
73 return adoptRef(new DocumentLoader(frame, request, data)); 74 return adoptRef(new DocumentLoader(frame, request, data));
74 } 75 }
75 virtual ~DocumentLoader(); 76 virtual ~DocumentLoader();
76 77
77 LocalFrame* frame() const { return m_frame; } 78 LocalFrame* frame() const { return m_frame; }
78 79
79 void detachFromFrame(); 80 void detachFromFrame();
80 81
81 unsigned long mainResourceIdentifier() const; 82 unsigned long mainResourceIdentifier() const;
82 83
83 void replaceDocument(const String& source, Document*); 84 void replaceDocumentWhileExecutingJavaScriptURL(const DocumentInit&, con st String& source, Document*);
84 85
85 const AtomicString& mimeType() const; 86 const AtomicString& mimeType() const;
86 87
87 void setUserChosenEncoding(const String& charset); 88 void setUserChosenEncoding(const String& charset);
88 89
89 const ResourceRequest& originalRequest() const; 90 const ResourceRequest& originalRequest() const;
90 91
91 const ResourceRequest& request() const; 92 const ResourceRequest& request() const;
92 93
93 ResourceFetcher* fetcher() const { return m_fetcher.get(); } 94 ResourceFetcher* fetcher() const { return m_fetcher.get(); }
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 bool isRedirect() const { return m_redirectChain.size() > 1; } 135 bool isRedirect() const { return m_redirectChain.size() > 1; }
135 void clearRedirectChain(); 136 void clearRedirectChain();
136 void appendRedirect(const KURL&); 137 void appendRedirect(const KURL&);
137 138
138 protected: 139 protected:
139 DocumentLoader(LocalFrame*, const ResourceRequest&, const SubstituteData &); 140 DocumentLoader(LocalFrame*, const ResourceRequest&, const SubstituteData &);
140 141
141 Vector<KURL> m_redirectChain; 142 Vector<KURL> m_redirectChain;
142 143
143 private: 144 private:
144 static PassRefPtrWillBeRawPtr<DocumentWriter> createWriterFor(LocalFrame *, const Document* ownerDocument, const KURL&, const AtomicString& mimeType, con st AtomicString& encoding, bool dispatch); 145 static PassRefPtrWillBeRawPtr<DocumentWriter> createWriterFor(const Docu ment* ownerDocument, const DocumentInit&, const AtomicString& mimeType, const At omicString& encoding, bool dispatch);
145 146
146 void ensureWriter(const AtomicString& mimeType, const KURL& overridingUR L = KURL()); 147 void ensureWriter(const AtomicString& mimeType, const KURL& overridingUR L = KURL());
147 void endWriting(DocumentWriter*); 148 void endWriting(DocumentWriter*);
148 149
149 Document* document() const; 150 Document* document() const;
150 FrameLoader* frameLoader() const; 151 FrameLoader* frameLoader() const;
151 152
152 void commitIfReady(); 153 void commitIfReady();
153 void commitData(const char* bytes, size_t length); 154 void commitData(const char* bytes, size_t length);
154 void setMainDocumentError(const ResourceError&); 155 void setMainDocumentError(const ResourceError&);
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
216 DocumentLoadTiming m_documentLoadTiming; 217 DocumentLoadTiming m_documentLoadTiming;
217 218
218 double m_timeOfLastDataReceived; 219 double m_timeOfLastDataReceived;
219 220
220 friend class ApplicationCacheHost; // for substitute resource delivery 221 friend class ApplicationCacheHost; // for substitute resource delivery
221 OwnPtr<ApplicationCacheHost> m_applicationCacheHost; 222 OwnPtr<ApplicationCacheHost> m_applicationCacheHost;
222 }; 223 };
223 } 224 }
224 225
225 #endif // DocumentLoader_h 226 #endif // DocumentLoader_h
OLDNEW
« no previous file with comments | « Source/core/frame/LocalFrame.cpp ('k') | Source/core/loader/DocumentLoader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698