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 551 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
562 void DocumentLoader::ensureWriter() | 562 void DocumentLoader::ensureWriter() |
563 { | 563 { |
564 ensureWriter(m_response.mimeType()); | 564 ensureWriter(m_response.mimeType()); |
565 } | 565 } |
566 | 566 |
567 void DocumentLoader::ensureWriter(const String& mimeType, const KURL& overriding
URL) | 567 void DocumentLoader::ensureWriter(const String& mimeType, const KURL& overriding
URL) |
568 { | 568 { |
569 if (m_writer) | 569 if (m_writer) |
570 return; | 570 return; |
571 | 571 |
572 String encoding = overrideEncoding().isNull() ? response().textEncodingName(
).impl() : overrideEncoding(); | 572 const String& encoding = overrideEncoding().isNull() ? response().textEncodi
ngName().string() : overrideEncoding(); |
573 m_writer = createWriterFor(m_frame, 0, requestURL(), mimeType, encoding, fal
se, false); | 573 m_writer = createWriterFor(m_frame, 0, requestURL(), mimeType, encoding, fal
se, false); |
574 m_writer->setDocumentWasLoadedAsPartOfNavigation(); | 574 m_writer->setDocumentWasLoadedAsPartOfNavigation(); |
575 // This should be set before receivedFirstData(). | 575 // This should be set before receivedFirstData(). |
576 if (!overridingURL.isEmpty()) | 576 if (!overridingURL.isEmpty()) |
577 m_frame->document()->setBaseURLOverride(overridingURL); | 577 m_frame->document()->setBaseURLOverride(overridingURL); |
578 | 578 |
579 // Call receivedFirstData() exactly once per load. | 579 // Call receivedFirstData() exactly once per load. |
580 frameLoader()->receivedFirstData(); | 580 frameLoader()->receivedFirstData(); |
581 m_frame->document()->maybeHandleHttpRefresh(m_response.httpHeaderField("Refr
esh"), Document::HttpRefreshFromHeader); | 581 m_frame->document()->maybeHandleHttpRefresh(m_response.httpHeaderField("Refr
esh"), Document::HttpRefreshFromHeader); |
582 } | 582 } |
(...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
948 void DocumentLoader::replaceDocument(const String& source, Document* ownerDocume
nt) | 948 void DocumentLoader::replaceDocument(const String& source, Document* ownerDocume
nt) |
949 { | 949 { |
950 m_frame->loader().stopAllLoaders(); | 950 m_frame->loader().stopAllLoaders(); |
951 m_writer = createWriterFor(m_frame, ownerDocument, m_frame->document()->url(
), mimeType(), m_writer ? m_writer->encoding() : "", m_writer ? m_writer->encod
ingWasChosenByUser() : false, true); | 951 m_writer = createWriterFor(m_frame, ownerDocument, m_frame->document()->url(
), mimeType(), m_writer ? m_writer->encoding() : "", m_writer ? m_writer->encod
ingWasChosenByUser() : false, true); |
952 if (!source.isNull()) | 952 if (!source.isNull()) |
953 m_writer->appendReplacingData(source); | 953 m_writer->appendReplacingData(source); |
954 endWriting(m_writer.get()); | 954 endWriting(m_writer.get()); |
955 } | 955 } |
956 | 956 |
957 } // namespace WebCore | 957 } // namespace WebCore |
OLD | NEW |