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

Side by Side Diff: Source/core/html/HTMLImportsController.cpp

Issue 18808004: Refactoring: Extract DocumentInit for capture Document construction parameter. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fixed webkit_unit_tests build failure. 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/html/HTMLDocument.cpp ('k') | Source/core/html/HTMLViewSourceDocument.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) 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
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
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
OLDNEW
« no previous file with comments | « Source/core/html/HTMLDocument.cpp ('k') | Source/core/html/HTMLViewSourceDocument.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698