| 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 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 172 FrameLoader::~FrameLoader() | 172 FrameLoader::~FrameLoader() |
| 173 { | 173 { |
| 174 // Verify that this FrameLoader has been detached. | 174 // Verify that this FrameLoader has been detached. |
| 175 ASSERT(!m_progressTracker); | 175 ASSERT(!m_progressTracker); |
| 176 } | 176 } |
| 177 | 177 |
| 178 DEFINE_TRACE(FrameLoader) | 178 DEFINE_TRACE(FrameLoader) |
| 179 { | 179 { |
| 180 visitor->trace(m_frame); | 180 visitor->trace(m_frame); |
| 181 visitor->trace(m_progressTracker); | 181 visitor->trace(m_progressTracker); |
| 182 visitor->trace(m_documentLoader); |
| 183 visitor->trace(m_provisionalDocumentLoader); |
| 184 visitor->trace(m_policyDocumentLoader); |
| 182 visitor->trace(m_currentItem); | 185 visitor->trace(m_currentItem); |
| 183 visitor->trace(m_provisionalItem); | 186 visitor->trace(m_provisionalItem); |
| 184 visitor->trace(m_deferredHistoryLoad); | 187 visitor->trace(m_deferredHistoryLoad); |
| 185 } | 188 } |
| 186 | 189 |
| 187 void FrameLoader::init() | 190 void FrameLoader::init() |
| 188 { | 191 { |
| 189 ResourceRequest initialRequest(KURL(ParsedURLString, emptyString())); | 192 ResourceRequest initialRequest(KURL(ParsedURLString, emptyString())); |
| 190 initialRequest.setRequestContext(WebURLRequest::RequestContextInternal); | 193 initialRequest.setRequestContext(WebURLRequest::RequestContextInternal); |
| 191 initialRequest.setFrameType(m_frame->isMainFrame() ? WebURLRequest::FrameTyp
eTopLevel : WebURLRequest::FrameTypeNested); | 194 initialRequest.setFrameType(m_frame->isMainFrame() ? WebURLRequest::FrameTyp
eTopLevel : WebURLRequest::FrameTypeNested); |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 308 // This is only called by ScriptController::executeScriptIfJavaScriptURL | 311 // This is only called by ScriptController::executeScriptIfJavaScriptURL |
| 309 // and always contains the result of evaluating a javascript: url. | 312 // and always contains the result of evaluating a javascript: url. |
| 310 // This is the <iframe src="javascript:'html'"> case. | 313 // This is the <iframe src="javascript:'html'"> case. |
| 311 void FrameLoader::replaceDocumentWhileExecutingJavaScriptURL(const String& sourc
e, Document* ownerDocument) | 314 void FrameLoader::replaceDocumentWhileExecutingJavaScriptURL(const String& sourc
e, Document* ownerDocument) |
| 312 { | 315 { |
| 313 if (!m_frame->document()->loader()) | 316 if (!m_frame->document()->loader()) |
| 314 return; | 317 return; |
| 315 | 318 |
| 316 // DocumentLoader::replaceDocumentWhileExecutingJavaScriptURL can cause the
DocumentLoader to get deref'ed and possible destroyed, | 319 // DocumentLoader::replaceDocumentWhileExecutingJavaScriptURL can cause the
DocumentLoader to get deref'ed and possible destroyed, |
| 317 // so protect it with a RefPtr. | 320 // so protect it with a RefPtr. |
| 318 RefPtr<DocumentLoader> documentLoader(m_frame->document()->loader()); | 321 RefPtrWillBeRawPtr<DocumentLoader> documentLoader(m_frame->document()->loade
r()); |
| 319 | 322 |
| 320 UseCounter::count(*m_frame->document(), UseCounter::ReplaceDocumentViaJavaSc
riptURL); | 323 UseCounter::count(*m_frame->document(), UseCounter::ReplaceDocumentViaJavaSc
riptURL); |
| 321 | 324 |
| 322 // Prepare a DocumentInit before clearing the frame, because it may need to | 325 // Prepare a DocumentInit before clearing the frame, because it may need to |
| 323 // inherit an aliased security context. | 326 // inherit an aliased security context. |
| 324 DocumentInit init(m_frame->document()->url(), m_frame); | 327 DocumentInit init(m_frame->document()->url(), m_frame); |
| 325 init.withNewRegistrationContext(); | 328 init.withNewRegistrationContext(); |
| 326 | 329 |
| 327 stopAllLoaders(); | 330 stopAllLoaders(); |
| 328 m_frame->detachChildren(); | 331 m_frame->detachChildren(); |
| (...skipping 673 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1002 { | 1005 { |
| 1003 if (m_didAccessInitialDocumentTimer.isActive()) { | 1006 if (m_didAccessInitialDocumentTimer.isActive()) { |
| 1004 m_didAccessInitialDocumentTimer.stop(); | 1007 m_didAccessInitialDocumentTimer.stop(); |
| 1005 didAccessInitialDocumentTimerFired(0); | 1008 didAccessInitialDocumentTimerFired(0); |
| 1006 } | 1009 } |
| 1007 } | 1010 } |
| 1008 | 1011 |
| 1009 bool FrameLoader::prepareForCommit() | 1012 bool FrameLoader::prepareForCommit() |
| 1010 { | 1013 { |
| 1011 PluginScriptForbiddenScope forbidPluginDestructorScripting; | 1014 PluginScriptForbiddenScope forbidPluginDestructorScripting; |
| 1012 RefPtr<DocumentLoader> pdl = m_provisionalDocumentLoader; | 1015 RefPtrWillBeRawPtr<DocumentLoader> pdl = m_provisionalDocumentLoader; |
| 1013 | 1016 |
| 1014 if (m_documentLoader) { | 1017 if (m_documentLoader) { |
| 1015 client()->dispatchWillClose(); | 1018 client()->dispatchWillClose(); |
| 1016 dispatchUnloadEvent(); | 1019 dispatchUnloadEvent(); |
| 1017 } | 1020 } |
| 1018 m_frame->detachChildren(); | 1021 m_frame->detachChildren(); |
| 1019 // The previous calls to dispatchUnloadEvent() and detachChildren() can | 1022 // The previous calls to dispatchUnloadEvent() and detachChildren() can |
| 1020 // execute arbitrary script via things like unload events. If the executed | 1023 // execute arbitrary script via things like unload events. If the executed |
| 1021 // script intiates a new load or causes the current frame to be detached, | 1024 // script intiates a new load or causes the current frame to be detached, |
| 1022 // we need to abandon the current load. | 1025 // we need to abandon the current load. |
| (...skipping 459 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1482 // FIXME: We need a way to propagate insecure requests policy flags to | 1485 // FIXME: We need a way to propagate insecure requests policy flags to |
| 1483 // out-of-process frames. For now, we'll always use default behavior. | 1486 // out-of-process frames. For now, we'll always use default behavior. |
| 1484 if (!parentFrame->isLocalFrame()) | 1487 if (!parentFrame->isLocalFrame()) |
| 1485 return nullptr; | 1488 return nullptr; |
| 1486 | 1489 |
| 1487 ASSERT(toLocalFrame(parentFrame)->document()); | 1490 ASSERT(toLocalFrame(parentFrame)->document()); |
| 1488 return toLocalFrame(parentFrame)->document()->insecureNavigationsToUpgrade()
; | 1491 return toLocalFrame(parentFrame)->document()->insecureNavigationsToUpgrade()
; |
| 1489 } | 1492 } |
| 1490 | 1493 |
| 1491 } // namespace blink | 1494 } // namespace blink |
| OLD | NEW |