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

Side by Side Diff: Source/core/loader/DocumentLoader.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/html/parser/HTMLScriptRunner.cpp ('k') | Source/core/xml/XSLTProcessorLibxslt.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) 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 824 matching lines...) Expand 10 before | Expand all | Expand 10 after
835 835
836 if (m_substituteData.isValid()) { 836 if (m_substituteData.isValid()) {
837 m_identifierForLoadWithoutResourceLoader = createUniqueIdentifier(); 837 m_identifierForLoadWithoutResourceLoader = createUniqueIdentifier();
838 frame()->fetchContext().dispatchWillSendRequest(this, m_identifierForLoa dWithoutResourceLoader, m_request, ResourceResponse()); 838 frame()->fetchContext().dispatchWillSendRequest(this, m_identifierForLoa dWithoutResourceLoader, m_request, ResourceResponse());
839 handleSubstituteDataLoadSoon(); 839 handleSubstituteDataLoadSoon();
840 return; 840 return;
841 } 841 }
842 842
843 ResourceRequest request(m_request); 843 ResourceRequest request(m_request);
844 DEFINE_STATIC_LOCAL(ResourceLoaderOptions, mainResourceLoadOptions, 844 DEFINE_STATIC_LOCAL(ResourceLoaderOptions, mainResourceLoadOptions,
845 (SendCallbacks, SniffContent, DoNotBufferData, AllowStoredCredentials, C lientRequestedCredentials, AskClientForCrossOriginCredentials, SkipSecurityCheck , CheckContentSecurityPolicy, UseDefaultOriginRestrictionsForType, DocumentConte xt)); 845 (SendCallbacks, SniffContent, DoNotBufferData, AllowStoredCredentials, C lientRequestedCredentials, AskClientForCrossOriginCredentials, SkipSecurityCheck , CheckContentSecurityPolicy, DocumentContext));
846 FetchRequest cachedResourceRequest(request, FetchInitiatorTypeNames::documen t, mainResourceLoadOptions); 846 FetchRequest cachedResourceRequest(request, FetchInitiatorTypeNames::documen t, mainResourceLoadOptions);
847 m_mainResource = m_fetcher->fetchMainResource(cachedResourceRequest); 847 m_mainResource = m_fetcher->fetchMainResource(cachedResourceRequest);
848 if (!m_mainResource) { 848 if (!m_mainResource) {
849 setRequest(ResourceRequest()); 849 setRequest(ResourceRequest());
850 // If the load was aborted by clearing m_request, it's possible the Appl icationCacheHost 850 // If the load was aborted by clearing m_request, it's possible the Appl icationCacheHost
851 // is now in a state where starting an empty load will be inconsistent. Replace it with 851 // is now in a state where starting an empty load will be inconsistent. Replace it with
852 // a new ApplicationCacheHost. 852 // a new ApplicationCacheHost.
853 m_applicationCacheHost = adoptPtr(new ApplicationCacheHost(this)); 853 m_applicationCacheHost = adoptPtr(new ApplicationCacheHost(this));
854 maybeLoadEmpty(); 854 maybeLoadEmpty();
855 return; 855 return;
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
948 void DocumentLoader::replaceDocument(const String& source, Document* ownerDocume nt) 948 void DocumentLoader::replaceDocument(const String& source, Document* ownerDocume nt)
949 { 949 {
950 m_frame->loader().stopAllLoaders(); 950 m_frame->loader().stopAllLoaders();
951 m_writer = createWriterFor(m_frame, ownerDocument, m_frame->document()->url( ), mimeType(), m_writer ? m_writer->encoding() : "", m_writer ? m_writer->encod ingWasChosenByUser() : false, true); 951 m_writer = createWriterFor(m_frame, ownerDocument, m_frame->document()->url( ), mimeType(), m_writer ? m_writer->encoding() : "", m_writer ? m_writer->encod ingWasChosenByUser() : false, true);
952 if (!source.isNull()) 952 if (!source.isNull())
953 m_writer->appendReplacingData(source); 953 m_writer->appendReplacingData(source);
954 endWriting(m_writer.get()); 954 endWriting(m_writer.get());
955 } 955 }
956 956
957 } // namespace WebCore 957 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/html/parser/HTMLScriptRunner.cpp ('k') | Source/core/xml/XSLTProcessorLibxslt.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698