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

Side by Side Diff: third_party/WebKit/Source/core/css/CSSImageValue.cpp

Issue 1461193003: Revert of [Oilpan] Prepare full definition of classes before using Member (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Make patch applicable Created 5 years, 1 month 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 * (C) 1999-2003 Lars Knoll (knoll@kde.org) 2 * (C) 1999-2003 Lars Knoll (knoll@kde.org)
3 * Copyright (C) 2004, 2005, 2006, 2008 Apple Inc. All rights reserved. 3 * Copyright (C) 2004, 2005, 2006, 2008 Apple Inc. All rights reserved.
4 * 4 *
5 * This library is free software; you can redistribute it and/or 5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public 6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either 7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version. 8 * version 2 of the License, or (at your option) any later version.
9 * 9 *
10 * This library is distributed in the hope that it will be useful, 10 * This library is distributed in the hope that it will be useful,
(...skipping 28 matching lines...) Expand all
39 , m_absoluteURL(url.string()) 39 , m_absoluteURL(url.string())
40 , m_isCachePending(!image) 40 , m_isCachePending(!image)
41 , m_cachedImage(image) 41 , m_cachedImage(image)
42 { 42 {
43 } 43 }
44 44
45 CSSImageValue::~CSSImageValue() 45 CSSImageValue::~CSSImageValue()
46 { 46 {
47 } 47 }
48 48
49 StyleFetchedImage* CSSImageValue::cachedImage() const
50 {
51 ASSERT(!isCachePending());
52 return m_cachedImage.get();
53 }
54
55 StyleFetchedImage* CSSImageValue::cacheImage(Document* document, const ResourceL oaderOptions& options) 49 StyleFetchedImage* CSSImageValue::cacheImage(Document* document, const ResourceL oaderOptions& options)
56 { 50 {
57 ASSERT(document); 51 ASSERT(document);
58 52
59 if (m_isCachePending) { 53 if (m_isCachePending) {
60 m_isCachePending = false; 54 m_isCachePending = false;
61 55
62 FetchRequest request(ResourceRequest(m_absoluteURL), m_initiatorName.isE mpty() ? FetchInitiatorTypeNames::css : m_initiatorName, options); 56 FetchRequest request(ResourceRequest(m_absoluteURL), m_initiatorName.isE mpty() ? FetchInitiatorTypeNames::css : m_initiatorName, options);
63 request.mutableResourceRequest().setHTTPReferrer(SecurityPolicy::generat eReferrer(m_referrer.referrerPolicy, request.url(), m_referrer.referrer)); 57 request.mutableResourceRequest().setHTTPReferrer(SecurityPolicy::generat eReferrer(m_referrer.referrerPolicy, request.url(), m_referrer.referrer));
64 58
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 String CSSImageValue::customCSSText() const 100 String CSSImageValue::customCSSText() const
107 { 101 {
108 return serializeURI(m_relativeURL); 102 return serializeURI(m_relativeURL);
109 } 103 }
110 104
111 bool CSSImageValue::knownToBeOpaque(const LayoutObject* layoutObject) const 105 bool CSSImageValue::knownToBeOpaque(const LayoutObject* layoutObject) const
112 { 106 {
113 return m_cachedImage ? m_cachedImage->knownToBeOpaque(layoutObject) : false; 107 return m_cachedImage ? m_cachedImage->knownToBeOpaque(layoutObject) : false;
114 } 108 }
115 109
116 PassRefPtrWillBeRawPtr<CSSImageValue> CSSImageValue::valueWithURLMadeAbsolute()
117 {
118 return create(KURL(ParsedURLString, m_absoluteURL), m_cachedImage.get());
119 }
120
121 DEFINE_TRACE_AFTER_DISPATCH(CSSImageValue) 110 DEFINE_TRACE_AFTER_DISPATCH(CSSImageValue)
122 { 111 {
123 visitor->trace(m_cachedImage); 112 visitor->trace(m_cachedImage);
124 CSSValue::traceAfterDispatch(visitor); 113 CSSValue::traceAfterDispatch(visitor);
125 } 114 }
126 115
127 void CSSImageValue::reResolveURL(const Document& document) 116 void CSSImageValue::reResolveURL(const Document& document)
128 { 117 {
129 KURL url = document.completeURL(m_relativeURL); 118 KURL url = document.completeURL(m_relativeURL);
130 AtomicString urlString(url.string()); 119 AtomicString urlString(url.string());
131 if (urlString == m_absoluteURL) 120 if (urlString == m_absoluteURL)
132 return; 121 return;
133 m_absoluteURL = urlString; 122 m_absoluteURL = urlString;
134 m_isCachePending = true; 123 m_isCachePending = true;
135 m_cachedImage.clear(); 124 m_cachedImage.clear();
136 } 125 }
137 126
138 } // namespace blink 127 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/css/CSSImageValue.h ('k') | third_party/WebKit/Source/core/css/CSSRuleList.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698