| 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 1038 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1049 m_writer.clear(); | 1049 m_writer.clear(); |
| 1050 } | 1050 } |
| 1051 | 1051 |
| 1052 | 1052 |
| 1053 PassRefPtr<DocumentWriter> DocumentLoader::createWriterFor(Frame* frame, const D
ocument* ownerDocument, const KURL& url, const String& mimeType, const String& e
ncoding, bool userChosen, bool dispatch) | 1053 PassRefPtr<DocumentWriter> DocumentLoader::createWriterFor(Frame* frame, const D
ocument* ownerDocument, const KURL& url, const String& mimeType, const String& e
ncoding, bool userChosen, bool dispatch) |
| 1054 { | 1054 { |
| 1055 // Create a new document before clearing the frame, because it may need to | 1055 // Create a new document before clearing the frame, because it may need to |
| 1056 // inherit an aliased security context. | 1056 // inherit an aliased security context. |
| 1057 RefPtr<Document> document = DOMImplementation::createDocument(mimeType, fram
e, url, frame->inViewSourceMode()); | 1057 RefPtr<Document> document = DOMImplementation::createDocument(mimeType, fram
e, url, frame->inViewSourceMode()); |
| 1058 if (document->isPluginDocument() && document->isSandboxed(SandboxPlugins)) | 1058 if (document->isPluginDocument() && document->isSandboxed(SandboxPlugins)) |
| 1059 document = SinkDocument::create(frame, url); | 1059 document = SinkDocument::create(DocumentInitializer(url, frame)); |
| 1060 bool shouldReuseDefaultView = frame->loader()->stateMachine()->isDisplayingI
nitialEmptyDocument() && frame->document()->isSecureTransitionTo(url); | 1060 bool shouldReuseDefaultView = frame->loader()->stateMachine()->isDisplayingI
nitialEmptyDocument() && frame->document()->isSecureTransitionTo(url); |
| 1061 | 1061 |
| 1062 RefPtr<DOMWindow> originalDOMWindow; | 1062 RefPtr<DOMWindow> originalDOMWindow; |
| 1063 if (shouldReuseDefaultView) | 1063 if (shouldReuseDefaultView) |
| 1064 originalDOMWindow = frame->domWindow(); | 1064 originalDOMWindow = frame->domWindow(); |
| 1065 frame->loader()->clear(!shouldReuseDefaultView, !shouldReuseDefaultView); | 1065 frame->loader()->clear(!shouldReuseDefaultView, !shouldReuseDefaultView); |
| 1066 | 1066 |
| 1067 if (!shouldReuseDefaultView) { | 1067 if (!shouldReuseDefaultView) { |
| 1068 frame->setDOMWindow(DOMWindow::create(frame)); | 1068 frame->setDOMWindow(DOMWindow::create(frame)); |
| 1069 } else { | 1069 } else { |
| (...skipping 29 matching lines...) Expand all Loading... |
| 1099 void DocumentLoader::replaceDocument(const String& source, Document* ownerDocume
nt) | 1099 void DocumentLoader::replaceDocument(const String& source, Document* ownerDocume
nt) |
| 1100 { | 1100 { |
| 1101 m_frame->loader()->stopAllLoaders(); | 1101 m_frame->loader()->stopAllLoaders(); |
| 1102 m_writer = createWriterFor(m_frame, ownerDocument, m_frame->document()->url(
), mimeType(), m_writer ? m_writer->encoding() : "", m_writer ? m_writer->encod
ingWasChosenByUser() : false, true); | 1102 m_writer = createWriterFor(m_frame, ownerDocument, m_frame->document()->url(
), mimeType(), m_writer ? m_writer->encoding() : "", m_writer ? m_writer->encod
ingWasChosenByUser() : false, true); |
| 1103 if (!source.isNull()) | 1103 if (!source.isNull()) |
| 1104 m_writer->appendReplacingData(source); | 1104 m_writer->appendReplacingData(source); |
| 1105 endWriting(m_writer.get()); | 1105 endWriting(m_writer.get()); |
| 1106 } | 1106 } |
| 1107 | 1107 |
| 1108 } // namespace WebCore | 1108 } // namespace WebCore |
| OLD | NEW |