| 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 29 matching lines...) Expand all Loading... |
| 40 #include "core/html/HTMLFrameOwnerElement.h" | 40 #include "core/html/HTMLFrameOwnerElement.h" |
| 41 #include "core/html/parser/TextResourceDecoder.h" | 41 #include "core/html/parser/TextResourceDecoder.h" |
| 42 #include "core/inspector/InspectorInstrumentation.h" | 42 #include "core/inspector/InspectorInstrumentation.h" |
| 43 #include "core/loader/FrameLoader.h" | 43 #include "core/loader/FrameLoader.h" |
| 44 #include "core/loader/FrameLoaderClient.h" | 44 #include "core/loader/FrameLoaderClient.h" |
| 45 #include "core/loader/UniqueIdentifier.h" | 45 #include "core/loader/UniqueIdentifier.h" |
| 46 #include "core/loader/appcache/ApplicationCacheHost.h" | 46 #include "core/loader/appcache/ApplicationCacheHost.h" |
| 47 #include "core/frame/LocalDOMWindow.h" | 47 #include "core/frame/LocalDOMWindow.h" |
| 48 #include "core/frame/LocalFrame.h" | 48 #include "core/frame/LocalFrame.h" |
| 49 #include "core/frame/csp/ContentSecurityPolicy.h" | 49 #include "core/frame/csp/ContentSecurityPolicy.h" |
| 50 #include "core/inspector/ConsoleMessage.h" |
| 50 #include "core/page/FrameTree.h" | 51 #include "core/page/FrameTree.h" |
| 51 #include "core/page/Page.h" | 52 #include "core/page/Page.h" |
| 52 #include "core/frame/Settings.h" | 53 #include "core/frame/Settings.h" |
| 53 #include "platform/Logging.h" | 54 #include "platform/Logging.h" |
| 54 #include "platform/UserGestureIndicator.h" | 55 #include "platform/UserGestureIndicator.h" |
| 55 #include "platform/mhtml/ArchiveResource.h" | 56 #include "platform/mhtml/ArchiveResource.h" |
| 56 #include "platform/mhtml/ArchiveResourceCollection.h" | 57 #include "platform/mhtml/ArchiveResourceCollection.h" |
| 57 #include "platform/mhtml/MHTMLArchive.h" | 58 #include "platform/mhtml/MHTMLArchive.h" |
| 58 #include "platform/plugins/PluginData.h" | 59 #include "platform/plugins/PluginData.h" |
| 59 #include "platform/weborigin/SchemeRegistry.h" | 60 #include "platform/weborigin/SchemeRegistry.h" |
| (...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 448 DEFINE_STATIC_LOCAL(AtomicString, xFrameOptionHeader, ("x-frame-options", At
omicString::ConstructFromLiteral)); | 449 DEFINE_STATIC_LOCAL(AtomicString, xFrameOptionHeader, ("x-frame-options", At
omicString::ConstructFromLiteral)); |
| 449 HTTPHeaderMap::const_iterator it = response.httpHeaderFields().find(xFrameOp
tionHeader); | 450 HTTPHeaderMap::const_iterator it = response.httpHeaderFields().find(xFrameOp
tionHeader); |
| 450 if (it != response.httpHeaderFields().end()) { | 451 if (it != response.httpHeaderFields().end()) { |
| 451 String content = it->value; | 452 String content = it->value; |
| 452 ASSERT(m_mainResource); | 453 ASSERT(m_mainResource); |
| 453 unsigned long identifier = mainResourceIdentifier(); | 454 unsigned long identifier = mainResourceIdentifier(); |
| 454 ASSERT(identifier); | 455 ASSERT(identifier); |
| 455 if (frameLoader()->shouldInterruptLoadForXFrameOptions(content, response
.url(), identifier)) { | 456 if (frameLoader()->shouldInterruptLoadForXFrameOptions(content, response
.url(), identifier)) { |
| 456 InspectorInstrumentation::continueAfterXFrameOptionsDenied(m_frame,
this, identifier, response); | 457 InspectorInstrumentation::continueAfterXFrameOptionsDenied(m_frame,
this, identifier, response); |
| 457 String message = "Refused to display '" + response.url().elidedStrin
g() + "' in a frame because it set 'X-Frame-Options' to '" + content + "'."; | 458 String message = "Refused to display '" + response.url().elidedStrin
g() + "' in a frame because it set 'X-Frame-Options' to '" + content + "'."; |
| 458 frame()->document()->addConsoleMessageWithRequestIdentifier(Security
MessageSource, ErrorMessageLevel, message, identifier); | 459 frame()->document()->addConsoleMessageWithRequestIdentifier(ConsoleM
essage::create(SecurityMessageSource, ErrorMessageLevel, message, identifier)); |
| 459 frame()->document()->enforceSandboxFlags(SandboxOrigin); | 460 frame()->document()->enforceSandboxFlags(SandboxOrigin); |
| 460 if (FrameOwner* owner = frame()->owner()) | 461 if (FrameOwner* owner = frame()->owner()) |
| 461 owner->dispatchLoad(); | 462 owner->dispatchLoad(); |
| 462 | 463 |
| 463 // The load event might have detached this frame. In that case, the
load will already have been cancelled during detach. | 464 // The load event might have detached this frame. In that case, the
load will already have been cancelled during detach. |
| 464 if (frameLoader()) | 465 if (frameLoader()) |
| 465 cancelMainResourceLoad(ResourceError::cancelledError(m_request.u
rl())); | 466 cancelMainResourceLoad(ResourceError::cancelledError(m_request.u
rl())); |
| 466 return; | 467 return; |
| 467 } | 468 } |
| 468 } | 469 } |
| (...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 829 void DocumentLoader::replaceDocument(const String& source, Document* ownerDocume
nt) | 830 void DocumentLoader::replaceDocument(const String& source, Document* ownerDocume
nt) |
| 830 { | 831 { |
| 831 m_frame->loader().stopAllLoaders(); | 832 m_frame->loader().stopAllLoaders(); |
| 832 m_writer = createWriterFor(m_frame, ownerDocument, m_frame->document()->url(
), mimeType(), m_writer ? m_writer->encoding() : emptyAtom, m_writer ? m_writer
->encodingWasChosenByUser() : false, true); | 833 m_writer = createWriterFor(m_frame, ownerDocument, m_frame->document()->url(
), mimeType(), m_writer ? m_writer->encoding() : emptyAtom, m_writer ? m_writer
->encodingWasChosenByUser() : false, true); |
| 833 if (!source.isNull()) | 834 if (!source.isNull()) |
| 834 m_writer->appendReplacingData(source); | 835 m_writer->appendReplacingData(source); |
| 835 endWriting(m_writer.get()); | 836 endWriting(m_writer.get()); |
| 836 } | 837 } |
| 837 | 838 |
| 838 } // namespace WebCore | 839 } // namespace WebCore |
| OLD | NEW |