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 436 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
447 DEFINE_STATIC_LOCAL(AtomicString, xFrameOptionHeader, ("x-frame-options", At
omicString::ConstructFromLiteral)); | 447 DEFINE_STATIC_LOCAL(AtomicString, xFrameOptionHeader, ("x-frame-options", At
omicString::ConstructFromLiteral)); |
448 HTTPHeaderMap::const_iterator it = response.httpHeaderFields().find(xFrameOp
tionHeader); | 448 HTTPHeaderMap::const_iterator it = response.httpHeaderFields().find(xFrameOp
tionHeader); |
449 if (it != response.httpHeaderFields().end()) { | 449 if (it != response.httpHeaderFields().end()) { |
450 String content = it->value; | 450 String content = it->value; |
451 ASSERT(m_mainResource); | 451 ASSERT(m_mainResource); |
452 unsigned long identifier = mainResourceIdentifier(); | 452 unsigned long identifier = mainResourceIdentifier(); |
453 ASSERT(identifier); | 453 ASSERT(identifier); |
454 if (frameLoader()->shouldInterruptLoadForXFrameOptions(content, response
.url(), identifier)) { | 454 if (frameLoader()->shouldInterruptLoadForXFrameOptions(content, response
.url(), identifier)) { |
455 InspectorInstrumentation::continueAfterXFrameOptionsDenied(m_frame,
this, identifier, response); | 455 InspectorInstrumentation::continueAfterXFrameOptionsDenied(m_frame,
this, identifier, response); |
456 String message = "Refused to display '" + response.url().elidedStrin
g() + "' in a frame because it set 'X-Frame-Options' to '" + content + "'."; | 456 String message = "Refused to display '" + response.url().elidedStrin
g() + "' in a frame because it set 'X-Frame-Options' to '" + content + "'."; |
457 RefPtr<ConsoleMessage> consoleMessage = ConsoleMessage::create(Secur
ityMessageSource, ErrorMessageLevel, message); | 457 RefPtrWillBeRawPtr<ConsoleMessage> consoleMessage = ConsoleMessage::
create(SecurityMessageSource, ErrorMessageLevel, message); |
458 consoleMessage->setRequestIdentifier(identifier); | 458 consoleMessage->setRequestIdentifier(identifier); |
459 frame()->document()->addMessage(consoleMessage.release()); | 459 frame()->document()->addMessage(consoleMessage.release()); |
460 frame()->document()->enforceSandboxFlags(SandboxOrigin); | 460 frame()->document()->enforceSandboxFlags(SandboxOrigin); |
461 if (FrameOwner* owner = frame()->owner()) | 461 if (FrameOwner* owner = frame()->owner()) |
462 owner->dispatchLoad(); | 462 owner->dispatchLoad(); |
463 | 463 |
464 // 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. |
465 if (frameLoader()) | 465 if (frameLoader()) |
466 cancelMainResourceLoad(ResourceError::cancelledError(m_request.u
rl())); | 466 cancelMainResourceLoad(ResourceError::cancelledError(m_request.u
rl())); |
467 return; | 467 return; |
(...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
832 void DocumentLoader::replaceDocument(const String& source, Document* ownerDocume
nt) | 832 void DocumentLoader::replaceDocument(const String& source, Document* ownerDocume
nt) |
833 { | 833 { |
834 m_frame->loader().stopAllLoaders(); | 834 m_frame->loader().stopAllLoaders(); |
835 m_writer = createWriterFor(m_frame, ownerDocument, m_frame->document()->url(
), mimeType(), m_writer ? m_writer->encoding() : emptyAtom, true); | 835 m_writer = createWriterFor(m_frame, ownerDocument, m_frame->document()->url(
), mimeType(), m_writer ? m_writer->encoding() : emptyAtom, true); |
836 if (!source.isNull()) | 836 if (!source.isNull()) |
837 m_writer->appendReplacingData(source); | 837 m_writer->appendReplacingData(source); |
838 endWriting(m_writer.get()); | 838 endWriting(m_writer.get()); |
839 } | 839 } |
840 | 840 |
841 } // namespace blink | 841 } // namespace blink |
OLD | NEW |