| 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 17 matching lines...) Expand all Loading... |
| 28 */ | 28 */ |
| 29 | 29 |
| 30 #include "config.h" | 30 #include "config.h" |
| 31 #include "DocumentLoader.h" | 31 #include "DocumentLoader.h" |
| 32 | 32 |
| 33 #include "ApplicationCacheHost.h" | 33 #include "ApplicationCacheHost.h" |
| 34 #include "ArchiveResourceCollection.h" | 34 #include "ArchiveResourceCollection.h" |
| 35 #include "CachedPage.h" | 35 #include "CachedPage.h" |
| 36 #include "CachedResourceLoader.h" | 36 #include "CachedResourceLoader.h" |
| 37 #include "DOMWindow.h" | 37 #include "DOMWindow.h" |
| 38 #include "DataUriResource.h" |
| 38 #include "Document.h" | 39 #include "Document.h" |
| 39 #include "DocumentParser.h" | 40 #include "DocumentParser.h" |
| 40 #include "DocumentWriter.h" | 41 #include "DocumentWriter.h" |
| 41 #include "Event.h" | 42 #include "Event.h" |
| 42 #include "FormState.h" | 43 #include "FormState.h" |
| 43 #include "Frame.h" | 44 #include "Frame.h" |
| 44 #include "FrameLoader.h" | 45 #include "FrameLoader.h" |
| 45 #include "FrameLoaderClient.h" | 46 #include "FrameLoaderClient.h" |
| 46 #include "FrameTree.h" | 47 #include "FrameTree.h" |
| 47 #include "HTMLFormElement.h" | 48 #include "HTMLFormElement.h" |
| 48 #include "HTMLFrameOwnerElement.h" | 49 #include "HTMLFrameOwnerElement.h" |
| 49 #include "HistoryItem.h" | 50 #include "HistoryItem.h" |
| 50 #include "InspectorInstrumentation.h" | 51 #include "InspectorInstrumentation.h" |
| 51 #include "Logging.h" | 52 #include "Logging.h" |
| 52 #include "MHTMLArchive.h" | 53 #include "MHTMLArchive.h" |
| 53 #include "MemoryCache.h" | 54 #include "MemoryCache.h" |
| 54 #include "Page.h" | 55 #include "Page.h" |
| 55 #include "ProgressTracker.h" | 56 #include "ProgressTracker.h" |
| 56 #include "ResourceBuffer.h" | 57 #include "ResourceBuffer.h" |
| 57 #include "SchemeRegistry.h" | 58 #include "SchemeRegistry.h" |
| 58 #include "SecurityPolicy.h" | 59 #include "SecurityPolicy.h" |
| 59 #include "Settings.h" | 60 #include "Settings.h" |
| 60 #include "SubresourceLoader.h" | 61 #include "SubresourceLoader.h" |
| 61 #include "TextResourceDecoder.h" | 62 #include "TextResourceDecoder.h" |
| 62 #include "WebCoreMemoryInstrumentation.h" | 63 #include "WebCoreMemoryInstrumentation.h" |
| 64 #include <public/Platform.h> |
| 63 #include <wtf/Assertions.h> | 65 #include <wtf/Assertions.h> |
| 64 #include <wtf/MemoryInstrumentationHashMap.h> | 66 #include <wtf/MemoryInstrumentationHashMap.h> |
| 65 #include <wtf/MemoryInstrumentationHashSet.h> | 67 #include <wtf/MemoryInstrumentationHashSet.h> |
| 66 #include <wtf/MemoryInstrumentationVector.h> | 68 #include <wtf/MemoryInstrumentationVector.h> |
| 67 #include <wtf/text/CString.h> | 69 #include <wtf/text/CString.h> |
| 68 #include <wtf/text/WTFString.h> | 70 #include <wtf/text/WTFString.h> |
| 69 #include <wtf/unicode/Unicode.h> | 71 #include <wtf/unicode/Unicode.h> |
| 70 | 72 |
| 71 namespace WebCore { | 73 namespace WebCore { |
| 72 | 74 |
| (...skipping 899 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 972 bool DocumentLoader::scheduleArchiveLoad(ResourceLoader* loader, const ResourceR
equest& request) | 974 bool DocumentLoader::scheduleArchiveLoad(ResourceLoader* loader, const ResourceR
equest& request) |
| 973 { | 975 { |
| 974 if (ArchiveResource* resource = archiveResourceForURL(request.url())) { | 976 if (ArchiveResource* resource = archiveResourceForURL(request.url())) { |
| 975 m_pendingSubstituteResources.set(loader, resource); | 977 m_pendingSubstituteResources.set(loader, resource); |
| 976 deliverSubstituteResourcesAfterDelay(); | 978 deliverSubstituteResourcesAfterDelay(); |
| 977 return true; | 979 return true; |
| 978 } | 980 } |
| 979 return m_archive; | 981 return m_archive; |
| 980 } | 982 } |
| 981 | 983 |
| 984 bool DocumentLoader::scheduleDataUriLoad(ResourceLoader* loader, const ResourceR
equest& request) |
| 985 { |
| 986 if (request.url().protocolIsData()) { |
| 987 String mimetype, charset; |
| 988 Vector<char> data; |
| 989 if (ResourceHandle::parseDataUrl(request.url(), mimetype, charset, data)
&& !data.isEmpty()) { |
| 990 RefPtr<DataUriResource> resource = DataUriResource::create(SharedBuf
fer::adoptVector(data), request.url(), mimetype, charset, ResourceResponse(reque
st.url(), mimetype, data.size(), charset, String())); |
| 991 m_pendingSubstituteResources.set(loader, resource); |
| 992 deliverSubstituteResourcesAfterDelay(); |
| 993 return true; |
| 994 } |
| 995 } |
| 996 return false; |
| 997 } |
| 998 |
| 982 void DocumentLoader::setTitle(const StringWithDirection& title) | 999 void DocumentLoader::setTitle(const StringWithDirection& title) |
| 983 { | 1000 { |
| 984 if (m_pageTitle == title) | 1001 if (m_pageTitle == title) |
| 985 return; | 1002 return; |
| 986 | 1003 |
| 987 m_pageTitle = title; | 1004 m_pageTitle = title; |
| 988 frameLoader()->didChangeTitle(this); | 1005 frameLoader()->didChangeTitle(this); |
| 989 } | 1006 } |
| 990 | 1007 |
| 991 KURL DocumentLoader::urlForHistory() const | 1008 KURL DocumentLoader::urlForHistory() const |
| (...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1202 commitLoad(resourceData->data(), resourceData->size()); | 1219 commitLoad(resourceData->data(), resourceData->size()); |
| 1203 } | 1220 } |
| 1204 | 1221 |
| 1205 void DocumentLoader::handledOnloadEvents() | 1222 void DocumentLoader::handledOnloadEvents() |
| 1206 { | 1223 { |
| 1207 m_wasOnloadHandled = true; | 1224 m_wasOnloadHandled = true; |
| 1208 applicationCacheHost()->stopDeferringEvents(); | 1225 applicationCacheHost()->stopDeferringEvents(); |
| 1209 } | 1226 } |
| 1210 | 1227 |
| 1211 } // namespace WebCore | 1228 } // namespace WebCore |
| OLD | NEW |