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

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

Issue 23455024: Move ownership of the TextResourceDecoder to DecodedDataDocumentParser (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebased 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/loader/DocumentLoader.h ('k') | Source/core/loader/DocumentWriter.h » ('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 913 matching lines...) Expand 10 before | Expand all | Expand 10 after
924 return DocumentWriter::create(document.get(), mimeType, encoding, userChosen ); 924 return DocumentWriter::create(document.get(), mimeType, encoding, userChosen );
925 } 925 }
926 926
927 String DocumentLoader::mimeType() const 927 String DocumentLoader::mimeType() const
928 { 928 {
929 if (m_writer) 929 if (m_writer)
930 return m_writer->mimeType(); 930 return m_writer->mimeType();
931 return m_response.mimeType(); 931 return m_response.mimeType();
932 } 932 }
933 933
934 void DocumentLoader::setUserChosenEncoding(const String& charset)
935 {
936 if (m_writer)
937 m_writer->setUserChosenEncoding(charset);
938 }
939
934 // This is only called by ScriptController::executeScriptIfJavaScriptURL 940 // This is only called by ScriptController::executeScriptIfJavaScriptURL
935 // and always contains the result of evaluating a javascript: url. 941 // and always contains the result of evaluating a javascript: url.
936 // This is the <iframe src="javascript:'html'"> case. 942 // This is the <iframe src="javascript:'html'"> case.
937 void DocumentLoader::replaceDocument(const String& source, Document* ownerDocume nt) 943 void DocumentLoader::replaceDocument(const String& source, Document* ownerDocume nt)
938 { 944 {
939 m_frame->loader().stopAllLoaders(); 945 m_frame->loader().stopAllLoaders();
940 m_writer = createWriterFor(m_frame, ownerDocument, m_frame->document()->url( ), mimeType(), m_writer ? m_writer->encoding() : "", m_writer ? m_writer->encod ingWasChosenByUser() : false, true); 946 m_writer = createWriterFor(m_frame, ownerDocument, m_frame->document()->url( ), mimeType(), m_writer ? m_writer->encoding() : "", m_writer ? m_writer->encod ingWasChosenByUser() : false, true);
941 if (!source.isNull()) 947 if (!source.isNull())
942 m_writer->appendReplacingData(source); 948 m_writer->appendReplacingData(source);
943 endWriting(m_writer.get()); 949 endWriting(m_writer.get());
944 } 950 }
945 951
946 } // namespace WebCore 952 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/loader/DocumentLoader.h ('k') | Source/core/loader/DocumentWriter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698