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

Side by Side Diff: third_party/WebKit/Source/core/fetch/DocumentResource.cpp

Issue 2210473002: Mark ResourceClient/ImageResourceObserver finished just before notifying (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: tests Created 4 years, 4 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
OLDNEW
1 /* 1 /*
2 Copyright (C) 2010 Rob Buis <rwlbuis@gmail.com> 2 Copyright (C) 2010 Rob Buis <rwlbuis@gmail.com>
3 Copyright (C) 2011 Cosmin Truta <ctruta@gmail.com> 3 Copyright (C) 2011 Cosmin Truta <ctruta@gmail.com>
4 Copyright (C) 2012 University of Szeged 4 Copyright (C) 2012 University of Szeged
5 Copyright (C) 2012 Renata Hodovan <reni@webkit.org> 5 Copyright (C) 2012 Renata Hodovan <reni@webkit.org>
6 6
7 This library is free software; you can redistribute it and/or 7 This library is free software; you can redistribute it and/or
8 modify it under the terms of the GNU Library General Public 8 modify it under the terms of the GNU Library General Public
9 License as published by the Free Software Foundation; either 9 License as published by the Free Software Foundation; either
10 version 2 of the License, or (at your option) any later version. 10 version 2 of the License, or (at your option) any later version.
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 DocumentResource::~DocumentResource() 47 DocumentResource::~DocumentResource()
48 { 48 {
49 } 49 }
50 50
51 DEFINE_TRACE(DocumentResource) 51 DEFINE_TRACE(DocumentResource)
52 { 52 {
53 visitor->trace(m_document); 53 visitor->trace(m_document);
54 Resource::trace(visitor); 54 Resource::trace(visitor);
55 } 55 }
56 56
57 void DocumentResource::checkNotify() 57 void DocumentResource::checkNotify(MarkFinishedOption markFinishedOption)
58 { 58 {
59 if (m_data && mimeTypeAllowed()) { 59 if (m_data && mimeTypeAllowed()) {
60 // We don't need to create a new frame because the new document belongs to the parent UseElement. 60 // We don't need to create a new frame because the new document belongs to the parent UseElement.
61 m_document = createDocument(response().url()); 61 m_document = createDocument(response().url());
62 m_document->setContent(decodedText()); 62 m_document->setContent(decodedText());
63 } 63 }
64 Resource::checkNotify(); 64 Resource::checkNotify(markFinishedOption);
65 } 65 }
66 66
67 bool DocumentResource::mimeTypeAllowed() const 67 bool DocumentResource::mimeTypeAllowed() const
68 { 68 {
69 ASSERT(getType() == SVGDocument); 69 ASSERT(getType() == SVGDocument);
70 AtomicString mimeType = response().mimeType(); 70 AtomicString mimeType = response().mimeType();
71 if (response().isHTTP()) 71 if (response().isHTTP())
72 mimeType = httpContentType(); 72 mimeType = httpContentType();
73 return mimeType == "image/svg+xml" 73 return mimeType == "image/svg+xml"
74 || mimeType == "text/xml" 74 || mimeType == "text/xml"
75 || mimeType == "application/xml" 75 || mimeType == "application/xml"
76 || mimeType == "application/xhtml+xml"; 76 || mimeType == "application/xhtml+xml";
77 } 77 }
78 78
79 Document* DocumentResource::createDocument(const KURL& url) 79 Document* DocumentResource::createDocument(const KURL& url)
80 { 80 {
81 switch (getType()) { 81 switch (getType()) {
82 case SVGDocument: 82 case SVGDocument:
83 return XMLDocument::createSVG(DocumentInit(url)); 83 return XMLDocument::createSVG(DocumentInit(url));
84 default: 84 default:
85 // FIXME: We'll add more types to support HTMLImports. 85 // FIXME: We'll add more types to support HTMLImports.
86 ASSERT_NOT_REACHED(); 86 ASSERT_NOT_REACHED();
87 return nullptr; 87 return nullptr;
88 } 88 }
89 } 89 }
90 90
91 } // namespace blink 91 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698