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

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

Issue 1085033003: Introduce InspectorIdentifiers<> and use it to assign/lookup LocalFrame and DocumentLoader (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: win build error fixed 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/inspector/PageRuntimeAgent.cpp ('k') | no next file » | 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 14 matching lines...) Expand all
25 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 26 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
27 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 */ 28 */
29 29
30 #include "config.h" 30 #include "config.h"
31 #include "core/loader/DocumentLoader.h" 31 #include "core/loader/DocumentLoader.h"
32 32
33 #include "core/dom/Document.h" 33 #include "core/dom/Document.h"
34 #include "core/dom/DocumentParser.h" 34 #include "core/dom/DocumentParser.h"
35 #include "core/dom/WeakIdentifierMap.h"
35 #include "core/events/Event.h" 36 #include "core/events/Event.h"
36 #include "core/fetch/FetchInitiatorTypeNames.h" 37 #include "core/fetch/FetchInitiatorTypeNames.h"
37 #include "core/fetch/MemoryCache.h" 38 #include "core/fetch/MemoryCache.h"
38 #include "core/fetch/ResourceFetcher.h" 39 #include "core/fetch/ResourceFetcher.h"
39 #include "core/fetch/ResourceLoader.h" 40 #include "core/fetch/ResourceLoader.h"
40 #include "core/frame/FrameHost.h" 41 #include "core/frame/FrameHost.h"
41 #include "core/frame/LocalDOMWindow.h" 42 #include "core/frame/LocalDOMWindow.h"
42 #include "core/frame/LocalFrame.h" 43 #include "core/frame/LocalFrame.h"
43 #include "core/frame/csp/ContentSecurityPolicy.h" 44 #include "core/frame/csp/ContentSecurityPolicy.h"
44 #include "core/html/HTMLFrameOwnerElement.h" 45 #include "core/html/HTMLFrameOwnerElement.h"
(...skipping 511 matching lines...) Expand 10 before | Expand all | Expand 10 after
556 { 557 {
557 ASSERT(m_frame); 558 ASSERT(m_frame);
558 RefPtrWillBeRawPtr<LocalFrame> protectFrame(m_frame); 559 RefPtrWillBeRawPtr<LocalFrame> protectFrame(m_frame);
559 RefPtr<DocumentLoader> protectLoader(this); 560 RefPtr<DocumentLoader> protectLoader(this);
560 561
561 // It never makes sense to have a document loader that is detached from its 562 // It never makes sense to have a document loader that is detached from its
562 // frame have any loads active, so go ahead and kill all the loads. 563 // frame have any loads active, so go ahead and kill all the loads.
563 stopLoading(); 564 stopLoading();
564 565
565 m_applicationCacheHost->setApplicationCache(0); 566 m_applicationCacheHost->setApplicationCache(0);
566 InspectorInstrumentation::loaderDetachedFromFrame(m_frame, this); 567 WeakIdentifierMap<DocumentLoader>::notifyObjectDestroyed(this);
567 m_frame = 0; 568 m_frame = 0;
568 } 569 }
569 570
570 void DocumentLoader::clearMainResourceLoader() 571 void DocumentLoader::clearMainResourceLoader()
571 { 572 {
572 m_loadingMainResource = false; 573 m_loadingMainResource = false;
573 } 574 }
574 575
575 void DocumentLoader::clearMainResourceHandle() 576 void DocumentLoader::clearMainResourceHandle()
576 { 577 {
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
783 // This is only called by FrameLoader::replaceDocumentWhileExecutingJavaScriptUR L() 784 // This is only called by FrameLoader::replaceDocumentWhileExecutingJavaScriptUR L()
784 void DocumentLoader::replaceDocumentWhileExecutingJavaScriptURL(const DocumentIn it& init, const String& source, Document* ownerDocument) 785 void DocumentLoader::replaceDocumentWhileExecutingJavaScriptURL(const DocumentIn it& init, const String& source, Document* ownerDocument)
785 { 786 {
786 m_writer = createWriterFor(ownerDocument, init, mimeType(), m_writer ? m_wri ter->encoding() : emptyAtom, true, ForceSynchronousParsing); 787 m_writer = createWriterFor(ownerDocument, init, mimeType(), m_writer ? m_wri ter->encoding() : emptyAtom, true, ForceSynchronousParsing);
787 if (!source.isNull()) 788 if (!source.isNull())
788 m_writer->appendReplacingData(source); 789 m_writer->appendReplacingData(source);
789 endWriting(m_writer.get()); 790 endWriting(m_writer.get());
790 } 791 }
791 792
792 } // namespace blink 793 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/inspector/PageRuntimeAgent.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698