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

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: Have CSSImageValue::cachedImage() take a CORS enabled argument 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
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 819 matching lines...) Expand 10 before | Expand all | Expand 10 after
830 830
831 if (m_substituteData.isValid()) { 831 if (m_substituteData.isValid()) {
832 m_identifierForLoadWithoutResourceLoader = createUniqueIdentifier(); 832 m_identifierForLoadWithoutResourceLoader = createUniqueIdentifier();
833 frame()->fetchContext().dispatchWillSendRequest(this, m_identifierForLoa dWithoutResourceLoader, m_request, ResourceResponse()); 833 frame()->fetchContext().dispatchWillSendRequest(this, m_identifierForLoa dWithoutResourceLoader, m_request, ResourceResponse());
834 handleSubstituteDataLoadSoon(); 834 handleSubstituteDataLoadSoon();
835 return; 835 return;
836 } 836 }
837 837
838 ResourceRequest request(m_request); 838 ResourceRequest request(m_request);
839 DEFINE_STATIC_LOCAL(ResourceLoaderOptions, mainResourceLoadOptions, 839 DEFINE_STATIC_LOCAL(ResourceLoaderOptions, mainResourceLoadOptions,
840 (SendCallbacks, SniffContent, DoNotBufferData, AllowStoredCredentials, C lientRequestedCredentials, AskClientForCrossOriginCredentials, SkipSecurityCheck , CheckContentSecurityPolicy, UseDefaultOriginRestrictionsForType, DocumentConte xt)); 840 (SendCallbacks, SniffContent, DoNotBufferData, AllowStoredCredentials, C lientRequestedCredentials, AskClientForCrossOriginCredentials, SkipSecurityCheck , CheckContentSecurityPolicy, DocumentContext));
841 FetchRequest cachedResourceRequest(request, FetchInitiatorTypeNames::documen t, mainResourceLoadOptions); 841 FetchRequest cachedResourceRequest(request, FetchInitiatorTypeNames::documen t, mainResourceLoadOptions);
842 m_mainResource = m_fetcher->fetchMainResource(cachedResourceRequest); 842 m_mainResource = m_fetcher->fetchMainResource(cachedResourceRequest);
843 if (!m_mainResource) { 843 if (!m_mainResource) {
844 setRequest(ResourceRequest()); 844 setRequest(ResourceRequest());
845 // If the load was aborted by clearing m_request, it's possible the Appl icationCacheHost 845 // If the load was aborted by clearing m_request, it's possible the Appl icationCacheHost
846 // is now in a state where starting an empty load will be inconsistent. Replace it with 846 // is now in a state where starting an empty load will be inconsistent. Replace it with
847 // a new ApplicationCacheHost. 847 // a new ApplicationCacheHost.
848 m_applicationCacheHost = adoptPtr(new ApplicationCacheHost(this)); 848 m_applicationCacheHost = adoptPtr(new ApplicationCacheHost(this));
849 maybeLoadEmpty(); 849 maybeLoadEmpty();
850 return; 850 return;
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
943 void DocumentLoader::replaceDocument(const String& source, Document* ownerDocume nt) 943 void DocumentLoader::replaceDocument(const String& source, Document* ownerDocume nt)
944 { 944 {
945 m_frame->loader().stopAllLoaders(); 945 m_frame->loader().stopAllLoaders();
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); 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);
947 if (!source.isNull()) 947 if (!source.isNull())
948 m_writer->appendReplacingData(source); 948 m_writer->appendReplacingData(source);
949 endWriting(m_writer.get()); 949 endWriting(m_writer.get());
950 } 950 }
951 951
952 } // namespace WebCore 952 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698