OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 2008 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 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
284 if (!frameLoader()) | 284 if (!frameLoader()) |
285 return; | 285 return; |
286 | 286 |
287 if (!maybeCreateArchive()) { | 287 if (!maybeCreateArchive()) { |
288 // If this is an empty document, it will not have actually been created
yet. Commit dummy data so that | 288 // If this is an empty document, it will not have actually been created
yet. Commit dummy data so that |
289 // DocumentWriter::begin() gets called and creates the Document. | 289 // DocumentWriter::begin() gets called and creates the Document. |
290 if (!m_writer) | 290 if (!m_writer) |
291 commitData(0, 0); | 291 commitData(0, 0); |
292 } | 292 } |
293 | 293 |
| 294 m_applicationCacheHost->finishedLoadingMainResource(); |
294 endWriting(m_writer.get()); | 295 endWriting(m_writer.get()); |
295 | 296 if (m_state < MainResourceDone) |
296 if (!m_mainDocumentError.isNull()) | 297 m_state = MainResourceDone; |
297 return; | |
298 m_state = MainResourceDone; | |
299 | |
300 // If the document specified an application cache manifest, it violates the
author's intent if we store it in the memory cache | |
301 // and deny the appcache the chance to intercept it in the future, so remove
from the memory cache. | |
302 if (m_frame) { | |
303 if (m_mainResource && m_frame->document()->hasAppCacheManifest()) | |
304 memoryCache()->remove(m_mainResource.get()); | |
305 } | |
306 m_applicationCacheHost->finishedLoadingMainResource(); | |
307 clearMainResourceHandle(); | 298 clearMainResourceHandle(); |
308 } | 299 } |
309 | 300 |
310 bool DocumentLoader::isRedirectAfterPost(const ResourceRequest& newRequest, cons
t ResourceResponse& redirectResponse) | 301 bool DocumentLoader::isRedirectAfterPost(const ResourceRequest& newRequest, cons
t ResourceResponse& redirectResponse) |
311 { | 302 { |
312 int status = redirectResponse.httpStatusCode(); | 303 int status = redirectResponse.httpStatusCode(); |
313 if (((status >= 301 && status <= 303) || status == 307) | 304 if (((status >= 301 && status <= 303) || status == 307) |
314 && m_originalRequest.httpMethod() == "POST") | 305 && m_originalRequest.httpMethod() == "POST") |
315 return true; | 306 return true; |
316 | 307 |
(...skipping 558 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
875 { | 866 { |
876 m_writer = createWriterFor(ownerDocument, init, mimeType(), m_writer ? m_wri
ter->encoding() : emptyAtom, true, ForceSynchronousParsing); | 867 m_writer = createWriterFor(ownerDocument, init, mimeType(), m_writer ? m_wri
ter->encoding() : emptyAtom, true, ForceSynchronousParsing); |
877 if (!source.isNull()) | 868 if (!source.isNull()) |
878 m_writer->appendReplacingData(source); | 869 m_writer->appendReplacingData(source); |
879 endWriting(m_writer.get()); | 870 endWriting(m_writer.get()); |
880 } | 871 } |
881 | 872 |
882 DEFINE_WEAK_IDENTIFIER_MAP(DocumentLoader); | 873 DEFINE_WEAK_IDENTIFIER_MAP(DocumentLoader); |
883 | 874 |
884 } // namespace blink | 875 } // namespace blink |
OLD | NEW |