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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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/page/FrameTree.h" | 50 #include "core/page/FrameTree.h" |
51 #include "core/page/Page.h" | 51 #include "core/page/Page.h" |
52 #include "core/frame/Settings.h" | 52 #include "core/frame/Settings.h" |
| 53 #include "core/inspector/ConsoleMessage.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" |
60 #include "platform/weborigin/SecurityPolicy.h" | 61 #include "platform/weborigin/SecurityPolicy.h" |
61 #include "public/platform/Platform.h" | 62 #include "public/platform/Platform.h" |
62 #include "public/platform/WebMimeRegistry.h" | 63 #include "public/platform/WebMimeRegistry.h" |
(...skipping 385 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 RefPtr<ConsoleMessage> consoleMessage = ConsoleMessage::create(Secur
ityMessageSource, ErrorMessageLevel, message); |
| 460 consoleMessage->setRequestIdentifier(identifier); |
| 461 frame()->document()->addMessage(consoleMessage.release()); |
459 frame()->document()->enforceSandboxFlags(SandboxOrigin); | 462 frame()->document()->enforceSandboxFlags(SandboxOrigin); |
460 if (FrameOwner* owner = frame()->owner()) | 463 if (FrameOwner* owner = frame()->owner()) |
461 owner->dispatchLoad(); | 464 owner->dispatchLoad(); |
462 | 465 |
463 // The load event might have detached this frame. In that case, the
load will already have been cancelled during detach. | 466 // The load event might have detached this frame. In that case, the
load will already have been cancelled during detach. |
464 if (frameLoader()) | 467 if (frameLoader()) |
465 cancelMainResourceLoad(ResourceError::cancelledError(m_request.u
rl())); | 468 cancelMainResourceLoad(ResourceError::cancelledError(m_request.u
rl())); |
466 return; | 469 return; |
467 } | 470 } |
468 } | 471 } |
(...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
831 void DocumentLoader::replaceDocument(const String& source, Document* ownerDocume
nt) | 834 void DocumentLoader::replaceDocument(const String& source, Document* ownerDocume
nt) |
832 { | 835 { |
833 m_frame->loader().stopAllLoaders(); | 836 m_frame->loader().stopAllLoaders(); |
834 m_writer = createWriterFor(m_frame, ownerDocument, m_frame->document()->url(
), mimeType(), m_writer ? m_writer->encoding() : emptyAtom, m_writer ? m_writer
->encodingWasChosenByUser() : false, true); | 837 m_writer = createWriterFor(m_frame, ownerDocument, m_frame->document()->url(
), mimeType(), m_writer ? m_writer->encoding() : emptyAtom, m_writer ? m_writer
->encodingWasChosenByUser() : false, true); |
835 if (!source.isNull()) | 838 if (!source.isNull()) |
836 m_writer->appendReplacingData(source); | 839 m_writer->appendReplacingData(source); |
837 endWriting(m_writer.get()); | 840 endWriting(m_writer.get()); |
838 } | 841 } |
839 | 842 |
840 } // namespace blink | 843 } // namespace blink |
OLD | NEW |