OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
172 if (HTMLImportsController* controller = this->controller()) | 172 if (HTMLImportsController* controller = this->controller()) |
173 controller->didLoad(this); | 173 controller->didLoad(this); |
174 } | 174 } |
175 | 175 |
176 HTMLImportLoader::State HTMLImportLoader::startParsing(const ResourceResponse& r
esponse) | 176 HTMLImportLoader::State HTMLImportLoader::startParsing(const ResourceResponse& r
esponse) |
177 { | 177 { |
178 // Current canAccess() implementation isn't sufficient for catching cross-do
main redirects: http://crbug.com/256976 | 178 // Current canAccess() implementation isn't sufficient for catching cross-do
main redirects: http://crbug.com/256976 |
179 if (!controller()->cachedResourceLoader()->canAccess(m_resource.get())) | 179 if (!controller()->cachedResourceLoader()->canAccess(m_resource.get())) |
180 return StateError; | 180 return StateError; |
181 | 181 |
182 m_importedDocument = HTMLDocument::create(0, response.url()); | 182 m_importedDocument = HTMLDocument::create(DocumentInit(response.url(), 0, th
is)); |
183 m_importedDocument->setImport(this); | |
184 m_writer = DocumentWriter::create(m_importedDocument.get(), response.mimeTyp
e(), response.textEncodingName()); | 183 m_writer = DocumentWriter::create(m_importedDocument.get(), response.mimeTyp
e(), response.textEncodingName()); |
185 | 184 |
186 return StateLoading; | 185 return StateLoading; |
187 } | 186 } |
188 | 187 |
189 HTMLImportLoader::State HTMLImportLoader::finish() | 188 HTMLImportLoader::State HTMLImportLoader::finish() |
190 { | 189 { |
191 if (!m_parent) | 190 if (!m_parent) |
192 return StateError; | 191 return StateError; |
193 // The writer instance indicates that a part of the document can be already
loaded. | 192 // The writer instance indicates that a part of the document can be already
loaded. |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
323 { | 322 { |
324 return m_master; | 323 return m_master; |
325 } | 324 } |
326 | 325 |
327 void HTMLImportsController::wasDetachedFromDocument() | 326 void HTMLImportsController::wasDetachedFromDocument() |
328 { | 327 { |
329 clear(); | 328 clear(); |
330 } | 329 } |
331 | 330 |
332 } // namespace WebCore | 331 } // namespace WebCore |
OLD | NEW |