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

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

Issue 69823002: Move ownership of the TextResourceDecoder to DecodedDataDocumentParser (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Moved DocumentEncodingData to its own header Created 7 years, 1 month 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
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 914 matching lines...) Expand 10 before | Expand all | Expand 10 after
925 return DocumentWriter::create(document.get(), mimeType, encoding, userChosen ); 925 return DocumentWriter::create(document.get(), mimeType, encoding, userChosen );
926 } 926 }
927 927
928 String DocumentLoader::mimeType() const 928 String DocumentLoader::mimeType() const
929 { 929 {
930 if (m_writer) 930 if (m_writer)
931 return m_writer->mimeType(); 931 return m_writer->mimeType();
932 return m_response.mimeType(); 932 return m_response.mimeType();
933 } 933 }
934 934
935 void DocumentLoader::setUserChosenEncoding(const String& charset)
936 {
937 if (m_writer)
938 m_writer->setUserChosenEncoding(charset);
939 }
940
935 // This is only called by ScriptController::executeScriptIfJavaScriptURL 941 // This is only called by ScriptController::executeScriptIfJavaScriptURL
936 // and always contains the result of evaluating a javascript: url. 942 // and always contains the result of evaluating a javascript: url.
937 // This is the <iframe src="javascript:'html'"> case. 943 // This is the <iframe src="javascript:'html'"> case.
938 void DocumentLoader::replaceDocument(const String& source, Document* ownerDocume nt) 944 void DocumentLoader::replaceDocument(const String& source, Document* ownerDocume nt)
939 { 945 {
940 m_frame->loader().stopAllLoaders(); 946 m_frame->loader().stopAllLoaders();
941 m_writer = createWriterFor(m_frame, ownerDocument, m_frame->document()->url( ), mimeType(), m_writer ? m_writer->encoding() : "", m_writer ? m_writer->encod ingWasChosenByUser() : false, true); 947 m_writer = createWriterFor(m_frame, ownerDocument, m_frame->document()->url( ), mimeType(), m_writer ? m_writer->encoding() : "", m_writer ? m_writer->encod ingWasChosenByUser() : false, true);
942 if (!source.isNull()) 948 if (!source.isNull())
943 m_writer->appendReplacingData(source); 949 m_writer->appendReplacingData(source);
944 endWriting(m_writer.get()); 950 endWriting(m_writer.get());
945 } 951 }
946 952
947 } // namespace WebCore 953 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698