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

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

Issue 2327643003: Replace ASSERT*() with DCHECK*() in core/fetch/ and core/loader/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 4 years, 3 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) 1998 Lars Knoll (knoll@mpi-hd.mpg.de) 2 Copyright (C) 1998 Lars Knoll (knoll@mpi-hd.mpg.de)
3 Copyright (C) 2001 Dirk Mueller (mueller@kde.org) 3 Copyright (C) 2001 Dirk Mueller (mueller@kde.org)
4 Copyright (C) 2002 Waldo Bastian (bastian@kde.org) 4 Copyright (C) 2002 Waldo Bastian (bastian@kde.org)
5 Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com) 5 Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com)
6 Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. 6 Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
7 7
8 This library is free software; you can redistribute it and/or 8 This library is free software; you can redistribute it and/or
9 modify it under the terms of the GNU Library General Public 9 modify it under the terms of the GNU Library General Public
10 License as published by the Free Software Foundation; either 10 License as published by the Free Software Foundation; either
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 applyXSLRequestProperties(request.mutableResourceRequest()); 52 applyXSLRequestProperties(request.mutableResourceRequest());
53 request.makeSynchronous(); 53 request.makeSynchronous();
54 XSLStyleSheetResource* resource = toXSLStyleSheetResource(fetcher->requestRe source(request, XSLStyleSheetResourceFactory())); 54 XSLStyleSheetResource* resource = toXSLStyleSheetResource(fetcher->requestRe source(request, XSLStyleSheetResourceFactory()));
55 if (resource && resource->data()) 55 if (resource && resource->data())
56 resource->m_sheet = resource->decodedText(); 56 resource->m_sheet = resource->decodedText();
57 return resource; 57 return resource;
58 } 58 }
59 59
60 XSLStyleSheetResource* XSLStyleSheetResource::fetch(FetchRequest& request, Resou rceFetcher* fetcher) 60 XSLStyleSheetResource* XSLStyleSheetResource::fetch(FetchRequest& request, Resou rceFetcher* fetcher)
61 { 61 {
62 ASSERT(RuntimeEnabledFeatures::xsltEnabled()); 62 DCHECK(RuntimeEnabledFeatures::xsltEnabled());
63 applyXSLRequestProperties(request.mutableResourceRequest()); 63 applyXSLRequestProperties(request.mutableResourceRequest());
64 return toXSLStyleSheetResource(fetcher->requestResource(request, XSLStyleShe etResourceFactory())); 64 return toXSLStyleSheetResource(fetcher->requestResource(request, XSLStyleShe etResourceFactory()));
65 } 65 }
66 66
67 XSLStyleSheetResource::XSLStyleSheetResource(const ResourceRequest& resourceRequ est, const ResourceLoaderOptions& options, const String& charset) 67 XSLStyleSheetResource::XSLStyleSheetResource(const ResourceRequest& resourceRequ est, const ResourceLoaderOptions& options, const String& charset)
68 : StyleSheetResource(resourceRequest, XSLStyleSheet, options, "text/xsl", ch arset) 68 : StyleSheetResource(resourceRequest, XSLStyleSheet, options, "text/xsl", ch arset)
69 { 69 {
70 } 70 }
71 71
72 void XSLStyleSheetResource::didAddClient(ResourceClient* c) 72 void XSLStyleSheetResource::didAddClient(ResourceClient* c)
73 { 73 {
74 ASSERT(StyleSheetResourceClient::isExpectedType(c)); 74 DCHECK(StyleSheetResourceClient::isExpectedType(c));
75 Resource::didAddClient(c); 75 Resource::didAddClient(c);
76 if (!isLoading()) 76 if (!isLoading())
77 static_cast<StyleSheetResourceClient*>(c)->setXSLStyleSheet(resourceRequ est().url(), response().url(), m_sheet); 77 static_cast<StyleSheetResourceClient*>(c)->setXSLStyleSheet(resourceRequ est().url(), response().url(), m_sheet);
78 } 78 }
79 79
80 void XSLStyleSheetResource::checkNotify() 80 void XSLStyleSheetResource::checkNotify()
81 { 81 {
82 if (data()) 82 if (data())
83 m_sheet = decodedText(); 83 m_sheet = decodedText();
84 84
85 ResourceClientWalker<StyleSheetResourceClient> w(clients()); 85 ResourceClientWalker<StyleSheetResourceClient> w(clients());
86 while (StyleSheetResourceClient* c = w.next()) 86 while (StyleSheetResourceClient* c = w.next())
87 c->setXSLStyleSheet(resourceRequest().url(), response().url(), m_sheet); 87 c->setXSLStyleSheet(resourceRequest().url(), response().url(), m_sheet);
88 } 88 }
89 89
90 } // namespace blink 90 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698