| 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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 , m_navigationType(NavigationTypeOther) | 93 , m_navigationType(NavigationTypeOther) |
| 94 , m_loadingMainResource(false) | 94 , m_loadingMainResource(false) |
| 95 , m_timeOfLastDataReceived(0.0) | 95 , m_timeOfLastDataReceived(0.0) |
| 96 , m_applicationCacheHost(ApplicationCacheHost::create(this)) | 96 , m_applicationCacheHost(ApplicationCacheHost::create(this)) |
| 97 { | 97 { |
| 98 } | 98 } |
| 99 | 99 |
| 100 FrameLoader* DocumentLoader::frameLoader() const | 100 FrameLoader* DocumentLoader::frameLoader() const |
| 101 { | 101 { |
| 102 if (!m_frame) | 102 if (!m_frame) |
| 103 return nullptr; | 103 return 0; |
| 104 return &m_frame->loader(); | 104 return &m_frame->loader(); |
| 105 } | 105 } |
| 106 | 106 |
| 107 ResourceLoader* DocumentLoader::mainResourceLoader() const | 107 ResourceLoader* DocumentLoader::mainResourceLoader() const |
| 108 { | 108 { |
| 109 return m_mainResource ? m_mainResource->loader() : nullptr; | 109 return m_mainResource ? m_mainResource->loader() : 0; |
| 110 } | 110 } |
| 111 | 111 |
| 112 DocumentLoader::~DocumentLoader() | 112 DocumentLoader::~DocumentLoader() |
| 113 { | 113 { |
| 114 ASSERT(!m_frame || !isLoading()); | 114 ASSERT(!m_frame || !isLoading()); |
| 115 ASSERT(!m_mainResource); | 115 clearMainResourceHandle(); |
| 116 ASSERT(!m_applicationCacheHost); | 116 m_applicationCacheHost->dispose(); |
| 117 } | |
| 118 | |
| 119 DEFINE_TRACE(DocumentLoader) | |
| 120 { | |
| 121 visitor->trace(m_frame); | |
| 122 visitor->trace(m_fetcher); | |
| 123 // TODO(sof): start tracing ResourcePtr<>s (and m_mainResource.) | |
| 124 visitor->trace(m_writer); | |
| 125 visitor->trace(m_archive); | |
| 126 visitor->trace(m_applicationCacheHost); | |
| 127 } | 117 } |
| 128 | 118 |
| 129 unsigned long DocumentLoader::mainResourceIdentifier() const | 119 unsigned long DocumentLoader::mainResourceIdentifier() const |
| 130 { | 120 { |
| 131 return m_mainResource ? m_mainResource->identifier() : 0; | 121 return m_mainResource ? m_mainResource->identifier() : 0; |
| 132 } | 122 } |
| 133 | 123 |
| 134 Document* DocumentLoader::document() const | 124 Document* DocumentLoader::document() const |
| 135 { | 125 { |
| 136 if (m_frame && m_frame->loader().documentLoader() == this) | 126 if (m_frame && m_frame->loader().documentLoader() == this) |
| 137 return m_frame->document(); | 127 return m_frame->document(); |
| 138 return nullptr; | 128 return 0; |
| 139 } | 129 } |
| 140 | 130 |
| 141 const ResourceRequest& DocumentLoader::originalRequest() const | 131 const ResourceRequest& DocumentLoader::originalRequest() const |
| 142 { | 132 { |
| 143 return m_originalRequest; | 133 return m_originalRequest; |
| 144 } | 134 } |
| 145 | 135 |
| 146 const ResourceRequest& DocumentLoader::request() const | 136 const ResourceRequest& DocumentLoader::request() const |
| 147 { | 137 { |
| 148 return m_request; | 138 return m_request; |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 193 | 183 |
| 194 const KURL& DocumentLoader::urlForHistory() const | 184 const KURL& DocumentLoader::urlForHistory() const |
| 195 { | 185 { |
| 196 return unreachableURL().isEmpty() ? url() : unreachableURL(); | 186 return unreachableURL().isEmpty() ? url() : unreachableURL(); |
| 197 } | 187 } |
| 198 | 188 |
| 199 void DocumentLoader::mainReceivedError(const ResourceError& error) | 189 void DocumentLoader::mainReceivedError(const ResourceError& error) |
| 200 { | 190 { |
| 201 ASSERT(!error.isNull()); | 191 ASSERT(!error.isNull()); |
| 202 ASSERT(!mainResourceLoader() || !mainResourceLoader()->defersLoading() || In
spectorInstrumentation::isDebuggerPaused(m_frame)); | 192 ASSERT(!mainResourceLoader() || !mainResourceLoader()->defersLoading() || In
spectorInstrumentation::isDebuggerPaused(m_frame)); |
| 203 if (m_applicationCacheHost) | 193 m_applicationCacheHost->failedLoadingMainResource(); |
| 204 m_applicationCacheHost->failedLoadingMainResource(); | |
| 205 if (!frameLoader()) | 194 if (!frameLoader()) |
| 206 return; | 195 return; |
| 207 m_mainDocumentError = error; | 196 m_mainDocumentError = error; |
| 208 clearMainResourceLoader(); | 197 clearMainResourceLoader(); |
| 209 frameLoader()->receivedMainResourceError(this, error); | 198 frameLoader()->receivedMainResourceError(this, error); |
| 210 clearMainResourceHandle(); | 199 clearMainResourceHandle(); |
| 211 } | 200 } |
| 212 | 201 |
| 213 // Cancels the data source's pending loads. Conceptually, a data source only lo
ads | 202 // Cancels the data source's pending loads. Conceptually, a data source only lo
ads |
| 214 // one document at a time, but one document may have many related resources. | 203 // one document at a time, but one document may have many related resources. |
| 215 // stopLoading will stop all loads initiated by the data source, | 204 // stopLoading will stop all loads initiated by the data source, |
| 216 // but not loads initiated by child frames' data sources -- that's the WebFrame'
s job. | 205 // but not loads initiated by child frames' data sources -- that's the WebFrame'
s job. |
| 217 void DocumentLoader::stopLoading() | 206 void DocumentLoader::stopLoading() |
| 218 { | 207 { |
| 219 RefPtrWillBeRawPtr<LocalFrame> protectFrame(m_frame.get()); | 208 RefPtrWillBeRawPtr<LocalFrame> protectFrame(m_frame); |
| 220 RefPtrWillBeRawPtr<DocumentLoader> protectLoader(this); | 209 RefPtr<DocumentLoader> protectLoader(this); |
| 221 | 210 |
| 222 m_fetcher->stopFetching(); | 211 m_fetcher->stopFetching(); |
| 223 if (isLoading()) | 212 if (isLoading()) |
| 224 cancelMainResourceLoad(ResourceError::cancelledError(m_request.url())); | 213 cancelMainResourceLoad(ResourceError::cancelledError(m_request.url())); |
| 225 } | 214 } |
| 226 | 215 |
| 227 void DocumentLoader::commitIfReady() | 216 void DocumentLoader::commitIfReady() |
| 228 { | 217 { |
| 229 if (!m_committed) { | 218 if (!m_committed) { |
| 230 m_committed = true; | 219 m_committed = true; |
| 231 frameLoader()->commitProvisionalLoad(); | 220 frameLoader()->commitProvisionalLoad(); |
| 232 } | 221 } |
| 233 } | 222 } |
| 234 | 223 |
| 235 bool DocumentLoader::isLoading() const | 224 bool DocumentLoader::isLoading() const |
| 236 { | 225 { |
| 237 if (document() && document()->hasActiveParser()) | 226 if (document() && document()->hasActiveParser()) |
| 238 return true; | 227 return true; |
| 239 | 228 |
| 240 return m_loadingMainResource || m_fetcher->isFetching(); | 229 return m_loadingMainResource || m_fetcher->isFetching(); |
| 241 } | 230 } |
| 242 | 231 |
| 243 void DocumentLoader::notifyFinished(Resource* resource) | 232 void DocumentLoader::notifyFinished(Resource* resource) |
| 244 { | 233 { |
| 245 ASSERT_UNUSED(resource, m_mainResource == resource); | 234 ASSERT_UNUSED(resource, m_mainResource == resource); |
| 246 ASSERT(m_mainResource); | 235 ASSERT(m_mainResource); |
| 247 | 236 |
| 248 RefPtrWillBeRawPtr<DocumentLoader> protect(this); | 237 RefPtr<DocumentLoader> protect(this); |
| 249 | 238 |
| 250 if (!m_mainResource->errorOccurred() && !m_mainResource->wasCanceled()) { | 239 if (!m_mainResource->errorOccurred() && !m_mainResource->wasCanceled()) { |
| 251 finishedLoading(m_mainResource->loadFinishTime()); | 240 finishedLoading(m_mainResource->loadFinishTime()); |
| 252 return; | 241 return; |
| 253 } | 242 } |
| 254 | 243 |
| 255 mainReceivedError(m_mainResource->resourceError()); | 244 mainReceivedError(m_mainResource->resourceError()); |
| 256 } | 245 } |
| 257 | 246 |
| 258 void DocumentLoader::finishedLoading(double finishTime) | 247 void DocumentLoader::finishedLoading(double finishTime) |
| 259 { | 248 { |
| 260 ASSERT(!mainResourceLoader() || !mainResourceLoader()->defersLoading() || In
spectorInstrumentation::isDebuggerPaused(m_frame)); | 249 ASSERT(!mainResourceLoader() || !mainResourceLoader()->defersLoading() || In
spectorInstrumentation::isDebuggerPaused(m_frame)); |
| 261 | 250 |
| 262 RefPtrWillBeRawPtr<DocumentLoader> protect(this); | 251 RefPtr<DocumentLoader> protect(this); |
| 263 | 252 |
| 264 double responseEndTime = finishTime; | 253 double responseEndTime = finishTime; |
| 265 if (!responseEndTime) | 254 if (!responseEndTime) |
| 266 responseEndTime = m_timeOfLastDataReceived; | 255 responseEndTime = m_timeOfLastDataReceived; |
| 267 if (!responseEndTime) | 256 if (!responseEndTime) |
| 268 responseEndTime = monotonicallyIncreasingTime(); | 257 responseEndTime = monotonicallyIncreasingTime(); |
| 269 timing().setResponseEnd(responseEndTime); | 258 timing().setResponseEnd(responseEndTime); |
| 270 | 259 |
| 271 commitIfReady(); | 260 commitIfReady(); |
| 272 if (!frameLoader()) | 261 if (!frameLoader()) |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 440 // The load event might have detached this frame. In that case, the load wil
l already have been cancelled during detach. | 429 // The load event might have detached this frame. In that case, the load wil
l already have been cancelled during detach. |
| 441 if (frameLoader()) | 430 if (frameLoader()) |
| 442 cancelMainResourceLoad(ResourceError::cancelledError(m_request.url())); | 431 cancelMainResourceLoad(ResourceError::cancelledError(m_request.url())); |
| 443 return; | 432 return; |
| 444 } | 433 } |
| 445 | 434 |
| 446 void DocumentLoader::responseReceived(Resource* resource, const ResourceResponse
& response, PassOwnPtr<WebDataConsumerHandle> handle) | 435 void DocumentLoader::responseReceived(Resource* resource, const ResourceResponse
& response, PassOwnPtr<WebDataConsumerHandle> handle) |
| 447 { | 436 { |
| 448 ASSERT_UNUSED(resource, m_mainResource == resource); | 437 ASSERT_UNUSED(resource, m_mainResource == resource); |
| 449 ASSERT_UNUSED(handle, !handle); | 438 ASSERT_UNUSED(handle, !handle); |
| 450 RefPtrWillBeRawPtr<DocumentLoader> protect(this); | 439 RefPtr<DocumentLoader> protect(this); |
| 451 ASSERT(frame()); | 440 ASSERT(frame()); |
| 452 | 441 |
| 453 m_applicationCacheHost->didReceiveResponseForMainResource(response); | 442 m_applicationCacheHost->didReceiveResponseForMainResource(response); |
| 454 | 443 |
| 455 // The memory cache doesn't understand the application cache or its caching
rules. So if a main resource is served | 444 // The memory cache doesn't understand the application cache or its caching
rules. So if a main resource is served |
| 456 // from the application cache, ensure we don't save the result for future us
e. All responses loaded | 445 // from the application cache, ensure we don't save the result for future us
e. All responses loaded |
| 457 // from appcache will have a non-zero appCacheID(). | 446 // from appcache will have a non-zero appCacheID(). |
| 458 if (response.appCacheID()) | 447 if (response.appCacheID()) |
| 459 memoryCache()->remove(m_mainResource.get()); | 448 memoryCache()->remove(m_mainResource.get()); |
| 460 | 449 |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 545 void DocumentLoader::dataReceived(Resource* resource, const char* data, unsigned
length) | 534 void DocumentLoader::dataReceived(Resource* resource, const char* data, unsigned
length) |
| 546 { | 535 { |
| 547 ASSERT(data); | 536 ASSERT(data); |
| 548 ASSERT(length); | 537 ASSERT(length); |
| 549 ASSERT_UNUSED(resource, resource == m_mainResource); | 538 ASSERT_UNUSED(resource, resource == m_mainResource); |
| 550 ASSERT(!m_response.isNull()); | 539 ASSERT(!m_response.isNull()); |
| 551 ASSERT(!mainResourceLoader() || !mainResourceLoader()->defersLoading()); | 540 ASSERT(!mainResourceLoader() || !mainResourceLoader()->defersLoading()); |
| 552 | 541 |
| 553 // Both unloading the old page and parsing the new page may execute JavaScri
pt which destroys the datasource | 542 // Both unloading the old page and parsing the new page may execute JavaScri
pt which destroys the datasource |
| 554 // by starting a new load, so retain temporarily. | 543 // by starting a new load, so retain temporarily. |
| 555 RefPtrWillBeRawPtr<LocalFrame> protectFrame(m_frame.get()); | 544 RefPtrWillBeRawPtr<LocalFrame> protectFrame(m_frame); |
| 556 RefPtrWillBeRawPtr<DocumentLoader> protectLoader(this); | 545 RefPtr<DocumentLoader> protectLoader(this); |
| 557 | 546 |
| 558 m_applicationCacheHost->mainResourceDataReceived(data, length); | 547 m_applicationCacheHost->mainResourceDataReceived(data, length); |
| 559 m_timeOfLastDataReceived = monotonicallyIncreasingTime(); | 548 m_timeOfLastDataReceived = monotonicallyIncreasingTime(); |
| 560 | 549 |
| 561 if (isArchiveMIMEType(response().mimeType())) | 550 if (isArchiveMIMEType(response().mimeType())) |
| 562 return; | 551 return; |
| 563 commitIfReady(); | 552 commitIfReady(); |
| 564 if (!frameLoader()) | 553 if (!frameLoader()) |
| 565 return; | 554 return; |
| 566 commitData(data, length); | 555 commitData(data, length); |
| (...skipping 15 matching lines...) Expand all Loading... |
| 582 } | 571 } |
| 583 | 572 |
| 584 bool DocumentLoader::loadingMultipartContent() const | 573 bool DocumentLoader::loadingMultipartContent() const |
| 585 { | 574 { |
| 586 return mainResourceLoader() ? mainResourceLoader()->loadingMultipartContent(
) : false; | 575 return mainResourceLoader() ? mainResourceLoader()->loadingMultipartContent(
) : false; |
| 587 } | 576 } |
| 588 | 577 |
| 589 void DocumentLoader::detachFromFrame() | 578 void DocumentLoader::detachFromFrame() |
| 590 { | 579 { |
| 591 ASSERT(m_frame); | 580 ASSERT(m_frame); |
| 592 RefPtrWillBeRawPtr<LocalFrame> protectFrame(m_frame.get()); | 581 RefPtrWillBeRawPtr<LocalFrame> protectFrame(m_frame); |
| 593 RefPtrWillBeRawPtr<DocumentLoader> protectLoader(this); | 582 RefPtr<DocumentLoader> protectLoader(this); |
| 594 | 583 |
| 595 // It never makes sense to have a document loader that is detached from its | 584 // It never makes sense to have a document loader that is detached from its |
| 596 // frame have any loads active, so go ahead and kill all the loads. | 585 // frame have any loads active, so go ahead and kill all the loads. |
| 597 stopLoading(); | 586 stopLoading(); |
| 598 | 587 |
| 599 // If that load cancellation triggered another detach, leave. | |
| 600 // (fast/frames/detach-frame-nested-no-crash.html is an example of this.) | |
| 601 if (!m_frame) | |
| 602 return; | |
| 603 | |
| 604 m_fetcher->clearContext(); | 588 m_fetcher->clearContext(); |
| 605 m_applicationCacheHost->detachFromDocumentLoader(); | 589 m_applicationCacheHost->setApplicationCache(0); |
| 606 m_applicationCacheHost.clear(); | |
| 607 WeakIdentifierMap<DocumentLoader>::notifyObjectDestroyed(this); | 590 WeakIdentifierMap<DocumentLoader>::notifyObjectDestroyed(this); |
| 608 clearMainResourceHandle(); | 591 m_frame = 0; |
| 609 m_frame = nullptr; | |
| 610 } | 592 } |
| 611 | 593 |
| 612 void DocumentLoader::clearMainResourceLoader() | 594 void DocumentLoader::clearMainResourceLoader() |
| 613 { | 595 { |
| 614 m_loadingMainResource = false; | 596 m_loadingMainResource = false; |
| 615 } | 597 } |
| 616 | 598 |
| 617 void DocumentLoader::clearMainResourceHandle() | 599 void DocumentLoader::clearMainResourceHandle() |
| 618 { | 600 { |
| 619 if (!m_mainResource) | 601 if (!m_mainResource) |
| 620 return; | 602 return; |
| 621 m_mainResource->removeClient(this); | 603 m_mainResource->removeClient(this); |
| 622 m_mainResource = nullptr; | 604 m_mainResource = 0; |
| 623 } | 605 } |
| 624 | 606 |
| 625 bool DocumentLoader::maybeCreateArchive() | 607 bool DocumentLoader::maybeCreateArchive() |
| 626 { | 608 { |
| 627 // Only the top-frame can load MHTML. | 609 // Only the top-frame can load MHTML. |
| 628 if (m_frame->tree().parent()) | 610 if (m_frame->tree().parent()) |
| 629 return false; | 611 return false; |
| 630 | 612 |
| 631 // Give the archive machinery a crack at this document. If the MIME type is
not an archive type, it will return 0. | 613 // Give the archive machinery a crack at this document. If the MIME type is
not an archive type, it will return 0. |
| 632 if (!isArchiveMIMEType(m_response.mimeType())) | 614 if (!isArchiveMIMEType(m_response.mimeType())) |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 702 | 684 |
| 703 if (m_request.url().isEmpty() && !frameLoader()->stateMachine()->creatingIni
tialEmptyDocument()) | 685 if (m_request.url().isEmpty() && !frameLoader()->stateMachine()->creatingIni
tialEmptyDocument()) |
| 704 m_request.setURL(blankURL()); | 686 m_request.setURL(blankURL()); |
| 705 m_response = ResourceResponse(m_request.url(), "text/html", 0, nullAtom, Str
ing()); | 687 m_response = ResourceResponse(m_request.url(), "text/html", 0, nullAtom, Str
ing()); |
| 706 finishedLoading(monotonicallyIncreasingTime()); | 688 finishedLoading(monotonicallyIncreasingTime()); |
| 707 return true; | 689 return true; |
| 708 } | 690 } |
| 709 | 691 |
| 710 void DocumentLoader::startLoadingMainResource() | 692 void DocumentLoader::startLoadingMainResource() |
| 711 { | 693 { |
| 712 RefPtrWillBeRawPtr<DocumentLoader> protect(this); | 694 RefPtr<DocumentLoader> protect(this); |
| 713 m_mainDocumentError = ResourceError(); | 695 m_mainDocumentError = ResourceError(); |
| 714 timing().markNavigationStart(); | 696 timing().markNavigationStart(); |
| 715 ASSERT(!m_mainResource); | 697 ASSERT(!m_mainResource); |
| 716 ASSERT(!m_loadingMainResource); | 698 ASSERT(!m_loadingMainResource); |
| 717 m_loadingMainResource = true; | 699 m_loadingMainResource = true; |
| 718 | 700 |
| 719 if (maybeLoadEmpty()) | 701 if (maybeLoadEmpty()) |
| 720 return; | 702 return; |
| 721 | 703 |
| 722 ASSERT(timing().navigationStart()); | 704 ASSERT(timing().navigationStart()); |
| (...skipping 11 matching lines...) Expand all Loading... |
| 734 ResourceRequest request(m_request); | 716 ResourceRequest request(m_request); |
| 735 DEFINE_STATIC_LOCAL(ResourceLoaderOptions, mainResourceLoadOptions, | 717 DEFINE_STATIC_LOCAL(ResourceLoaderOptions, mainResourceLoadOptions, |
| 736 (DoNotBufferData, AllowStoredCredentials, ClientRequestedCredentials, Ch
eckContentSecurityPolicy, DocumentContext)); | 718 (DoNotBufferData, AllowStoredCredentials, ClientRequestedCredentials, Ch
eckContentSecurityPolicy, DocumentContext)); |
| 737 FetchRequest cachedResourceRequest(request, FetchInitiatorTypeNames::documen
t, mainResourceLoadOptions); | 719 FetchRequest cachedResourceRequest(request, FetchInitiatorTypeNames::documen
t, mainResourceLoadOptions); |
| 738 m_mainResource = RawResource::fetchMainResource(cachedResourceRequest, fetch
er(), m_substituteData); | 720 m_mainResource = RawResource::fetchMainResource(cachedResourceRequest, fetch
er(), m_substituteData); |
| 739 if (!m_mainResource) { | 721 if (!m_mainResource) { |
| 740 m_request = ResourceRequest(); | 722 m_request = ResourceRequest(); |
| 741 // If the load was aborted by clearing m_request, it's possible the Appl
icationCacheHost | 723 // If the load was aborted by clearing m_request, it's possible the Appl
icationCacheHost |
| 742 // is now in a state where starting an empty load will be inconsistent.
Replace it with | 724 // is now in a state where starting an empty load will be inconsistent.
Replace it with |
| 743 // a new ApplicationCacheHost. | 725 // a new ApplicationCacheHost. |
| 744 if (m_applicationCacheHost) | |
| 745 m_applicationCacheHost->detachFromDocumentLoader(); | |
| 746 m_applicationCacheHost = ApplicationCacheHost::create(this); | 726 m_applicationCacheHost = ApplicationCacheHost::create(this); |
| 747 maybeLoadEmpty(); | 727 maybeLoadEmpty(); |
| 748 return; | 728 return; |
| 749 } | 729 } |
| 750 m_mainResource->addClient(this); | 730 m_mainResource->addClient(this); |
| 751 | 731 |
| 752 // A bunch of headers are set when the underlying ResourceLoader is created,
and m_request needs to include those. | 732 // A bunch of headers are set when the underlying ResourceLoader is created,
and m_request needs to include those. |
| 753 if (mainResourceLoader()) | 733 if (mainResourceLoader()) |
| 754 request = mainResourceLoader()->originalRequest(); | 734 request = mainResourceLoader()->originalRequest(); |
| 755 // If there was a fragment identifier on m_request, the cache will have stri
pped it. m_request should include | 735 // If there was a fragment identifier on m_request, the cache will have stri
pped it. m_request should include |
| 756 // the fragment identifier, so add that back in. | 736 // the fragment identifier, so add that back in. |
| 757 if (equalIgnoringFragmentIdentifier(m_request.url(), request.url())) | 737 if (equalIgnoringFragmentIdentifier(m_request.url(), request.url())) |
| 758 request.setURL(m_request.url()); | 738 request.setURL(m_request.url()); |
| 759 m_request = request; | 739 m_request = request; |
| 760 } | 740 } |
| 761 | 741 |
| 762 void DocumentLoader::cancelMainResourceLoad(const ResourceError& resourceError) | 742 void DocumentLoader::cancelMainResourceLoad(const ResourceError& resourceError) |
| 763 { | 743 { |
| 764 RefPtrWillBeRawPtr<DocumentLoader> protect(this); | 744 RefPtr<DocumentLoader> protect(this); |
| 765 ResourceError error = resourceError.isNull() ? ResourceError::cancelledError
(m_request.url()) : resourceError; | 745 ResourceError error = resourceError.isNull() ? ResourceError::cancelledError
(m_request.url()) : resourceError; |
| 766 | 746 |
| 767 if (mainResourceLoader()) | 747 if (mainResourceLoader()) |
| 768 mainResourceLoader()->cancel(error); | 748 mainResourceLoader()->cancel(error); |
| 769 | 749 |
| 770 mainReceivedError(error); | 750 mainReceivedError(error); |
| 771 } | 751 } |
| 772 | 752 |
| 773 void DocumentLoader::attachThreadedDataReceiver(PassRefPtrWillBeRawPtr<ThreadedD
ataReceiver> threadedDataReceiver) | 753 void DocumentLoader::attachThreadedDataReceiver(PassRefPtrWillBeRawPtr<ThreadedD
ataReceiver> threadedDataReceiver) |
| 774 { | 754 { |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 819 // This is only called by FrameLoader::replaceDocumentWhileExecutingJavaScriptUR
L() | 799 // This is only called by FrameLoader::replaceDocumentWhileExecutingJavaScriptUR
L() |
| 820 void DocumentLoader::replaceDocumentWhileExecutingJavaScriptURL(const DocumentIn
it& init, const String& source, Document* ownerDocument) | 800 void DocumentLoader::replaceDocumentWhileExecutingJavaScriptURL(const DocumentIn
it& init, const String& source, Document* ownerDocument) |
| 821 { | 801 { |
| 822 m_writer = createWriterFor(ownerDocument, init, mimeType(), m_writer ? m_wri
ter->encoding() : emptyAtom, true, ForceSynchronousParsing); | 802 m_writer = createWriterFor(ownerDocument, init, mimeType(), m_writer ? m_wri
ter->encoding() : emptyAtom, true, ForceSynchronousParsing); |
| 823 if (!source.isNull()) | 803 if (!source.isNull()) |
| 824 m_writer->appendReplacingData(source); | 804 m_writer->appendReplacingData(source); |
| 825 endWriting(m_writer.get()); | 805 endWriting(m_writer.get()); |
| 826 } | 806 } |
| 827 | 807 |
| 828 } // namespace blink | 808 } // namespace blink |
| OLD | NEW |