OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |