| 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 732 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 743 | 743 |
| 744 // willSendRequest() may lead to our Frame being detached or cancelling the
load via nulling the ResourceRequest. | 744 // willSendRequest() may lead to our Frame being detached or cancelling the
load via nulling the ResourceRequest. |
| 745 if (!m_frame || m_request.isNull()) | 745 if (!m_frame || m_request.isNull()) |
| 746 return; | 746 return; |
| 747 | 747 |
| 748 m_applicationCacheHost->willStartLoadingMainResource(m_request); | 748 m_applicationCacheHost->willStartLoadingMainResource(m_request); |
| 749 prepareSubframeArchiveLoadIfNeeded(); | 749 prepareSubframeArchiveLoadIfNeeded(); |
| 750 | 750 |
| 751 ResourceRequest request(m_request); | 751 ResourceRequest request(m_request); |
| 752 DEFINE_STATIC_LOCAL(ResourceLoaderOptions, mainResourceLoadOptions, | 752 DEFINE_STATIC_LOCAL(ResourceLoaderOptions, mainResourceLoadOptions, |
| 753 (SniffContent, DoNotBufferData, AllowStoredCredentials, ClientRequestedC
redentials, AskClientForCrossOriginCredentials, SkipSecurityCheck, CheckContentS
ecurityPolicy, DocumentContext)); | 753 (SniffContent, DoNotBufferData, AllowStoredCredentials, ClientRequestedC
redentials, CheckContentSecurityPolicy, DocumentContext)); |
| 754 FetchRequest cachedResourceRequest(request, FetchInitiatorTypeNames::documen
t, mainResourceLoadOptions); | 754 FetchRequest cachedResourceRequest(request, FetchInitiatorTypeNames::documen
t, mainResourceLoadOptions); |
| 755 m_mainResource = m_fetcher->fetchMainResource(cachedResourceRequest, m_subst
ituteData); | 755 m_mainResource = m_fetcher->fetchMainResource(cachedResourceRequest, m_subst
ituteData); |
| 756 if (!m_mainResource) { | 756 if (!m_mainResource) { |
| 757 m_request = ResourceRequest(); | 757 m_request = ResourceRequest(); |
| 758 // If the load was aborted by clearing m_request, it's possible the Appl
icationCacheHost | 758 // If the load was aborted by clearing m_request, it's possible the Appl
icationCacheHost |
| 759 // is now in a state where starting an empty load will be inconsistent.
Replace it with | 759 // is now in a state where starting an empty load will be inconsistent.
Replace it with |
| 760 // a new ApplicationCacheHost. | 760 // a new ApplicationCacheHost. |
| 761 m_applicationCacheHost = adoptPtr(new ApplicationCacheHost(this)); | 761 m_applicationCacheHost = adoptPtr(new ApplicationCacheHost(this)); |
| 762 maybeLoadEmpty(); | 762 maybeLoadEmpty(); |
| 763 return; | 763 return; |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 846 void DocumentLoader::replaceDocument(const String& source, Document* ownerDocume
nt) | 846 void DocumentLoader::replaceDocument(const String& source, Document* ownerDocume
nt) |
| 847 { | 847 { |
| 848 m_frame->loader().stopAllLoaders(); | 848 m_frame->loader().stopAllLoaders(); |
| 849 m_writer = createWriterFor(m_frame, ownerDocument, m_frame->document()->url(
), mimeType(), m_writer ? m_writer->encoding() : emptyAtom, m_writer ? m_writer
->encodingWasChosenByUser() : false, true); | 849 m_writer = createWriterFor(m_frame, ownerDocument, m_frame->document()->url(
), mimeType(), m_writer ? m_writer->encoding() : emptyAtom, m_writer ? m_writer
->encodingWasChosenByUser() : false, true); |
| 850 if (!source.isNull()) | 850 if (!source.isNull()) |
| 851 m_writer->appendReplacingData(source); | 851 m_writer->appendReplacingData(source); |
| 852 endWriting(m_writer.get()); | 852 endWriting(m_writer.get()); |
| 853 } | 853 } |
| 854 | 854 |
| 855 } // namespace WebCore | 855 } // namespace WebCore |
| OLD | NEW |