| 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 824 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |