| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserv
ed. | 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserv
ed. |
| 3 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) | 3 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) |
| 4 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t
orchmobile.com/) | 4 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t
orchmobile.com/) |
| 5 * Copyright (C) 2008 Alp Toker <alp@atoker.com> | 5 * Copyright (C) 2008 Alp Toker <alp@atoker.com> |
| 6 * Copyright (C) Research In Motion Limited 2009. All rights reserved. | 6 * Copyright (C) Research In Motion Limited 2009. All rights reserved. |
| 7 * Copyright (C) 2011 Kris Jordan <krisjordan@gmail.com> | 7 * Copyright (C) 2011 Kris Jordan <krisjordan@gmail.com> |
| 8 * Copyright (C) 2011 Google Inc. All rights reserved. | 8 * Copyright (C) 2011 Google Inc. All rights reserved. |
| 9 * | 9 * |
| 10 * Redistribution and use in source and binary forms, with or without | 10 * Redistribution and use in source and binary forms, with or without |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 #include "core/html/parser/HTMLParserIdioms.h" | 66 #include "core/html/parser/HTMLParserIdioms.h" |
| 67 #include "core/inspector/InspectorController.h" | 67 #include "core/inspector/InspectorController.h" |
| 68 #include "core/inspector/InspectorInstrumentation.h" | 68 #include "core/inspector/InspectorInstrumentation.h" |
| 69 #include "core/inspector/ScriptCallStack.h" | 69 #include "core/inspector/ScriptCallStack.h" |
| 70 #include "core/loader/DocumentLoadTiming.h" | 70 #include "core/loader/DocumentLoadTiming.h" |
| 71 #include "core/loader/DocumentLoader.h" | 71 #include "core/loader/DocumentLoader.h" |
| 72 #include "core/loader/FormState.h" | 72 #include "core/loader/FormState.h" |
| 73 #include "core/loader/FormSubmission.h" | 73 #include "core/loader/FormSubmission.h" |
| 74 #include "core/loader/FrameLoadRequest.h" | 74 #include "core/loader/FrameLoadRequest.h" |
| 75 #include "core/loader/FrameLoaderClient.h" | 75 #include "core/loader/FrameLoaderClient.h" |
| 76 #include "core/loader/FrameNetworkingContext.h" | |
| 77 #include "core/loader/ProgressTracker.h" | 76 #include "core/loader/ProgressTracker.h" |
| 78 #include "core/loader/TextResourceDecoder.h" | 77 #include "core/loader/TextResourceDecoder.h" |
| 79 #include "core/loader/UniqueIdentifier.h" | 78 #include "core/loader/UniqueIdentifier.h" |
| 80 #include "core/loader/appcache/ApplicationCacheHost.h" | 79 #include "core/loader/appcache/ApplicationCacheHost.h" |
| 81 #include "core/loader/cache/CachedResourceLoader.h" | 80 #include "core/loader/cache/CachedResourceLoader.h" |
| 82 #include "core/loader/cache/MemoryCache.h" | 81 #include "core/loader/cache/MemoryCache.h" |
| 83 #include "core/page/Chrome.h" | 82 #include "core/page/Chrome.h" |
| 84 #include "core/page/ChromeClient.h" | 83 #include "core/page/ChromeClient.h" |
| 85 #include "core/page/Console.h" | 84 #include "core/page/Console.h" |
| 86 #include "core/page/ContentSecurityPolicy.h" | 85 #include "core/page/ContentSecurityPolicy.h" |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 206 | 205 |
| 207 FrameLoader::~FrameLoader() | 206 FrameLoader::~FrameLoader() |
| 208 { | 207 { |
| 209 setOpener(0); | 208 setOpener(0); |
| 210 | 209 |
| 211 HashSet<Frame*>::iterator end = m_openedFrames.end(); | 210 HashSet<Frame*>::iterator end = m_openedFrames.end(); |
| 212 for (HashSet<Frame*>::iterator it = m_openedFrames.begin(); it != end; ++it) | 211 for (HashSet<Frame*>::iterator it = m_openedFrames.begin(); it != end; ++it) |
| 213 (*it)->loader()->m_opener = 0; | 212 (*it)->loader()->m_opener = 0; |
| 214 | 213 |
| 215 m_client->frameLoaderDestroyed(); | 214 m_client->frameLoaderDestroyed(); |
| 216 | |
| 217 if (m_networkingContext) | |
| 218 m_networkingContext->invalidate(); | |
| 219 } | 215 } |
| 220 | 216 |
| 221 void FrameLoader::init() | 217 void FrameLoader::init() |
| 222 { | 218 { |
| 223 // This somewhat odd set of steps gives the frame an initial empty document. | 219 // This somewhat odd set of steps gives the frame an initial empty document. |
| 224 setPolicyDocumentLoader(m_client->createDocumentLoader(ResourceRequest(KURL(
ParsedURLString, emptyString())), SubstituteData()).get()); | 220 setPolicyDocumentLoader(m_client->createDocumentLoader(ResourceRequest(KURL(
ParsedURLString, emptyString())), SubstituteData()).get()); |
| 225 setProvisionalDocumentLoader(m_policyDocumentLoader.get()); | 221 setProvisionalDocumentLoader(m_policyDocumentLoader.get()); |
| 226 m_provisionalDocumentLoader->startLoadingMainResource(); | 222 m_provisionalDocumentLoader->startLoadingMainResource(); |
| 227 m_frame->document()->cancelParsing(); | 223 m_frame->document()->cancelParsing(); |
| 228 m_stateMachine.advanceTo(FrameLoaderStateMachine::DisplayingInitialEmptyDocu
ment); | 224 m_stateMachine.advanceTo(FrameLoaderStateMachine::DisplayingInitialEmptyDocu
ment); |
| 229 | |
| 230 m_networkingContext = m_client->createNetworkingContext(); | |
| 231 m_progressTracker = FrameProgressTracker::create(m_frame); | 225 m_progressTracker = FrameProgressTracker::create(m_frame); |
| 232 } | 226 } |
| 233 | 227 |
| 234 void FrameLoader::setDefersLoading(bool defers) | 228 void FrameLoader::setDefersLoading(bool defers) |
| 235 { | 229 { |
| 236 if (m_documentLoader) | 230 if (m_documentLoader) |
| 237 m_documentLoader->setDefersLoading(defers); | 231 m_documentLoader->setDefersLoading(defers); |
| 238 if (m_provisionalDocumentLoader) | 232 if (m_provisionalDocumentLoader) |
| 239 m_provisionalDocumentLoader->setDefersLoading(defers); | 233 m_provisionalDocumentLoader->setDefersLoading(defers); |
| 240 if (m_policyDocumentLoader) | 234 if (m_policyDocumentLoader) |
| (...skipping 1653 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1894 | 1888 |
| 1895 addExtraFieldsToRequest(initialRequest); | 1889 addExtraFieldsToRequest(initialRequest); |
| 1896 | 1890 |
| 1897 unsigned long identifier = 0; | 1891 unsigned long identifier = 0; |
| 1898 ResourceRequest newRequest(initialRequest); | 1892 ResourceRequest newRequest(initialRequest); |
| 1899 requestFromDelegate(newRequest, identifier, error); | 1893 requestFromDelegate(newRequest, identifier, error); |
| 1900 | 1894 |
| 1901 if (error.isNull()) { | 1895 if (error.isNull()) { |
| 1902 ASSERT(!newRequest.isNull()); | 1896 ASSERT(!newRequest.isNull()); |
| 1903 documentLoader()->applicationCacheHost()->willStartLoadingSynchronously(
newRequest); | 1897 documentLoader()->applicationCacheHost()->willStartLoadingSynchronously(
newRequest); |
| 1904 ResourceHandle::loadResourceSynchronously(networkingContext(), newReques
t, storedCredentials, error, response, data); | 1898 ResourceHandle::loadResourceSynchronously(newRequest, storedCredentials,
error, response, data); |
| 1905 } | 1899 } |
| 1906 int encodedDataLength = response.resourceLoadInfo() ? static_cast<int>(respo
nse.resourceLoadInfo()->encodedDataLength) : -1; | 1900 int encodedDataLength = response.resourceLoadInfo() ? static_cast<int>(respo
nse.resourceLoadInfo()->encodedDataLength) : -1; |
| 1907 notifier()->sendRemainingDelegateMessages(m_documentLoader.get(), identifier
, response, data.data(), data.size(), encodedDataLength, error); | 1901 notifier()->sendRemainingDelegateMessages(m_documentLoader.get(), identifier
, response, data.data(), data.size(), encodedDataLength, error); |
| 1908 return identifier; | 1902 return identifier; |
| 1909 } | 1903 } |
| 1910 | 1904 |
| 1911 const ResourceRequest& FrameLoader::originalRequest() const | 1905 const ResourceRequest& FrameLoader::originalRequest() const |
| 1912 { | 1906 { |
| 1913 return activeDocumentLoader()->originalRequestCopy(); | 1907 return activeDocumentLoader()->originalRequestCopy(); |
| 1914 } | 1908 } |
| (...skipping 571 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2486 // Consider if there's some efficient way of remembering enough to deliv
er this client call. | 2480 // Consider if there's some efficient way of remembering enough to deliv
er this client call. |
| 2487 // We have the URL, but not the rest of the response or the length. | 2481 // We have the URL, but not the rest of the response or the length. |
| 2488 if (!resource) | 2482 if (!resource) |
| 2489 continue; | 2483 continue; |
| 2490 | 2484 |
| 2491 ResourceRequest request(resource->url()); | 2485 ResourceRequest request(resource->url()); |
| 2492 m_client->dispatchDidLoadResourceFromMemoryCache(m_documentLoader.get(),
request, resource->response(), resource->encodedSize()); | 2486 m_client->dispatchDidLoadResourceFromMemoryCache(m_documentLoader.get(),
request, resource->response(), resource->encodedSize()); |
| 2493 } | 2487 } |
| 2494 } | 2488 } |
| 2495 | 2489 |
| 2496 NetworkingContext* FrameLoader::networkingContext() const | |
| 2497 { | |
| 2498 return m_networkingContext.get(); | |
| 2499 } | |
| 2500 | |
| 2501 void FrameLoader::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const | 2490 void FrameLoader::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const |
| 2502 { | 2491 { |
| 2503 MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::Loader); | 2492 MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::Loader); |
| 2504 info.addMember(m_frame, "frame"); | 2493 info.addMember(m_frame, "frame"); |
| 2505 info.ignoreMember(m_client); | 2494 info.ignoreMember(m_client); |
| 2506 info.addMember(m_progressTracker, "progressTracker"); | 2495 info.addMember(m_progressTracker, "progressTracker"); |
| 2507 info.addMember(m_documentLoader, "documentLoader"); | 2496 info.addMember(m_documentLoader, "documentLoader"); |
| 2508 info.addMember(m_provisionalDocumentLoader, "provisionalDocumentLoader"); | 2497 info.addMember(m_provisionalDocumentLoader, "provisionalDocumentLoader"); |
| 2509 info.addMember(m_policyDocumentLoader, "policyDocumentLoader"); | 2498 info.addMember(m_policyDocumentLoader, "policyDocumentLoader"); |
| 2510 info.addMember(m_submittedFormURL, "submittedFormURL"); | 2499 info.addMember(m_submittedFormURL, "submittedFormURL"); |
| 2511 info.addMember(m_checkTimer, "checkTimer"); | 2500 info.addMember(m_checkTimer, "checkTimer"); |
| 2512 info.addMember(m_opener, "opener"); | 2501 info.addMember(m_opener, "opener"); |
| 2513 info.addMember(m_openedFrames, "openedFrames"); | 2502 info.addMember(m_openedFrames, "openedFrames"); |
| 2514 info.addMember(m_outgoingReferrer, "outgoingReferrer"); | 2503 info.addMember(m_outgoingReferrer, "outgoingReferrer"); |
| 2515 info.addMember(m_networkingContext, "networkingContext"); | |
| 2516 info.addMember(m_requestedHistoryItem, "requestedHistoryItem"); | 2504 info.addMember(m_requestedHistoryItem, "requestedHistoryItem"); |
| 2517 } | 2505 } |
| 2518 | 2506 |
| 2519 Frame* createWindow(Frame* openerFrame, Frame* lookupFrame, const FrameLoadReque
st& request, const WindowFeatures& features, bool& created) | 2507 Frame* createWindow(Frame* openerFrame, Frame* lookupFrame, const FrameLoadReque
st& request, const WindowFeatures& features, bool& created) |
| 2520 { | 2508 { |
| 2521 ASSERT(!features.dialog || request.frameName().isEmpty()); | 2509 ASSERT(!features.dialog || request.frameName().isEmpty()); |
| 2522 | 2510 |
| 2523 if (!request.frameName().isEmpty() && request.frameName() != "_blank") { | 2511 if (!request.frameName().isEmpty() && request.frameName() != "_blank") { |
| 2524 if (Frame* frame = lookupFrame->loader()->findFrameForNavigation(request
.frameName(), openerFrame->document())) { | 2512 if (Frame* frame = lookupFrame->loader()->findFrameForNavigation(request
.frameName(), openerFrame->document())) { |
| 2525 if (request.frameName() != "_self") { | 2513 if (request.frameName() != "_self") { |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2592 FloatRect newWindowRect = DOMWindow::adjustWindowRect(page, windowRect); | 2580 FloatRect newWindowRect = DOMWindow::adjustWindowRect(page, windowRect); |
| 2593 | 2581 |
| 2594 page->chrome().setWindowRect(newWindowRect); | 2582 page->chrome().setWindowRect(newWindowRect); |
| 2595 page->chrome().show(); | 2583 page->chrome().show(); |
| 2596 | 2584 |
| 2597 created = true; | 2585 created = true; |
| 2598 return frame; | 2586 return frame; |
| 2599 } | 2587 } |
| 2600 | 2588 |
| 2601 } // namespace WebCore | 2589 } // namespace WebCore |
| OLD | NEW |