Chromium Code Reviews| 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 17 matching lines...) Expand all Loading... | |
| 28 */ | 28 */ |
| 29 | 29 |
| 30 #include "core/loader/DocumentLoader.h" | 30 #include "core/loader/DocumentLoader.h" |
| 31 | 31 |
| 32 #include "core/dom/Document.h" | 32 #include "core/dom/Document.h" |
| 33 #include "core/dom/DocumentParser.h" | 33 #include "core/dom/DocumentParser.h" |
| 34 #include "core/dom/WeakIdentifierMap.h" | 34 #include "core/dom/WeakIdentifierMap.h" |
| 35 #include "core/events/Event.h" | 35 #include "core/events/Event.h" |
| 36 #include "core/fetch/FetchInitiatorTypeNames.h" | 36 #include "core/fetch/FetchInitiatorTypeNames.h" |
| 37 #include "core/fetch/FetchRequest.h" | 37 #include "core/fetch/FetchRequest.h" |
| 38 #include "core/fetch/FetchUtils.h" | |
| 38 #include "core/fetch/MemoryCache.h" | 39 #include "core/fetch/MemoryCache.h" |
| 39 #include "core/fetch/ResourceFetcher.h" | 40 #include "core/fetch/ResourceFetcher.h" |
| 40 #include "core/frame/Deprecation.h" | 41 #include "core/frame/Deprecation.h" |
| 41 #include "core/frame/FrameHost.h" | 42 #include "core/frame/FrameHost.h" |
| 42 #include "core/frame/LocalDOMWindow.h" | 43 #include "core/frame/LocalDOMWindow.h" |
| 43 #include "core/frame/LocalFrame.h" | 44 #include "core/frame/LocalFrame.h" |
| 44 #include "core/frame/Settings.h" | 45 #include "core/frame/Settings.h" |
| 45 #include "core/frame/csp/ContentSecurityPolicy.h" | 46 #include "core/frame/csp/ContentSecurityPolicy.h" |
| 46 #include "core/html/HTMLFrameOwnerElement.h" | 47 #include "core/html/HTMLFrameOwnerElement.h" |
| 47 #include "core/html/parser/HTMLDocumentParser.h" | 48 #include "core/html/parser/HTMLDocumentParser.h" |
| (...skipping 451 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 499 if (!shouldContinueForResponse()) { | 500 if (!shouldContinueForResponse()) { |
| 500 InspectorInstrumentation::continueWithPolicyIgnore( | 501 InspectorInstrumentation::continueWithPolicyIgnore( |
| 501 m_frame, this, m_mainResource->identifier(), m_response, | 502 m_frame, this, m_mainResource->identifier(), m_response, |
| 502 m_mainResource.get()); | 503 m_mainResource.get()); |
| 503 m_fetcher->stopFetching(); | 504 m_fetcher->stopFetching(); |
| 504 return; | 505 return; |
| 505 } | 506 } |
| 506 | 507 |
| 507 if (m_response.isHTTP()) { | 508 if (m_response.isHTTP()) { |
| 508 int status = m_response.httpStatusCode(); | 509 int status = m_response.httpStatusCode(); |
| 509 if ((status < 200 || status >= 300) && m_frame->owner()) | 510 if (!FetchUtils::isSuccessfulStatusCode(status) && m_frame->owner()) |
|
tyoshino (SeeGerritForStatus)
2017/01/05 05:54:24
just pass "m_response.httpStatusCode()" directly?
sof
2017/01/05 08:11:03
Done, conflated the double "if".
| |
| 510 m_frame->owner()->renderFallbackContent(); | 511 m_frame->owner()->renderFallbackContent(); |
| 511 } | 512 } |
| 512 } | 513 } |
| 513 | 514 |
| 514 void DocumentLoader::ensureWriter(const AtomicString& mimeType, | 515 void DocumentLoader::ensureWriter(const AtomicString& mimeType, |
| 515 const KURL& overridingURL) { | 516 const KURL& overridingURL) { |
| 516 if (m_writer) | 517 if (m_writer) |
| 517 return; | 518 return; |
| 518 | 519 |
| 519 const AtomicString& encoding = response().textEncodingName(); | 520 const AtomicString& encoding = response().textEncodingName(); |
| (...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 801 m_writer ? m_writer->encoding() : emptyAtom, true, | 802 m_writer ? m_writer->encoding() : emptyAtom, true, |
| 802 ForceSynchronousParsing); | 803 ForceSynchronousParsing); |
| 803 if (!source.isNull()) | 804 if (!source.isNull()) |
| 804 m_writer->appendReplacingData(source); | 805 m_writer->appendReplacingData(source); |
| 805 endWriting(); | 806 endWriting(); |
| 806 } | 807 } |
| 807 | 808 |
| 808 DEFINE_WEAK_IDENTIFIER_MAP(DocumentLoader); | 809 DEFINE_WEAK_IDENTIFIER_MAP(DocumentLoader); |
| 809 | 810 |
| 810 } // namespace blink | 811 } // namespace blink |
| OLD | NEW |