| 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 362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 373 void FrameLoader::didBeginDocument(bool dispatch) | 373 void FrameLoader::didBeginDocument(bool dispatch) |
| 374 { | 374 { |
| 375 m_frame->document()->setReadyState(Document::Loading); | 375 m_frame->document()->setReadyState(Document::Loading); |
| 376 | 376 |
| 377 if (m_provisionalItem && m_loadType == FrameLoadTypeBackForward) | 377 if (m_provisionalItem && m_loadType == FrameLoadTypeBackForward) |
| 378 m_frame->domWindow()->statePopped(m_provisionalItem->stateObject()); | 378 m_frame->domWindow()->statePopped(m_provisionalItem->stateObject()); |
| 379 | 379 |
| 380 if (dispatch) | 380 if (dispatch) |
| 381 dispatchDidClearDocumentOfWindowObject(); | 381 dispatchDidClearDocumentOfWindowObject(); |
| 382 | 382 |
| 383 m_frame->document()->initContentSecurityPolicy(m_documentLoader ? ContentSec
urityPolicyResponseHeaders(m_documentLoader->response()) : ContentSecurityPolicy
ResponseHeaders()); | 383 // FIXME: Move this to DocumentLoader::responseReceived, next to the X-Frame
-Options checks. |
| 384 RefPtr<ContentSecurityPolicy> csp = ContentSecurityPolicy::create(); |
| 385 if (m_documentLoader) |
| 386 csp->didReceiveHeaders(ContentSecurityPolicyResponseHeaders(m_documentLo
ader->response())); |
| 387 m_frame->document()->initContentSecurityPolicy(csp); |
| 384 | 388 |
| 385 if (!m_frame->document()->contentSecurityPolicy()->allowAncestors(m_frame))
{ | 389 if (!m_frame->document()->contentSecurityPolicy()->allowAncestors(m_frame))
{ |
| 386 didFailContentSecurityPolicyCheck(this); | 390 didFailContentSecurityPolicyCheck(this); |
| 387 return; | 391 return; |
| 388 } | 392 } |
| 389 | 393 |
| 390 Settings* settings = m_frame->document()->settings(); | 394 Settings* settings = m_frame->document()->settings(); |
| 391 if (settings) { | 395 if (settings) { |
| 392 m_frame->document()->fetcher()->setImagesEnabled(settings->imagesEnabled
()); | 396 m_frame->document()->fetcher()->setImagesEnabled(settings->imagesEnabled
()); |
| 393 m_frame->document()->fetcher()->setAutoLoadImages(settings->loadsImagesA
utomatically()); | 397 m_frame->document()->fetcher()->setAutoLoadImages(settings->loadsImagesA
utomatically()); |
| (...skipping 1093 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1487 // FIXME: We need a way to propagate sandbox flags to out-of-process frames. | 1491 // FIXME: We need a way to propagate sandbox flags to out-of-process frames. |
| 1488 Frame* parentFrame = m_frame->tree().parent(); | 1492 Frame* parentFrame = m_frame->tree().parent(); |
| 1489 if (parentFrame && parentFrame->isLocalFrame()) | 1493 if (parentFrame && parentFrame->isLocalFrame()) |
| 1490 flags |= toLocalFrame(parentFrame)->document()->sandboxFlags(); | 1494 flags |= toLocalFrame(parentFrame)->document()->sandboxFlags(); |
| 1491 if (FrameOwner* frameOwner = m_frame->owner()) | 1495 if (FrameOwner* frameOwner = m_frame->owner()) |
| 1492 flags |= frameOwner->sandboxFlags(); | 1496 flags |= frameOwner->sandboxFlags(); |
| 1493 return flags; | 1497 return flags; |
| 1494 } | 1498 } |
| 1495 | 1499 |
| 1496 } // namespace blink | 1500 } // namespace blink |
| OLD | NEW |