| 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 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 210 } | 210 } |
| 211 | 211 |
| 212 void DocumentLoader::mainReceivedError(const ResourceError& error) | 212 void DocumentLoader::mainReceivedError(const ResourceError& error) |
| 213 { | 213 { |
| 214 ASSERT(!error.isNull()); | 214 ASSERT(!error.isNull()); |
| 215 ASSERT(!mainResourceLoader() || !mainResourceLoader()->defersLoading() || In
spectorInstrumentation::isDebuggerPaused(m_frame)); | 215 ASSERT(!mainResourceLoader() || !mainResourceLoader()->defersLoading() || In
spectorInstrumentation::isDebuggerPaused(m_frame)); |
| 216 if (m_applicationCacheHost) | 216 if (m_applicationCacheHost) |
| 217 m_applicationCacheHost->failedLoadingMainResource(); | 217 m_applicationCacheHost->failedLoadingMainResource(); |
| 218 if (!frameLoader()) | 218 if (!frameLoader()) |
| 219 return; | 219 return; |
| 220 m_mainDocumentError = error; | |
| 221 m_state = MainResourceDone; | 220 m_state = MainResourceDone; |
| 222 frameLoader()->receivedMainResourceError(this, error); | 221 frameLoader()->receivedMainResourceError(this, error); |
| 223 clearMainResourceHandle(); | 222 clearMainResourceHandle(); |
| 224 } | 223 } |
| 225 | 224 |
| 226 // Cancels the data source's pending loads. Conceptually, a data source only lo
ads | 225 // Cancels the data source's pending loads. Conceptually, a data source only lo
ads |
| 227 // one document at a time, but one document may have many related resources. | 226 // one document at a time, but one document may have many related resources. |
| 228 // stopLoading will stop all loads initiated by the data source, | 227 // stopLoading will stop all loads initiated by the data source, |
| 229 // but not loads initiated by child frames' data sources -- that's the WebFrame'
s job. | 228 // but not loads initiated by child frames' data sources -- that's the WebFrame'
s job. |
| 230 void DocumentLoader::stopLoading() | 229 void DocumentLoader::stopLoading() |
| (...skipping 484 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 715 if (m_request.url().isEmpty() && !frameLoader()->stateMachine()->creatingIni
tialEmptyDocument()) | 714 if (m_request.url().isEmpty() && !frameLoader()->stateMachine()->creatingIni
tialEmptyDocument()) |
| 716 m_request.setURL(blankURL()); | 715 m_request.setURL(blankURL()); |
| 717 m_response = ResourceResponse(m_request.url(), "text/html", 0, nullAtom, Str
ing()); | 716 m_response = ResourceResponse(m_request.url(), "text/html", 0, nullAtom, Str
ing()); |
| 718 finishedLoading(monotonicallyIncreasingTime()); | 717 finishedLoading(monotonicallyIncreasingTime()); |
| 719 return true; | 718 return true; |
| 720 } | 719 } |
| 721 | 720 |
| 722 void DocumentLoader::startLoadingMainResource() | 721 void DocumentLoader::startLoadingMainResource() |
| 723 { | 722 { |
| 724 RefPtrWillBeRawPtr<DocumentLoader> protect(this); | 723 RefPtrWillBeRawPtr<DocumentLoader> protect(this); |
| 725 m_mainDocumentError = ResourceError(); | |
| 726 timing().markNavigationStart(); | 724 timing().markNavigationStart(); |
| 727 ASSERT(!m_mainResource); | 725 ASSERT(!m_mainResource); |
| 728 ASSERT(m_state == NotStarted); | 726 ASSERT(m_state == NotStarted); |
| 729 m_state = Provisional; | 727 m_state = Provisional; |
| 730 | 728 |
| 731 if (maybeLoadEmpty()) | 729 if (maybeLoadEmpty()) |
| 732 return; | 730 return; |
| 733 | 731 |
| 734 ASSERT(timing().navigationStart()); | 732 ASSERT(timing().navigationStart()); |
| 735 ASSERT(!timing().fetchStart()); | 733 ASSERT(!timing().fetchStart()); |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 833 { | 831 { |
| 834 m_writer = createWriterFor(ownerDocument, init, mimeType(), m_writer ? m_wri
ter->encoding() : emptyAtom, true, ForceSynchronousParsing); | 832 m_writer = createWriterFor(ownerDocument, init, mimeType(), m_writer ? m_wri
ter->encoding() : emptyAtom, true, ForceSynchronousParsing); |
| 835 if (!source.isNull()) | 833 if (!source.isNull()) |
| 836 m_writer->appendReplacingData(source); | 834 m_writer->appendReplacingData(source); |
| 837 endWriting(m_writer.get()); | 835 endWriting(m_writer.get()); |
| 838 } | 836 } |
| 839 | 837 |
| 840 DEFINE_WEAK_IDENTIFIER_MAP(DocumentLoader); | 838 DEFINE_WEAK_IDENTIFIER_MAP(DocumentLoader); |
| 841 | 839 |
| 842 } // namespace blink | 840 } // namespace blink |
| OLD | NEW |