| 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 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 700 bool shouldLoadEmpty = !m_substituteData.isValid() && | 700 bool shouldLoadEmpty = !m_substituteData.isValid() && |
| 701 (m_request.url().isEmpty() || | 701 (m_request.url().isEmpty() || |
| 702 SchemeRegistry::shouldLoadURLSchemeAsEmptyDocument( | 702 SchemeRegistry::shouldLoadURLSchemeAsEmptyDocument( |
| 703 m_request.url().protocol())); | 703 m_request.url().protocol())); |
| 704 if (!shouldLoadEmpty) | 704 if (!shouldLoadEmpty) |
| 705 return false; | 705 return false; |
| 706 | 706 |
| 707 if (m_request.url().isEmpty() && | 707 if (m_request.url().isEmpty() && |
| 708 !frameLoader().stateMachine()->creatingInitialEmptyDocument()) | 708 !frameLoader().stateMachine()->creatingInitialEmptyDocument()) |
| 709 m_request.setURL(blankURL()); | 709 m_request.setURL(blankURL()); |
| 710 m_response = | 710 m_response = ResourceResponse(m_request.url(), "text/html", 0, nullAtom); |
| 711 ResourceResponse(m_request.url(), "text/html", 0, nullAtom, String()); | |
| 712 finishedLoading(monotonicallyIncreasingTime()); | 711 finishedLoading(monotonicallyIncreasingTime()); |
| 713 return true; | 712 return true; |
| 714 } | 713 } |
| 715 | 714 |
| 716 void DocumentLoader::startLoadingMainResource() { | 715 void DocumentLoader::startLoadingMainResource() { |
| 717 timing().markNavigationStart(); | 716 timing().markNavigationStart(); |
| 718 DCHECK(!m_mainResource); | 717 DCHECK(!m_mainResource); |
| 719 DCHECK_EQ(m_state, NotStarted); | 718 DCHECK_EQ(m_state, NotStarted); |
| 720 m_state = Provisional; | 719 m_state = Provisional; |
| 721 | 720 |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 814 m_writer ? m_writer->encoding() : emptyAtom, true, | 813 m_writer ? m_writer->encoding() : emptyAtom, true, |
| 815 ForceSynchronousParsing); | 814 ForceSynchronousParsing); |
| 816 if (!source.isNull()) | 815 if (!source.isNull()) |
| 817 m_writer->appendReplacingData(source); | 816 m_writer->appendReplacingData(source); |
| 818 endWriting(); | 817 endWriting(); |
| 819 } | 818 } |
| 820 | 819 |
| 821 DEFINE_WEAK_IDENTIFIER_MAP(DocumentLoader); | 820 DEFINE_WEAK_IDENTIFIER_MAP(DocumentLoader); |
| 822 | 821 |
| 823 } // namespace blink | 822 } // namespace blink |
| OLD | NEW |