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

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

Issue 1194003004: Oilpan: enable appcache + move DocumentLoader to the heap. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: add outer loader protection Created 5 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 unified diff | Download patch
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 30 matching lines...) Expand all
41 #include "core/loader/DocumentWriter.h" 41 #include "core/loader/DocumentWriter.h"
42 #include "core/loader/FrameLoaderTypes.h" 42 #include "core/loader/FrameLoaderTypes.h"
43 #include "core/loader/NavigationPolicy.h" 43 #include "core/loader/NavigationPolicy.h"
44 #include "platform/network/ResourceError.h" 44 #include "platform/network/ResourceError.h"
45 #include "platform/network/ResourceRequest.h" 45 #include "platform/network/ResourceRequest.h"
46 #include "platform/network/ResourceResponse.h" 46 #include "platform/network/ResourceResponse.h"
47 #include "wtf/HashSet.h" 47 #include "wtf/HashSet.h"
48 #include "wtf/RefPtr.h" 48 #include "wtf/RefPtr.h"
49 49
50 namespace blink { 50 namespace blink {
51
51 class ApplicationCacheHost; 52 class ApplicationCacheHost;
52 class ResourceFetcher; 53 class ResourceFetcher;
53 class DocumentInit; 54 class DocumentInit;
54 class LocalFrame; 55 class LocalFrame;
55 class FrameLoader; 56 class FrameLoader;
56 class MHTMLArchive; 57 class MHTMLArchive;
57 class ResourceLoader; 58 class ResourceLoader;
58 class ThreadedDataReceiver; 59 class ThreadedDataReceiver;
59 60
60 class CORE_EXPORT DocumentLoader : public RefCounted<DocumentLoader>, privat e RawResourceClient { 61 class CORE_EXPORT DocumentLoader : public RefCountedWillBeGarbageCollectedFi nalized<DocumentLoader>, private RawResourceClient {
61 WTF_MAKE_FAST_ALLOCATED(DocumentLoader); 62 WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED(DocumentLoader);
62 public: 63 public:
63 static PassRefPtr<DocumentLoader> create(LocalFrame* frame, const Resour ceRequest& request, const SubstituteData& data) 64 static PassRefPtrWillBeRawPtr<DocumentLoader> create(LocalFrame* frame, const ResourceRequest& request, const SubstituteData& data)
64 { 65 {
65 return adoptRef(new DocumentLoader(frame, request, data)); 66 return adoptRefWillBeNoop(new DocumentLoader(frame, request, data));
66 } 67 }
67 virtual ~DocumentLoader(); 68 virtual ~DocumentLoader();
68 69
69 LocalFrame* frame() const { return m_frame; } 70 LocalFrame* frame() const { return m_frame; }
70 71
71 void detachFromFrame(); 72 virtual void detachFromFrame();
72 73
73 unsigned long mainResourceIdentifier() const; 74 unsigned long mainResourceIdentifier() const;
74 75
75 void replaceDocumentWhileExecutingJavaScriptURL(const DocumentInit&, con st String& source, Document*); 76 void replaceDocumentWhileExecutingJavaScriptURL(const DocumentInit&, con st String& source, Document*);
76 77
77 const AtomicString& mimeType() const; 78 const AtomicString& mimeType() const;
78 79
79 const ResourceRequest& originalRequest() const; 80 const ResourceRequest& originalRequest() const;
80 81
81 const ResourceRequest& request() const; 82 const ResourceRequest& request() const;
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 135
135 // TODO(skobes): Move FrameView::m_wasScrolledByUser into here. 136 // TODO(skobes): Move FrameView::m_wasScrolledByUser into here.
136 bool didRestoreFromHistory; 137 bool didRestoreFromHistory;
137 }; 138 };
138 InitialScrollState& initialScrollState() { return m_initialScrollState; } 139 InitialScrollState& initialScrollState() { return m_initialScrollState; }
139 140
140 bool loadingMultipartContent() const; 141 bool loadingMultipartContent() const;
141 142
142 void startPreload(Resource::Type, FetchRequest&); 143 void startPreload(Resource::Type, FetchRequest&);
143 144
145 EAGERLY_FINALIZE();
haraken 2015/06/22 01:57:58 Can we add a comment for why this needs to be eage
sof 2015/06/22 06:49:18 I've removed it, as DocumentLoader currently requi
146 DECLARE_VIRTUAL_TRACE();
147
144 protected: 148 protected:
145 DocumentLoader(LocalFrame*, const ResourceRequest&, const SubstituteData &); 149 DocumentLoader(LocalFrame*, const ResourceRequest&, const SubstituteData &);
146 150
147 Vector<KURL> m_redirectChain; 151 Vector<KURL> m_redirectChain;
148 152
149 private: 153 private:
150 static PassRefPtrWillBeRawPtr<DocumentWriter> createWriterFor(const Docu ment* ownerDocument, const DocumentInit&, const AtomicString& mimeType, const At omicString& encoding, bool dispatch, ParserSynchronizationPolicy); 154 static PassRefPtrWillBeRawPtr<DocumentWriter> createWriterFor(const Docu ment* ownerDocument, const DocumentInit&, const AtomicString& mimeType, const At omicString& encoding, bool dispatch, ParserSynchronizationPolicy);
151 155
152 void ensureWriter(const AtomicString& mimeType, const KURL& overridingUR L = KURL()); 156 void ensureWriter(const AtomicString& mimeType, const KURL& overridingUR L = KURL());
153 void endWriting(DocumentWriter*); 157 void endWriting(DocumentWriter*);
(...skipping 20 matching lines...) Expand all
174 virtual void responseReceived(Resource*, const ResourceResponse&, PassOw nPtr<WebDataConsumerHandle>) override final; 178 virtual void responseReceived(Resource*, const ResourceResponse&, PassOw nPtr<WebDataConsumerHandle>) override final;
175 virtual void dataReceived(Resource*, const char* data, unsigned length) override final; 179 virtual void dataReceived(Resource*, const char* data, unsigned length) override final;
176 virtual void notifyFinished(Resource*) override final; 180 virtual void notifyFinished(Resource*) override final;
177 181
178 bool maybeLoadEmpty(); 182 bool maybeLoadEmpty();
179 183
180 bool isRedirectAfterPost(const ResourceRequest&, const ResourceResponse& ); 184 bool isRedirectAfterPost(const ResourceRequest&, const ResourceResponse& );
181 185
182 bool shouldContinueForResponse() const; 186 bool shouldContinueForResponse() const;
183 187
184 LocalFrame* m_frame; 188 LocalFrame* m_frame;
haraken 2015/06/22 01:57:58 Can we make this a Member?
sof 2015/06/22 06:49:18 Done.
185 RefPtrWillBePersistent<ResourceFetcher> m_fetcher; 189 RefPtrWillBeMember<ResourceFetcher> m_fetcher;
186 190
187 ResourcePtr<RawResource> m_mainResource; 191 ResourcePtr<RawResource> m_mainResource;
188 192
189 RefPtrWillBePersistent<DocumentWriter> m_writer; 193 RefPtrWillBeMember<DocumentWriter> m_writer;
190 194
191 // A reference to actual request used to create the data source. 195 // A reference to actual request used to create the data source.
192 // The only part of this request that should change is the url, and 196 // The only part of this request that should change is the url, and
193 // that only in the case of a same-document navigation. 197 // that only in the case of a same-document navigation.
194 ResourceRequest m_originalRequest; 198 ResourceRequest m_originalRequest;
195 199
196 SubstituteData m_substituteData; 200 SubstituteData m_substituteData;
197 201
198 // The 'working' request. It may be mutated 202 // The 'working' request. It may be mutated
199 // several times from the original request to include additional 203 // several times from the original request to include additional
200 // headers, cookie information, canonicalization and redirects. 204 // headers, cookie information, canonicalization and redirects.
201 ResourceRequest m_request; 205 ResourceRequest m_request;
202 206
203 ResourceResponse m_response; 207 ResourceResponse m_response;
204 208
205 ResourceError m_mainDocumentError; 209 ResourceError m_mainDocumentError;
206 210
207 bool m_committed; 211 bool m_committed;
208 bool m_isClientRedirect; 212 bool m_isClientRedirect;
209 bool m_replacesCurrentHistoryItem; 213 bool m_replacesCurrentHistoryItem;
210 214
211 NavigationType m_navigationType; 215 NavigationType m_navigationType;
212 216
213 RefPtrWillBePersistent<MHTMLArchive> m_archive; 217 RefPtrWillBeMember<MHTMLArchive> m_archive;
214 218
215 bool m_loadingMainResource; 219 bool m_loadingMainResource;
216 DocumentLoadTiming m_documentLoadTiming; 220 DocumentLoadTiming m_documentLoadTiming;
217 221
218 double m_timeOfLastDataReceived; 222 double m_timeOfLastDataReceived;
219 223
220 friend class ApplicationCacheHost; // for substitute resource delivery 224 PersistentWillBeMember<ApplicationCacheHost> m_applicationCacheHost;
221 OwnPtrWillBePersistent<ApplicationCacheHost> m_applicationCacheHost;
222 225
223 RefPtr<ContentSecurityPolicy> m_contentSecurityPolicy; 226 RefPtr<ContentSecurityPolicy> m_contentSecurityPolicy;
224 ClientHintsPreferences m_clientHintsPreferences; 227 ClientHintsPreferences m_clientHintsPreferences;
225 InitialScrollState m_initialScrollState; 228 InitialScrollState m_initialScrollState;
226 }; 229 };
227 } 230
231 } // namespace blink
228 232
229 #endif // DocumentLoader_h 233 #endif // DocumentLoader_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698