| OLD | NEW |
| 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 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 const ResourceResponse& response() const { return m_response; } | 114 const ResourceResponse& response() const { return m_response; } |
| 115 const ResourceError& mainDocumentError() const { return m_mainDocumentEr
ror; } | 115 const ResourceError& mainDocumentError() const { return m_mainDocumentEr
ror; } |
| 116 bool isClientRedirect() const { return m_isClientRedirect; } | 116 bool isClientRedirect() const { return m_isClientRedirect; } |
| 117 void setIsClientRedirect(bool isClientRedirect) { m_isClientRedirect = i
sClientRedirect; } | 117 void setIsClientRedirect(bool isClientRedirect) { m_isClientRedirect = i
sClientRedirect; } |
| 118 void handledOnloadEvents(); | 118 void handledOnloadEvents(); |
| 119 bool wasOnloadHandled() { return m_wasOnloadHandled; } | 119 bool wasOnloadHandled() { return m_wasOnloadHandled; } |
| 120 bool isLoadingInAPISense() const; | 120 bool isLoadingInAPISense() const; |
| 121 void setTitle(const StringWithDirection&); | 121 void setTitle(const StringWithDirection&); |
| 122 const String& overrideEncoding() const { return m_overrideEncoding; } | 122 const String& overrideEncoding() const { return m_overrideEncoding; } |
| 123 | 123 |
| 124 bool scheduleArchiveLoad(ResourceLoader*, const ResourceRequest&); | 124 bool scheduleArchiveLoad(CachedResource*, const ResourceRequest&); |
| 125 | |
| 126 #ifndef NDEBUG | |
| 127 bool isSubstituteLoadPending(ResourceLoader*) const; | |
| 128 #endif | |
| 129 void cancelPendingSubstituteLoad(ResourceLoader*); | 125 void cancelPendingSubstituteLoad(ResourceLoader*); |
| 130 | 126 |
| 131 bool shouldContinueForNavigationPolicy(const ResourceRequest&); | 127 bool shouldContinueForNavigationPolicy(const ResourceRequest&); |
| 132 const NavigationAction& triggeringAction() const { return m_triggeringAc
tion; } | 128 const NavigationAction& triggeringAction() const { return m_triggeringAc
tion; } |
| 133 void setTriggeringAction(const NavigationAction& action) { m_triggeringA
ction = action; } | 129 void setTriggeringAction(const NavigationAction& action) { m_triggeringA
ction = action; } |
| 134 | 130 |
| 135 void setOverrideEncoding(const String& encoding) { m_overrideEncoding =
encoding; } | 131 void setOverrideEncoding(const String& encoding) { m_overrideEncoding =
encoding; } |
| 136 const StringWithDirection& title() const { return m_pageTitle; } | 132 const StringWithDirection& title() const { return m_pageTitle; } |
| 137 | 133 |
| 138 KURL urlForHistory() const; | 134 KURL urlForHistory() const; |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 198 void clearMainResourceLoader(); | 194 void clearMainResourceLoader(); |
| 199 | 195 |
| 200 void setupForReplace(); | 196 void setupForReplace(); |
| 201 void maybeFinishLoadingMultipartContent(); | 197 void maybeFinishLoadingMultipartContent(); |
| 202 | 198 |
| 203 bool maybeCreateArchive(); | 199 bool maybeCreateArchive(); |
| 204 void clearArchiveResources(); | 200 void clearArchiveResources(); |
| 205 | 201 |
| 206 void prepareSubframeArchiveLoadIfNeeded(); | 202 void prepareSubframeArchiveLoadIfNeeded(); |
| 207 void addAllArchiveResources(MHTMLArchive*); | 203 void addAllArchiveResources(MHTMLArchive*); |
| 208 ArchiveResource* archiveResourceForURL(const KURL&) const; | |
| 209 | 204 |
| 210 void willSendRequest(ResourceRequest&, const ResourceResponse&); | 205 void willSendRequest(ResourceRequest&, const ResourceResponse&); |
| 211 void finishedLoading(double finishTime); | 206 void finishedLoading(double finishTime); |
| 212 void mainReceivedError(const ResourceError&); | 207 void mainReceivedError(const ResourceError&); |
| 213 virtual void redirectReceived(CachedResource*, ResourceRequest&, const R
esourceResponse&) OVERRIDE; | 208 virtual void redirectReceived(CachedResource*, ResourceRequest&, const R
esourceResponse&) OVERRIDE; |
| 214 virtual void responseReceived(CachedResource*, const ResourceResponse&)
OVERRIDE; | 209 virtual void responseReceived(CachedResource*, const ResourceResponse&)
OVERRIDE; |
| 215 virtual void dataReceived(CachedResource*, const char* data, int length)
OVERRIDE; | 210 virtual void dataReceived(CachedResource*, const char* data, int length)
OVERRIDE; |
| 216 virtual void notifyFinished(CachedResource*) OVERRIDE; | 211 virtual void notifyFinished(CachedResource*) OVERRIDE; |
| 217 | 212 |
| 218 bool maybeLoadEmpty(); | 213 bool maybeLoadEmpty(); |
| 219 | 214 |
| 220 bool isMultipartReplacingLoad() const; | 215 bool isMultipartReplacingLoad() const; |
| 221 bool isPostOrRedirectAfterPost(const ResourceRequest&, const ResourceRes
ponse&); | 216 bool isPostOrRedirectAfterPost(const ResourceRequest&, const ResourceRes
ponse&); |
| 222 | 217 |
| 223 bool shouldContinueForResponse() const; | 218 bool shouldContinueForResponse() const; |
| 224 void stopLoadingForPolicyChange(); | 219 void stopLoadingForPolicyChange(); |
| 225 ResourceError interruptedForPolicyChangeError() const; | 220 ResourceError interruptedForPolicyChangeError() const; |
| 226 | 221 |
| 227 typedef Timer<DocumentLoader> DocumentLoaderTimer; | 222 typedef Timer<DocumentLoader> DocumentLoaderTimer; |
| 228 | 223 |
| 229 void handleSubstituteDataLoadSoon(); | 224 void handleSubstituteDataLoadSoon(); |
| 230 void handleSubstituteDataLoadNow(DocumentLoaderTimer*); | 225 void handleSubstituteDataLoadNow(DocumentLoaderTimer*); |
| 231 void startDataLoadTimer(); | 226 void startDataLoadTimer(); |
| 232 | |
| 233 void deliverSubstituteResourcesAfterDelay(); | |
| 234 void substituteResourceDeliveryTimerFired(Timer<DocumentLoader>*); | |
| 235 | 227 |
| 236 Frame* m_frame; | 228 Frame* m_frame; |
| 237 RefPtr<CachedResourceLoader> m_cachedResourceLoader; | 229 RefPtr<CachedResourceLoader> m_cachedResourceLoader; |
| 238 | 230 |
| 239 CachedResourceHandle<CachedRawResource> m_mainResource; | 231 CachedResourceHandle<CachedRawResource> m_mainResource; |
| 240 ResourceLoaderSet m_resourceLoaders; | 232 ResourceLoaderSet m_resourceLoaders; |
| 241 ResourceLoaderSet m_multipartResourceLoaders; | 233 ResourceLoaderSet m_multipartResourceLoaders; |
| 242 | 234 |
| 243 mutable DocumentWriter m_writer; | 235 mutable DocumentWriter m_writer; |
| 244 | 236 |
| (...skipping 29 matching lines...) Expand all Loading... |
| 274 // and should be merged. | 266 // and should be merged. |
| 275 bool m_wasOnloadHandled; | 267 bool m_wasOnloadHandled; |
| 276 | 268 |
| 277 StringWithDirection m_pageTitle; | 269 StringWithDirection m_pageTitle; |
| 278 | 270 |
| 279 String m_overrideEncoding; | 271 String m_overrideEncoding; |
| 280 | 272 |
| 281 // The action that triggered loading - we keep this around for the | 273 // The action that triggered loading - we keep this around for the |
| 282 // benefit of the various policy handlers. | 274 // benefit of the various policy handlers. |
| 283 NavigationAction m_triggeringAction; | 275 NavigationAction m_triggeringAction; |
| 284 | |
| 285 typedef HashMap<RefPtr<ResourceLoader>, RefPtr<SubstituteResource> > Sub
stituteResourceMap; | |
| 286 SubstituteResourceMap m_pendingSubstituteResources; | |
| 287 Timer<DocumentLoader> m_substituteResourceDeliveryTimer; | |
| 288 | 276 |
| 289 OwnPtr<ArchiveResourceCollection> m_archiveResourceCollection; | 277 OwnPtr<ArchiveResourceCollection> m_archiveResourceCollection; |
| 290 RefPtr<MHTMLArchive> m_archive; | 278 RefPtr<MHTMLArchive> m_archive; |
| 291 | 279 |
| 292 HashSet<String> m_resourcesClientKnowsAbout; | 280 HashSet<String> m_resourcesClientKnowsAbout; |
| 293 Vector<String> m_resourcesLoadedFromMemoryCacheForClientNotification; | 281 Vector<String> m_resourcesLoadedFromMemoryCacheForClientNotification; |
| 294 | 282 |
| 295 bool m_loadingMainResource; | 283 bool m_loadingMainResource; |
| 296 DocumentLoadTiming m_documentLoadTiming; | 284 DocumentLoadTiming m_documentLoadTiming; |
| 297 | 285 |
| (...skipping 13 matching lines...) Expand all Loading... |
| 311 | 299 |
| 312 inline void DocumentLoader::takeMemoryCacheLoadsForClientNotification(Vector
<String>& loadsSet) | 300 inline void DocumentLoader::takeMemoryCacheLoadsForClientNotification(Vector
<String>& loadsSet) |
| 313 { | 301 { |
| 314 loadsSet.swap(m_resourcesLoadedFromMemoryCacheForClientNotification); | 302 loadsSet.swap(m_resourcesLoadedFromMemoryCacheForClientNotification); |
| 315 m_resourcesLoadedFromMemoryCacheForClientNotification.clear(); | 303 m_resourcesLoadedFromMemoryCacheForClientNotification.clear(); |
| 316 } | 304 } |
| 317 | 305 |
| 318 } | 306 } |
| 319 | 307 |
| 320 #endif // DocumentLoader_h | 308 #endif // DocumentLoader_h |
| OLD | NEW |