Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(320)

Side by Side Diff: Source/core/loader/DocumentLoader.cpp

Issue 19002005: Share Custom Element registration contexts between related documents. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Tweak the test to do lazy wrapping in both cases. Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/core/inspector/DOMPatchSupport.cpp ('k') | Source/core/xml/DOMParser.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 12 matching lines...) Expand all
23 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 23 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
24 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 24 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
25 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 26 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
27 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 */ 28 */
29 29
30 #include "config.h" 30 #include "config.h"
31 #include "core/loader/DocumentLoader.h" 31 #include "core/loader/DocumentLoader.h"
32 32
33 #include "core/dom/CustomElementRegistrationContextualizer.h"
33 #include "core/dom/DOMImplementation.h" 34 #include "core/dom/DOMImplementation.h"
34 #include "core/dom/Document.h" 35 #include "core/dom/Document.h"
35 #include "core/dom/DocumentParser.h" 36 #include "core/dom/DocumentParser.h"
36 #include "core/dom/Event.h" 37 #include "core/dom/Event.h"
37 #include "core/dom/WebCoreMemoryInstrumentation.h" 38 #include "core/dom/WebCoreMemoryInstrumentation.h"
38 #include "core/html/HTMLFrameOwnerElement.h" 39 #include "core/html/HTMLFrameOwnerElement.h"
39 #include "core/inspector/InspectorInstrumentation.h" 40 #include "core/inspector/InspectorInstrumentation.h"
40 #include "core/loader/DocumentWriter.h" 41 #include "core/loader/DocumentWriter.h"
41 #include "core/loader/FrameLoader.h" 42 #include "core/loader/FrameLoader.h"
42 #include "core/loader/FrameLoaderClient.h" 43 #include "core/loader/FrameLoaderClient.h"
(...skipping 1005 matching lines...) Expand 10 before | Expand all | Expand 10 after
1048 m_writer->end(); 1049 m_writer->end();
1049 m_writer.clear(); 1050 m_writer.clear();
1050 } 1051 }
1051 1052
1052 1053
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 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 { 1055 {
1055 // Create a new document before clearing the frame, because it may need to 1056 // Create a new document before clearing the frame, because it may need to
1056 // inherit an aliased security context. 1057 // inherit an aliased security context.
1057 RefPtr<Document> document = DOMImplementation::createDocument(mimeType, fram e, url, frame->inViewSourceMode()); 1058 RefPtr<Document> document = DOMImplementation::createDocument(mimeType, fram e, url, frame->inViewSourceMode());
1059 CustomElementRegistrationContextualizer::didCreateDocument(CustomElementRegi strationContextualizer::Loader, document.get());
1058 if (document->isPluginDocument() && document->isSandboxed(SandboxPlugins)) 1060 if (document->isPluginDocument() && document->isSandboxed(SandboxPlugins))
1059 document = SinkDocument::create(frame, url); 1061 document = SinkDocument::create(frame, url);
1060 bool shouldReuseDefaultView = frame->loader()->stateMachine()->isDisplayingI nitialEmptyDocument() && frame->document()->isSecureTransitionTo(url); 1062 bool shouldReuseDefaultView = frame->loader()->stateMachine()->isDisplayingI nitialEmptyDocument() && frame->document()->isSecureTransitionTo(url);
1061 1063
1062 RefPtr<DOMWindow> originalDOMWindow; 1064 RefPtr<DOMWindow> originalDOMWindow;
1063 if (shouldReuseDefaultView) 1065 if (shouldReuseDefaultView)
1064 originalDOMWindow = frame->domWindow(); 1066 originalDOMWindow = frame->domWindow();
1065 frame->loader()->clear(!shouldReuseDefaultView, !shouldReuseDefaultView); 1067 frame->loader()->clear(!shouldReuseDefaultView, !shouldReuseDefaultView);
1066 1068
1067 if (!shouldReuseDefaultView) { 1069 if (!shouldReuseDefaultView) {
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
1099 void DocumentLoader::replaceDocument(const String& source, Document* ownerDocume nt) 1101 void DocumentLoader::replaceDocument(const String& source, Document* ownerDocume nt)
1100 { 1102 {
1101 m_frame->loader()->stopAllLoaders(); 1103 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); 1104 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()) 1105 if (!source.isNull())
1104 m_writer->appendReplacingData(source); 1106 m_writer->appendReplacingData(source);
1105 endWriting(m_writer.get()); 1107 endWriting(m_writer.get());
1106 } 1108 }
1107 1109
1108 } // namespace WebCore 1110 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/inspector/DOMPatchSupport.cpp ('k') | Source/core/xml/DOMParser.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698