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

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

Issue 47923008: Block execution of failed 'crossorigin' <script>s. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
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
« no previous file with comments | « Source/core/fetch/ResourceLoaderOptions.h ('k') | Source/core/html/HTMLImportsController.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) 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 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 m_resource = 0; 104 m_resource = 0;
105 } 105 }
106 106
107 ASSERT(!document() || !document()->parsing()); 107 ASSERT(!document() || !document()->parsing());
108 root()->importWasDisposed(); 108 root()->importWasDisposed();
109 } 109 }
110 110
111 HTMLImportLoader::State HTMLImportLoader::startWritingAndParsing(const ResourceR esponse& response) 111 HTMLImportLoader::State HTMLImportLoader::startWritingAndParsing(const ResourceR esponse& response)
112 { 112 {
113 // Current canAccess() implementation isn't sufficient for catching cross-do main redirects: http://crbug.com/256976 113 // Current canAccess() implementation isn't sufficient for catching cross-do main redirects: http://crbug.com/256976
114 if (!parent()->document()->fetcher()->canAccess(m_resource.get())) 114 if (!parent()->document()->fetcher()->canAccess(m_resource.get(), Potentiall yCORSEnabled))
115 return StateError; 115 return StateError;
116 116
117 DocumentInit init = DocumentInit(response.url(), 0, root()->document()->cont extDocument(), this) 117 DocumentInit init = DocumentInit(response.url(), 0, root()->document()->cont extDocument(), this)
118 .withRegistrationContext(root()->document()->registrationContext()); 118 .withRegistrationContext(root()->document()->registrationContext());
119 m_importedDocument = HTMLDocument::create(init); 119 m_importedDocument = HTMLDocument::create(init);
120 m_importedDocument->initContentSecurityPolicy(ContentSecurityPolicyResponseH eaders(response)); 120 m_importedDocument->initContentSecurityPolicy(ContentSecurityPolicyResponseH eaders(response));
121 m_writer = DocumentWriter::create(m_importedDocument.get(), response.mimeTyp e(), response.textEncodingName()); 121 m_writer = DocumentWriter::create(m_importedDocument.get(), response.mimeTyp e(), response.textEncodingName());
122 122
123 return StateLoading; 123 return StateLoading;
124 } 124 }
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
194 } 194 }
195 195
196 bool HTMLImportLoader::isProcessing() const 196 bool HTMLImportLoader::isProcessing() const
197 { 197 {
198 if (!m_importedDocument) 198 if (!m_importedDocument)
199 return !isDone(); 199 return !isDone();
200 return m_importedDocument->parsing(); 200 return m_importedDocument->parsing();
201 } 201 }
202 202
203 } // namespace WebCore 203 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/fetch/ResourceLoaderOptions.h ('k') | Source/core/html/HTMLImportsController.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698