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 483 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
494 if (m_writer) | 494 if (m_writer) |
495 return; | 495 return; |
496 | 496 |
497 const AtomicString& encoding = overrideEncoding().isNull() ? response().text EncodingName() : overrideEncoding(); | 497 const AtomicString& encoding = overrideEncoding().isNull() ? response().text EncodingName() : overrideEncoding(); |
498 m_writer = createWriterFor(m_frame, 0, url(), mimeType, encoding, false, fal se); | 498 m_writer = createWriterFor(m_frame, 0, url(), mimeType, encoding, false, fal se); |
499 m_writer->setDocumentWasLoadedAsPartOfNavigation(); | 499 m_writer->setDocumentWasLoadedAsPartOfNavigation(); |
500 // This should be set before receivedFirstData(). | 500 // This should be set before receivedFirstData(). |
501 if (!overridingURL.isEmpty()) | 501 if (!overridingURL.isEmpty()) |
502 m_frame->document()->setBaseURLOverride(overridingURL); | 502 m_frame->document()->setBaseURLOverride(overridingURL); |
503 | 503 |
504 m_frame->document()->initScriptEnabled(); | |
abarth-chromium
2014/06/26 19:53:37
Can we move this call into Document::Document, rig
mmal
2014/06/27 19:39:16
I'm afraid we can't. Causes crash on WebSecurityOr
| |
505 | |
504 // Call receivedFirstData() exactly once per load. | 506 // Call receivedFirstData() exactly once per load. |
505 frameLoader()->receivedFirstData(); | 507 frameLoader()->receivedFirstData(); |
506 m_frame->document()->maybeHandleHttpRefresh(m_response.httpHeaderField("Refr esh"), Document::HttpRefreshFromHeader); | 508 m_frame->document()->maybeHandleHttpRefresh(m_response.httpHeaderField("Refr esh"), Document::HttpRefreshFromHeader); |
507 } | 509 } |
508 | 510 |
509 void DocumentLoader::commitData(const char* bytes, size_t length) | 511 void DocumentLoader::commitData(const char* bytes, size_t length) |
510 { | 512 { |
511 ensureWriter(m_response.mimeType()); | 513 ensureWriter(m_response.mimeType()); |
512 ASSERT(m_frame->document()->parsing()); | 514 ASSERT(m_frame->document()->parsing()); |
513 m_writer->addData(bytes, length); | 515 m_writer->addData(bytes, length); |
(...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
822 void DocumentLoader::replaceDocument(const String& source, Document* ownerDocume nt) | 824 void DocumentLoader::replaceDocument(const String& source, Document* ownerDocume nt) |
823 { | 825 { |
824 m_frame->loader().stopAllLoaders(); | 826 m_frame->loader().stopAllLoaders(); |
825 m_writer = createWriterFor(m_frame, ownerDocument, m_frame->document()->url( ), mimeType(), m_writer ? m_writer->encoding() : emptyAtom, m_writer ? m_writer ->encodingWasChosenByUser() : false, true); | 827 m_writer = createWriterFor(m_frame, ownerDocument, m_frame->document()->url( ), mimeType(), m_writer ? m_writer->encoding() : emptyAtom, m_writer ? m_writer ->encodingWasChosenByUser() : false, true); |
826 if (!source.isNull()) | 828 if (!source.isNull()) |
827 m_writer->appendReplacingData(source); | 829 m_writer->appendReplacingData(source); |
828 endWriting(m_writer.get()); | 830 endWriting(m_writer.get()); |
829 } | 831 } |
830 | 832 |
831 } // namespace WebCore | 833 } // namespace WebCore |
OLD | NEW |