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 938 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
949 // the new page is ready. | 949 // the new page is ready. |
950 | 950 |
951 // Retry restoring scroll offset since FrameStateComplete disables content | 951 // Retry restoring scroll offset since FrameStateComplete disables content |
952 // size clamping. | 952 // size clamping. |
953 restoreScrollPositionAndViewState(); | 953 restoreScrollPositionAndViewState(); |
954 | 954 |
955 if (!m_stateMachine.committedFirstRealDocumentLoad()) | 955 if (!m_stateMachine.committedFirstRealDocumentLoad()) |
956 return true; | 956 return true; |
957 | 957 |
958 m_progressTracker->progressCompleted(); | 958 m_progressTracker->progressCompleted(); |
| 959 m_frame->domWindow()->finishedLoading(); |
959 | 960 |
960 const ResourceError& error = m_documentLoader->mainDocumentError(); | 961 const ResourceError& error = m_documentLoader->mainDocumentError(); |
961 if (!error.isNull()) | 962 if (!error.isNull()) |
962 m_client->dispatchDidFailLoad(error); | 963 m_client->dispatchDidFailLoad(error); |
963 else | 964 else |
964 m_client->dispatchDidFinishLoad(); | 965 m_client->dispatchDidFinishLoad(); |
965 m_loadType = FrameLoadTypeStandard; | 966 m_loadType = FrameLoadTypeStandard; |
966 return true; | 967 return true; |
967 } | 968 } |
968 | 969 |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1018 } | 1019 } |
1019 | 1020 |
1020 // Called every time a resource is completely loaded or an error is received. | 1021 // Called every time a resource is completely loaded or an error is received. |
1021 void FrameLoader::checkLoadComplete() | 1022 void FrameLoader::checkLoadComplete() |
1022 { | 1023 { |
1023 ASSERT(m_client->hasWebView()); | 1024 ASSERT(m_client->hasWebView()); |
1024 if (Page* page = m_frame->page()) | 1025 if (Page* page = m_frame->page()) |
1025 page->mainFrame()->loader().checkLoadCompleteForThisFrame(); | 1026 page->mainFrame()->loader().checkLoadCompleteForThisFrame(); |
1026 } | 1027 } |
1027 | 1028 |
1028 void FrameLoader::checkLoadComplete(DocumentLoader* documentLoader) | |
1029 { | |
1030 if (documentLoader) | |
1031 documentLoader->checkLoadComplete(); | |
1032 checkLoadComplete(); | |
1033 } | |
1034 | |
1035 String FrameLoader::userAgent(const KURL& url) const | 1029 String FrameLoader::userAgent(const KURL& url) const |
1036 { | 1030 { |
1037 String userAgent = m_client->userAgent(url); | 1031 String userAgent = m_client->userAgent(url); |
1038 InspectorInstrumentation::applyUserAgentOverride(m_frame, &userAgent); | 1032 InspectorInstrumentation::applyUserAgentOverride(m_frame, &userAgent); |
1039 return userAgent; | 1033 return userAgent; |
1040 } | 1034 } |
1041 | 1035 |
1042 void FrameLoader::frameDetached() | 1036 void FrameLoader::frameDetached() |
1043 { | 1037 { |
1044 // stopAllLoaders can detach the LocalFrame, so protect it. | 1038 // stopAllLoaders can detach the LocalFrame, so protect it. |
(...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1397 { | 1391 { |
1398 SandboxFlags flags = m_forcedSandboxFlags; | 1392 SandboxFlags flags = m_forcedSandboxFlags; |
1399 if (LocalFrame* parentFrame = m_frame->tree().parent()) | 1393 if (LocalFrame* parentFrame = m_frame->tree().parent()) |
1400 flags |= parentFrame->document()->sandboxFlags(); | 1394 flags |= parentFrame->document()->sandboxFlags(); |
1401 if (HTMLFrameOwnerElement* ownerElement = m_frame->ownerElement()) | 1395 if (HTMLFrameOwnerElement* ownerElement = m_frame->ownerElement()) |
1402 flags |= ownerElement->sandboxFlags(); | 1396 flags |= ownerElement->sandboxFlags(); |
1403 return flags; | 1397 return flags; |
1404 } | 1398 } |
1405 | 1399 |
1406 } // namespace WebCore | 1400 } // namespace WebCore |
OLD | NEW |