| 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 422 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 433 // | 433 // |
| 434 // TODO(mkwst): Remove this once XFO moves to the browser. | 434 // TODO(mkwst): Remove this once XFO moves to the browser. |
| 435 // https://crbug.com/555418. | 435 // https://crbug.com/555418. |
| 436 clearMainResourceHandle(); | 436 clearMainResourceHandle(); |
| 437 m_contentSecurityPolicy.clear(); | 437 m_contentSecurityPolicy.clear(); |
| 438 KURL blockedURL = SecurityOrigin::urlWithUniqueSecurityOrigin(); | 438 KURL blockedURL = SecurityOrigin::urlWithUniqueSecurityOrigin(); |
| 439 m_originalRequest.setURL(blockedURL); | 439 m_originalRequest.setURL(blockedURL); |
| 440 m_request.setURL(blockedURL); | 440 m_request.setURL(blockedURL); |
| 441 m_redirectChain.pop_back(); | 441 m_redirectChain.pop_back(); |
| 442 appendRedirect(blockedURL); | 442 appendRedirect(blockedURL); |
| 443 m_response = ResourceResponse(blockedURL, "text/html", 0, nullAtom, String()); | 443 m_response = ResourceResponse(blockedURL, "text/html", 0, nullAtom); |
| 444 finishedLoading(monotonicallyIncreasingTime()); | 444 finishedLoading(monotonicallyIncreasingTime()); |
| 445 | 445 |
| 446 return; | 446 return; |
| 447 } | 447 } |
| 448 | 448 |
| 449 void DocumentLoader::responseReceived( | 449 void DocumentLoader::responseReceived( |
| 450 Resource* resource, | 450 Resource* resource, |
| 451 const ResourceResponse& response, | 451 const ResourceResponse& response, |
| 452 std::unique_ptr<WebDataConsumerHandle> handle) { | 452 std::unique_ptr<WebDataConsumerHandle> handle) { |
| 453 DCHECK_EQ(m_mainResource, resource); | 453 DCHECK_EQ(m_mainResource, resource); |
| (...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 702 bool shouldLoadEmpty = !m_substituteData.isValid() && | 702 bool shouldLoadEmpty = !m_substituteData.isValid() && |
| 703 (m_request.url().isEmpty() || | 703 (m_request.url().isEmpty() || |
| 704 SchemeRegistry::shouldLoadURLSchemeAsEmptyDocument( | 704 SchemeRegistry::shouldLoadURLSchemeAsEmptyDocument( |
| 705 m_request.url().protocol())); | 705 m_request.url().protocol())); |
| 706 if (!shouldLoadEmpty) | 706 if (!shouldLoadEmpty) |
| 707 return false; | 707 return false; |
| 708 | 708 |
| 709 if (m_request.url().isEmpty() && | 709 if (m_request.url().isEmpty() && |
| 710 !frameLoader().stateMachine()->creatingInitialEmptyDocument()) | 710 !frameLoader().stateMachine()->creatingInitialEmptyDocument()) |
| 711 m_request.setURL(blankURL()); | 711 m_request.setURL(blankURL()); |
| 712 m_response = | 712 m_response = ResourceResponse(m_request.url(), "text/html", 0, nullAtom); |
| 713 ResourceResponse(m_request.url(), "text/html", 0, nullAtom, String()); | |
| 714 finishedLoading(monotonicallyIncreasingTime()); | 713 finishedLoading(monotonicallyIncreasingTime()); |
| 715 return true; | 714 return true; |
| 716 } | 715 } |
| 717 | 716 |
| 718 void DocumentLoader::startLoadingMainResource() { | 717 void DocumentLoader::startLoadingMainResource() { |
| 719 timing().markNavigationStart(); | 718 timing().markNavigationStart(); |
| 720 DCHECK(!m_mainResource); | 719 DCHECK(!m_mainResource); |
| 721 DCHECK_EQ(m_state, NotStarted); | 720 DCHECK_EQ(m_state, NotStarted); |
| 722 m_state = Provisional; | 721 m_state = Provisional; |
| 723 | 722 |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 816 m_writer ? m_writer->encoding() : emptyAtom, true, | 815 m_writer ? m_writer->encoding() : emptyAtom, true, |
| 817 ForceSynchronousParsing); | 816 ForceSynchronousParsing); |
| 818 if (!source.isNull()) | 817 if (!source.isNull()) |
| 819 m_writer->appendReplacingData(source); | 818 m_writer->appendReplacingData(source); |
| 820 endWriting(); | 819 endWriting(); |
| 821 } | 820 } |
| 822 | 821 |
| 823 DEFINE_WEAK_IDENTIFIER_MAP(DocumentLoader); | 822 DEFINE_WEAK_IDENTIFIER_MAP(DocumentLoader); |
| 824 | 823 |
| 825 } // namespace blink | 824 } // namespace blink |
| OLD | NEW |