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 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
285 if (!frameLoader()) | 285 if (!frameLoader()) |
286 return; | 286 return; |
287 | 287 |
288 if (!maybeCreateArchive()) { | 288 if (!maybeCreateArchive()) { |
289 // If this is an empty document, it will not have actually been created
yet. Commit dummy data so that | 289 // If this is an empty document, it will not have actually been created
yet. Commit dummy data so that |
290 // DocumentWriter::begin() gets called and creates the Document. | 290 // DocumentWriter::begin() gets called and creates the Document. |
291 if (!m_writer) | 291 if (!m_writer) |
292 commitData(0, 0); | 292 commitData(0, 0); |
293 } | 293 } |
294 | 294 |
| 295 m_applicationCacheHost->finishedLoadingMainResource(); |
295 endWriting(m_writer.get()); | 296 endWriting(m_writer.get()); |
296 | 297 if (m_state < MainResourceDone) |
297 if (!m_mainDocumentError.isNull()) | 298 m_state = MainResourceDone; |
298 return; | |
299 m_state = MainResourceDone; | |
300 | |
301 // If the document specified an application cache manifest, it violates the
author's intent if we store it in the memory cache | |
302 // and deny the appcache the chance to intercept it in the future, so remove
from the memory cache. | |
303 if (m_frame) { | |
304 if (m_mainResource && m_frame->document()->hasAppCacheManifest()) | |
305 memoryCache()->remove(m_mainResource.get()); | |
306 } | |
307 m_applicationCacheHost->finishedLoadingMainResource(); | |
308 clearMainResourceHandle(); | 299 clearMainResourceHandle(); |
309 } | 300 } |
310 | 301 |
311 bool DocumentLoader::isRedirectAfterPost(const ResourceRequest& newRequest, cons
t ResourceResponse& redirectResponse) | 302 bool DocumentLoader::isRedirectAfterPost(const ResourceRequest& newRequest, cons
t ResourceResponse& redirectResponse) |
312 { | 303 { |
313 int status = redirectResponse.httpStatusCode(); | 304 int status = redirectResponse.httpStatusCode(); |
314 if (((status >= 301 && status <= 303) || status == 307) | 305 if (((status >= 301 && status <= 303) || status == 307) |
315 && m_originalRequest.httpMethod() == "POST") | 306 && m_originalRequest.httpMethod() == "POST") |
316 return true; | 307 return true; |
317 | 308 |
(...skipping 524 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
842 { | 833 { |
843 m_writer = createWriterFor(ownerDocument, init, mimeType(), m_writer ? m_wri
ter->encoding() : emptyAtom, true, ForceSynchronousParsing); | 834 m_writer = createWriterFor(ownerDocument, init, mimeType(), m_writer ? m_wri
ter->encoding() : emptyAtom, true, ForceSynchronousParsing); |
844 if (!source.isNull()) | 835 if (!source.isNull()) |
845 m_writer->appendReplacingData(source); | 836 m_writer->appendReplacingData(source); |
846 endWriting(m_writer.get()); | 837 endWriting(m_writer.get()); |
847 } | 838 } |
848 | 839 |
849 DEFINE_WEAK_IDENTIFIER_MAP(DocumentLoader); | 840 DEFINE_WEAK_IDENTIFIER_MAP(DocumentLoader); |
850 | 841 |
851 } // namespace blink | 842 } // namespace blink |
OLD | NEW |