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

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: Remove RequestOriginPolicy + suggested improvements 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 822 matching lines...) Expand 10 before | Expand all | Expand 10 after
833 833
834 if (m_substituteData.isValid()) { 834 if (m_substituteData.isValid()) {
835 m_identifierForLoadWithoutResourceLoader = createUniqueIdentifier(); 835 m_identifierForLoadWithoutResourceLoader = createUniqueIdentifier();
836 frame()->fetchContext().dispatchWillSendRequest(this, m_identifierForLoa dWithoutResourceLoader, m_request, ResourceResponse()); 836 frame()->fetchContext().dispatchWillSendRequest(this, m_identifierForLoa dWithoutResourceLoader, m_request, ResourceResponse());
837 handleSubstituteDataLoadSoon(); 837 handleSubstituteDataLoadSoon();
838 return; 838 return;
839 } 839 }
840 840
841 ResourceRequest request(m_request); 841 ResourceRequest request(m_request);
842 DEFINE_STATIC_LOCAL(ResourceLoaderOptions, mainResourceLoadOptions, 842 DEFINE_STATIC_LOCAL(ResourceLoaderOptions, mainResourceLoadOptions,
843 (SendCallbacks, SniffContent, DoNotBufferData, AllowStoredCredentials, C lientRequestedCredentials, AskClientForCrossOriginCredentials, SkipSecurityCheck , CheckContentSecurityPolicy, UseDefaultOriginRestrictionsForType, DocumentConte xt)); 843 (SendCallbacks, SniffContent, DoNotBufferData, AllowStoredCredentials, C lientRequestedCredentials, AskClientForCrossOriginCredentials, SkipSecurityCheck , CheckContentSecurityPolicy, DocumentContext));
844 FetchRequest cachedResourceRequest(request, FetchInitiatorTypeNames::documen t, mainResourceLoadOptions); 844 FetchRequest cachedResourceRequest(request, FetchInitiatorTypeNames::documen t, mainResourceLoadOptions);
845 m_mainResource = m_fetcher->fetchMainResource(cachedResourceRequest); 845 m_mainResource = m_fetcher->fetchMainResource(cachedResourceRequest);
846 if (!m_mainResource) { 846 if (!m_mainResource) {
847 setRequest(ResourceRequest()); 847 setRequest(ResourceRequest());
848 // If the load was aborted by clearing m_request, it's possible the Appl icationCacheHost 848 // If the load was aborted by clearing m_request, it's possible the Appl icationCacheHost
849 // is now in a state where starting an empty load will be inconsistent. Replace it with 849 // is now in a state where starting an empty load will be inconsistent. Replace it with
850 // a new ApplicationCacheHost. 850 // a new ApplicationCacheHost.
851 m_applicationCacheHost = adoptPtr(new ApplicationCacheHost(this)); 851 m_applicationCacheHost = adoptPtr(new ApplicationCacheHost(this));
852 maybeLoadEmpty(); 852 maybeLoadEmpty();
853 return; 853 return;
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
935 void DocumentLoader::replaceDocument(const String& source, Document* ownerDocume nt) 935 void DocumentLoader::replaceDocument(const String& source, Document* ownerDocume nt)
936 { 936 {
937 m_frame->loader().stopAllLoaders(); 937 m_frame->loader().stopAllLoaders();
938 m_writer = createWriterFor(m_frame, ownerDocument, m_frame->document()->url( ), mimeType(), m_writer ? m_writer->encoding() : "", m_writer ? m_writer->encod ingWasChosenByUser() : false, true); 938 m_writer = createWriterFor(m_frame, ownerDocument, m_frame->document()->url( ), mimeType(), m_writer ? m_writer->encoding() : "", m_writer ? m_writer->encod ingWasChosenByUser() : false, true);
939 if (!source.isNull()) 939 if (!source.isNull())
940 m_writer->appendReplacingData(source); 940 m_writer->appendReplacingData(source);
941 endWriting(m_writer.get()); 941 endWriting(m_writer.get());
942 } 942 }
943 943
944 } // namespace WebCore 944 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698