Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(136)

Side by Side Diff: Source/core/loader/DocumentLoader.cpp

Issue 1063913002: Revert of Remove ResourceFetcher's access to a real FetchContext at frame detach time (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/core/html/imports/LinkImport.cpp ('k') | Source/core/loader/FrameFetchContext.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 } 100 }
101 101
102 ResourceLoader* DocumentLoader::mainResourceLoader() const 102 ResourceLoader* DocumentLoader::mainResourceLoader() const
103 { 103 {
104 return m_mainResource ? m_mainResource->loader() : 0; 104 return m_mainResource ? m_mainResource->loader() : 0;
105 } 105 }
106 106
107 DocumentLoader::~DocumentLoader() 107 DocumentLoader::~DocumentLoader()
108 { 108 {
109 ASSERT(!m_frame || !isLoading()); 109 ASSERT(!m_frame || !isLoading());
110 static_cast<FrameFetchContext&>(m_fetcher->context()).clearDocumentLoader();
110 clearMainResourceHandle(); 111 clearMainResourceHandle();
111 m_applicationCacheHost->dispose(); 112 m_applicationCacheHost->dispose();
112 } 113 }
113 114
114 unsigned long DocumentLoader::mainResourceIdentifier() const 115 unsigned long DocumentLoader::mainResourceIdentifier() const
115 { 116 {
116 return m_mainResource ? m_mainResource->identifier() : 0; 117 return m_mainResource ? m_mainResource->identifier() : 0;
117 } 118 }
118 119
119 Document* DocumentLoader::document() const 120 Document* DocumentLoader::document() const
(...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after
554 void DocumentLoader::detachFromFrame() 555 void DocumentLoader::detachFromFrame()
555 { 556 {
556 ASSERT(m_frame); 557 ASSERT(m_frame);
557 RefPtrWillBeRawPtr<LocalFrame> protectFrame(m_frame); 558 RefPtrWillBeRawPtr<LocalFrame> protectFrame(m_frame);
558 RefPtr<DocumentLoader> protectLoader(this); 559 RefPtr<DocumentLoader> protectLoader(this);
559 560
560 // It never makes sense to have a document loader that is detached from its 561 // It never makes sense to have a document loader that is detached from its
561 // frame have any loads active, so go ahead and kill all the loads. 562 // frame have any loads active, so go ahead and kill all the loads.
562 stopLoading(); 563 stopLoading();
563 564
564 m_fetcher->clearContext();
565 m_applicationCacheHost->setApplicationCache(0); 565 m_applicationCacheHost->setApplicationCache(0);
566 InspectorInstrumentation::loaderDetachedFromFrame(m_frame, this); 566 InspectorInstrumentation::loaderDetachedFromFrame(m_frame, this);
567 m_frame = 0; 567 m_frame = 0;
568 } 568 }
569 569
570 void DocumentLoader::clearMainResourceLoader() 570 void DocumentLoader::clearMainResourceLoader()
571 { 571 {
572 m_loadingMainResource = false; 572 m_loadingMainResource = false;
573 } 573 }
574 574
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after
783 // This is only called by FrameLoader::replaceDocumentWhileExecutingJavaScriptUR L() 783 // This is only called by FrameLoader::replaceDocumentWhileExecutingJavaScriptUR L()
784 void DocumentLoader::replaceDocumentWhileExecutingJavaScriptURL(const DocumentIn it& init, const String& source, Document* ownerDocument) 784 void DocumentLoader::replaceDocumentWhileExecutingJavaScriptURL(const DocumentIn it& init, const String& source, Document* ownerDocument)
785 { 785 {
786 m_writer = createWriterFor(ownerDocument, init, mimeType(), m_writer ? m_wri ter->encoding() : emptyAtom, true, ForceSynchronousParsing); 786 m_writer = createWriterFor(ownerDocument, init, mimeType(), m_writer ? m_wri ter->encoding() : emptyAtom, true, ForceSynchronousParsing);
787 if (!source.isNull()) 787 if (!source.isNull())
788 m_writer->appendReplacingData(source); 788 m_writer->appendReplacingData(source);
789 endWriting(m_writer.get()); 789 endWriting(m_writer.get());
790 } 790 }
791 791
792 } // namespace blink 792 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/html/imports/LinkImport.cpp ('k') | Source/core/loader/FrameFetchContext.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698