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 446 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
457 if ((status < 200 || status >= 300) && m_frame->owner()) | 457 if ((status < 200 || status >= 300) && m_frame->owner()) |
458 m_frame->owner()->renderFallbackContent(); | 458 m_frame->owner()->renderFallbackContent(); |
459 } | 459 } |
460 } | 460 } |
461 | 461 |
462 void DocumentLoader::ensureWriter(const AtomicString& mimeType, const KURL& over
ridingURL) | 462 void DocumentLoader::ensureWriter(const AtomicString& mimeType, const KURL& over
ridingURL) |
463 { | 463 { |
464 if (m_writer) | 464 if (m_writer) |
465 return; | 465 return; |
466 | 466 |
467 const AtomicString& encoding = m_frame->host()->overrideEncoding().isNull()
? response().textEncodingName() : m_frame->host()->overrideEncoding(); | 467 const AtomicString& encoding = response().textEncodingName(); |
468 | 468 |
469 // Prepare a DocumentInit before clearing the frame, because it may need to | 469 // Prepare a DocumentInit before clearing the frame, because it may need to |
470 // inherit an aliased security context. | 470 // inherit an aliased security context. |
471 Document* owner = nullptr; | 471 Document* owner = nullptr; |
472 // TODO(dcheng): This differs from the behavior of both IE and Firefox: the | 472 // TODO(dcheng): This differs from the behavior of both IE and Firefox: the |
473 // origin is inherited from the document that loaded the URL. | 473 // origin is inherited from the document that loaded the URL. |
474 if (shouldInheritSecurityOriginFromOwner(url())) { | 474 if (shouldInheritSecurityOriginFromOwner(url())) { |
475 Frame* ownerFrame = m_frame->tree().parent(); | 475 Frame* ownerFrame = m_frame->tree().parent(); |
476 if (!ownerFrame) | 476 if (!ownerFrame) |
477 ownerFrame = m_frame->loader().opener(); | 477 ownerFrame = m_frame->loader().opener(); |
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
731 { | 731 { |
732 m_writer = createWriterFor(init, mimeType(), m_writer ? m_writer->encoding()
: emptyAtom, true, ForceSynchronousParsing); | 732 m_writer = createWriterFor(init, mimeType(), m_writer ? m_writer->encoding()
: emptyAtom, true, ForceSynchronousParsing); |
733 if (!source.isNull()) | 733 if (!source.isNull()) |
734 m_writer->appendReplacingData(source); | 734 m_writer->appendReplacingData(source); |
735 endWriting(m_writer.get()); | 735 endWriting(m_writer.get()); |
736 } | 736 } |
737 | 737 |
738 DEFINE_WEAK_IDENTIFIER_MAP(DocumentLoader); | 738 DEFINE_WEAK_IDENTIFIER_MAP(DocumentLoader); |
739 | 739 |
740 } // namespace blink | 740 } // namespace blink |
OLD | NEW |